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

pschen pschen@pllab.cs.nthu.edu.tw
Thu Jul 29 13:53:00 GMT 2004


Dear Nick:

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

Thanks your reply.
I want to support pseudo function "ltoff", but the porting of IA64 and BFD
is hard to read.
My idea is that inserting a symbol to solve the probem of pseudo function
"ltoff".
If @ltoff(b) occurred, a symbol "tmp" whose content is the address of "b"
will
be inserted into symbol table. Then, instruction relocation will be done for
"tmp", not "b".
I have got a success on this idea.

Sincerely,

Peng-Sheng




More information about the Binutils mailing list