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 get symbol value?


Hi Oleg,

I am porting linker for new target and want to create new relocation using value of absolute symbol. What is the simplest way to get this symbol value?

Assuming that you have a pointer to the symbol's bfd_symbol structure then you can get its value from the 'value' field. ie:


struct bfd_symbol * sym;

sym->value

Have a look in the source code for multiple examples of this.

Cheers
  Nick



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