Can I fix the content of symbol table in GAS???

Nick Clifton nickc@redhat.com
Thu Jul 29 13:36:00 GMT 2004


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



More information about the Binutils mailing list