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 13, 2001, amodra@one.net.au wrote:

> So you need to test for X_op_symbol.r == 0 as well as X_add_number == 0.

> IMNSHO, using O_md* is not a very good idea.  You are effectively
> creating a group of O_symbol aliases which unnecessarily complicates
> things, and adds a maintenance burden in case of future O_symbol
> changes.

OTOH, changing make_expr_symbol() such that X_op_symbol suddenly
becomes significant might modify the behavior of ports that, for
whatever reason, have it set to non-NULL for O_symbols.

> One way to cure this would be to have a variant of make_expr_symbol
> that called symbol_find_or_make instead of symbol_create.  You'd
> concatenate the original symbol name with the reloc name or something.
> Oh, and prefix with FAKE_LABEL_NAME, so they don't appear in the
> symbol table.

Hmm...  This is getting closer and closer to my previous suggestion,
that involved creating the symbols within md_parse_name.  Your
suggestion would still have the disadvantage that the
symbol+relocation names would have to be created and looked up at
every reference.  In my original implementation, they'd only be
created once, and cached as local fields of the main symbol.

>> 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 :-)

> It's probably worth adding just for symmetry.  Commit it if you like.

Done.

-- 
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]