Patch to convert ASM_GLOBALIZE_LABEL to a target hook

David Edelsohn dje@watson.ibm.com
Thu Sep 12 20:09:00 GMT 2002


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
refererences. 

David



More information about the Gcc-patches mailing list