This is the mail archive of the binutils@sources.redhat.com 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: Can I fix the content of symbol table in GAS???


Hi Peng-Sheng,

Currently I am developing the gas for a new DSP processor.
In GAS, I want to add a symbol "tmp" in symbol table and
relocate its content.
I don't know how to program it and I just can do relocation in text section.
Can I do relocation in symbol table?

Not really. Generally speaking relocations are used to alter the contents of code and data sections not the symbol table.


You can create new symbols to insert into the symbol table. For examples of this see the file <binutils>/gas/config/tc-ia64.c and search for occurrences of "symbol_new".

What exactly do you mean when you say that you want to relocate the content of symbol "tmp". Do you mean that you want to be able set its address at link-time rather than assemble-time ? Or do you mean that you want to alter the contents of the memory location whose address is the value of the symbol "tmp" ?

Cheers
  Nick


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