This is the mail archive of the 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???

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
> > 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
If @ltoff(b) occurred, a symbol "tmp" whose content is the address of "b"
be inserted into symbol table. Then, instruction relocation will be done for
"tmp", not "b".
I have got a success on this idea.



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