This is the mail archive of the mailing list for the GCC 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: symbol encoding cleanup plan

Richard Henderson wrote:

On Sat, Aug 31, 2002 at 08:28:51AM -0400, Kaveh R. Ghazi wrote:

Ok I'll bite.  Let's hear them.

SYMBOL_REF needs to be extended to three arguments. The second
argument would be an XINT set of flag bits, the third argument
would be the DECL, if available.

We would define a common set of flag bits that represent what
many ports use encode_section_info for:

/* A function, or function alternate entry. */
#define SYMBOL_CODE 1

/* In the small data area. */
#define SYMBOL_SMALL 2

/* Bound within this module. */
#define SYMBOL_LOCAL 4

/* Defined within this unit of translation. */

/* A TLS symbol. */
#define SYMBOL_TLS 16

/* First bit available to the target. */
#define SYMBOL_MACH_DEP 32

The encode_section_info hook would still be available to targets to do target-specific stuff, but the vast majority
of them wouldn't need to do anything now. In the worst
case (running out of mach_dep bits), the DECL would still
be available, so the target could re-derive whatever it
needed instead of caching the data.

The "*" leader is, imo, stupid. We should simply apply the
user_label_prefix immediately when creating the symbol_ref.

There's some bizzare transformations that happen for darwin
arc, arm-aof, i370; if these can't be done with encode_section_info,
then perhaps a new hook is required; the default would simply
add user_label_prefix.

For Darwin, the encoded info is text vs data, and defined vs not-defined,
which you're proposing to support with SYMBOL_CODE and
SYMBOL_THIS_UOT, so that takes care of weird Darwin encoding
bits (modulo a "private extern" bit that is in the Apple GCC only, but
a spare machine-dependent bit would cover that too).

So this sounds like it would get rid of some funky Darwin code.


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