This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFC: Add --dump-function to objdump


> 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:

  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.

-cary


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]