This is the mail archive of the binutils@sourceware.org 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: gold's target->make_symbol()


From: Ian Lance Taylor <iant@google.com>
Date: Thu, 17 Apr 2008 00:27:42 -0700

> Maybe we should switch to a different approach.  When we see an ELF
> symbol with a type between STT_LOOS and STT_HIPROC we should create an
> ordinary Sized_symbol, and then call a target hook to initialize it.
> Unfortunately this general approach will require target hooks for
> every case where we make a decision based on the symbol's type.  I
> can't think of a clean way to do this while keeping Symbol from having
> a virtual table.

I'm wondering if it can be done so simply.

For example, for STT_REGISTER symbols there is a NULL "" name attached
to every symbol for registers being used as scratch values.  The
distinguishing factor is that the "value" which indicates which global
register is being referenced.

Currently if you use a normal symbol gold is just going to obliterate
the STT_REGISTER symbols other than the first one.  We don't want
that, we want to collect all of the STT_REGISTER symbols with
different st_value fields, validate them, and propagate them into
the output file as necessary.

I guess your ideas come from situations like SHN_X86_64_LCOMMON, which
is more in line with traditional symbol handling.


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