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]

Re: Better handling of PIC suffixes in GAS expression parser


On Apr  9, 2001, Alan Modra <alan@linuxcare.com.au> wrote:

> On Tue, 10 Apr 2001, Alan Modra wrote:
>> Hint for modifying existing code:  O_reloc is really a variation on
>> O_symbol, so code handling O_symbol should accept O_reloc too in most
>> cases.

> Hmm, considering the above, there's probably no need for an O_reloc
> operand type at all.  The existing O_symbol can be extended to store the
> reloc in X_op_symbol.

Except that make_expr_symbol symbol returns X_add_symbol for O_symbol
expressions with X_add_number == 0.

I ended up using O_md[1-3] for GOT, PLT and GOTOFF, then modifying
them to O_symbol at the time of emitting the relocation.  It works
beautifully.  Except that it creates a new expression symbol for each
occurrence of a @GOT, @PLT or @GOTOFF reference, which is exactly what
I was trying to avoid.

Anyway, case closed.  I no longer need the patch to add
machine-dependent attributes to local symbols, but I'd still like an
opinion on whether this might be useful for other targets or it's
something that should be avoided at all costs :-)

Thanks!

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me


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