RFA: fix default_assemble_visibility (Was: sh-elf toolchain broken on mainline)
Joern Rennecke
joern.rennecke@superh.com
Mon Apr 28 18:59:00 GMT 2003
Joern Rennecke wrote:
> The symbol __dso_handle should both used and defined in crtbegin.o, made
> gcc/crtstuff.c . Since sh-elf uses "_" as USER_LABEL_PREFIX, the actual
> symbol in the symbol table should be ___dso_handle .
> If nm and/or strings are to be trusted, that is not the case:
>
> 00000000 D ___dso_handle
> U __dso_handle
>
> I.e. the definition gets the USER_LABEL_PREFIX, but the use does not -
> I haven't found out why yet.
It turns out that gcc emits the symbol for the .hidden directive incorrectly -
instead of using assemble_name, it strips the name encoding manually, and
then calls fprintf with the result.
--
--------------------------
SuperH (UK) Ltd.
2410 Aztec West / Almondsbury / BRISTOL / BS32 4QX
T:+44 1454 465658
-------------- next part --------------
2003-04-28 J"orn Rennecke <joern.rennecke@superh.com>
* varasm.c (default_assemble_visibility): Use assemble_name.
Index: varasm.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/varasm.c,v
retrieving revision 1.345
diff -p -r1.345 varasm.c
*** varasm.c 28 Apr 2003 04:13:48 -0000 1.345
--- varasm.c 28 Apr 2003 18:56:13 -0000
*************** default_assemble_visibility (decl, vis)
*** 4485,4496 ****
const char *name, *type;
! name = (* targetm.strip_name_encoding)
! (IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)));
type = visibility_types[vis];
#ifdef HAVE_GAS_HIDDEN
! fprintf (asm_out_file, "\t.%s\t%s\n", type, name);
#else
warning ("visibility attribute not supported in this configuration; ignored");
#endif
--- 4485,4497 ----
const char *name, *type;
! name = (IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)));
type = visibility_types[vis];
#ifdef HAVE_GAS_HIDDEN
! fprintf (asm_out_file, "\t.%s\t", type);
! assemble_name (asm_out_file, name);
! fprintf (asm_out_file, "\n");
#else
warning ("visibility attribute not supported in this configuration; ignored");
#endif
More information about the Binutils
mailing list