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)?


Hi Pan,

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.

Please feel free to have a go at implementing this then. For just simple direct memory references it should not be too hard.


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.

Yes. In fact a lot of information that gcc holds about a program is lost when it emits the assembler output.


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

Well 2. might not necessarily be true. For example if an init function calls malloc() that does not necessarily mean that malloc() is an init function.


What exactly do you mean by "support for .init sections" anyway ? Are you trying to perform some kind of garbage collection like the linkers --gc-sections option ?

Cheers
  Nick



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