RFC: Add --dump-function to objdump
H.J. Lu
hjl.tools@gmail.com
Mon Sep 22 15:38:00 GMT 2014
On Mon, Sep 22, 2014 at 12:20 AM, Tristan Gingold <gingold@adacore.com> wrote:
>
> 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).
>
Thanks for the feedbacks. I will find a different approach for
my problem.
--
H.J.
More information about the Binutils
mailing list