RFC: Add --dump-function to objdump
Tristan Gingold
gingold@adacore.com
Mon Sep 22 07:20:00 GMT 2014
On 19 Sep 2014, at 23:12, Cary Coutant <ccoutant@google.com> wrote:
>> I need to find in which section a function is defined as well as what
>> relocations are in the function. I come up with a new --dump-function
>> option to objdump:
>>
>> [hjl@gnu-6 binutils]$ ./objdump --dump-function _start /tmp/sort3.o
>>
>> /tmp/sort3.o: file format elf64-x86-64
>>
>> Function `_start' defined in section `.text' with relocations:
>> R_X86_64_64 .text.func2
>> R_X86_64_64 .text.func2
>> [hjl@gnu-6 binutils]$
>>
>> Is this a useful addition?
>
> This is just a suggestion, but I think I'd find it more useful as a
> filter that could be applied to other objdump options:
Seconded. By just reading the switch name, I thought it was
disassembling.
> objdump -r --only-section func filename.o
>
> Where the parameter to --only-section could be either a section name
> or a symbol name that would select the section where the symbol is
> defined. I've wanted to do something like this quite often.
I think HJ wanted something like --just-symbol (after all, you may
also dump relocations of a data symbol).
If you want to restrict to a section I'm ok.
(I am not sure we need to allow a symbol name for --only-section).
Tristan.
More information about the Binutils
mailing list