This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: RFC: Add --dump-function to objdump
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Tristan Gingold <gingold at adacore dot com>
- Cc: Cary Coutant <ccoutant at google dot com>, Binutils <binutils at sourceware dot org>
- Date: Mon, 22 Sep 2014 08:38:34 -0700
- Subject: Re: RFC: Add --dump-function to objdump
- Authentication-results: sourceware.org; auth=none
- References: <20140919183908 dot GA4585 at intel dot com> <CAHACq4rxTFSeYN+YojSEPFQ8e0PFLXMFRYDNWpGG9Uen0acFgg at mail dot gmail dot com> <4C241614-DE69-4500-B84A-C6E7CEA786EC at adacore dot com>
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.