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: How to list all symbolic names for references to global varibables and functions with objdump (for MIPS arch)?


> In essence though the answer is "no", because it is just too difficult to
> recognise all references to global variables or functions.  A global
> variable might be accessed directly or via a base address plus an offset, or
> loaded into one register and then copied into another register, or aliased
> via a union or type punning.  Functions can have multiple entry points, or
> can be overlayed or even dynamically constructed at run-time.
>
> Cheers
>  Nick
>

It does be difficult to recoginse all direct or inredirect references
in all cases. But I just want objdump to recoginse all direct
references, like variable assignments and argument passing. I think
gcc keeps a reference table for each symbol during compilation since
gcc can give warnings about unused variables and functions. Maybe
these messages are discarded on linking.
My goal is to implement support for .init sections in my system. So I
want to design a tiny tool to find out all init functions
automatically. I think this can be achieved by the following approach:
1. The entry function is an init function.
2. A function is called only by init functions is an init function
Without accurate reference information, the results will not be exact.
It will be good if objdump can recoginse all direct references or
there exists some other tool which can parse the source and show all
references.


Best Regards
---------------
PRC
Dec 3, 2008


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