Any option to objdump just one function ?
Ciro Santilli
ciro.santilli@gmail.com
Wed Jul 1 17:12:00 GMT 2015
Thanks for the reply.
On Wed, Jul 1, 2015 at 6:21 PM, Nicholas Clifton <nickc@redhat.com> wrote:
> Hi Ciro,
>
>> This is a reply to:
>> https://sourceware.org/ml/binutils/2010-04/msg00445.html
>>
>> Is this feature technically feasible? Seems simple, but I may be
>> missing something.
>
>
> Technically feasible yes, but I think unnecessary.
>
>
>> Would you be interested in a patch that a adds a new option like:
>>
>> objdump -d --function main main.o
>
>
> I don't think so. I have already described several methods whereby this
> functionality could be achieved without modifying objdump, so I really do
> not see the need.
>
I feel that the solutions mentioned so fare are not very satisfactory:
- gdb disassemble:
- only woks on executables, not object files or shared libraries (?)
- objdump has useful ways to visualize code that gdb does not,
e.g. -S: http://stackoverflow.com/questions/9970636/view-both-assembly-and-c-code
- -ffunction-section : requires a recompile
- --start-address and --stop-address= : how to you get the addresses beforehand?
There also seem to be more people who want this:
http://stackoverflow.com/questions/22769246/disassemble-one-function-using-objdump
Currently the best solution I see if one is really motivated is to
pass it to awk, but the overhead of piping / creating the alias is a
bit annoying.
Of course, if you think its not worth the review time, I understand,
not a blocking issue either.
> Cheers
> Nick
>
>
More information about the Binutils
mailing list