This is the mail archive of the
mailing list for the GCC project.
Re: Patch to convert ASM_GLOBALIZE_LABEL to a target hook
- From: David Edelsohn <dje at watson dot ibm dot com>
- To: Richard Henderson <rth at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 12 Sep 2002 23:09:23 -0400
- Subject: Re: Patch to convert ASM_GLOBALIZE_LABEL to a target hook
- References: <20020830013438.GA10283@redhat.com>
David> The default ASM_OUTPUT_LABELREF simply calls asm_fprintf without
David> any strip_name_encoding.
Richard> Right, but the default ASM_OUTPUT_LABELREF assumes that
Richard> no encodings are needed except "*". If you define an
Richard> encode_section_info, you need to handle this; everyone
Richard> else does this.
I looked into this a little bit and the problem with stripping the
encoding in ASM_OUTPUT_LABELREF appears to be ASM_OUTPUT_SYMBOL_REF. For
XCOFF, one mostly wants to reference the symbol *with* the storage mapping
class decoration. (Actually one wants to be more discriminating, but that
requires GCC being smarter about storage layout and pools.) GCC for XCOFF
currently references most symbols as if they were external, forcing the
linker resolve them, instead of referencing local symbols with local
names, allowing the assembler to resolve them.
If one strips the storage mapping class encoding in
ASM_OUTPUT_LABELREF, then ASM_OUTPUT_SYMBOL_REF cannot call assemble_name
(which calls ASM_OUTPUT_LABELREF). The implementation would need to
duplicate that entire function and call asm_fprintf directly. Basically
GCC's hooks are not quite what XCOFF needs -- either it strips the
encoding too much or too little.
I doubt that it is worth fixing this until better storage
management allows/requires the extra level of detail in SYMBOL_REF