This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
RFA: fix default_assemble_visibility (Was: sh-elf toolchain broken on mainline)
- From: Joern Rennecke <joern dot rennecke at superh dot com>
- To: gcc-patches at gcc dot gnu dot org, Jakub Jelinek <jakub at redhat dot com>
- Cc: "H.J. Lu" <hjl at gnu dot org>, binutils at sources dot redhat dot com, gcc at gcc dot gnu dot org
- Date: Mon, 28 Apr 2003 19:57:39 +0100
- Subject: RFA: fix default_assemble_visibility (Was: sh-elf toolchain broken on mainline)
- Organization: SuperH UK Ltd.
- References: <3EAD7081.FAE963B1@superh.com>
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
2003-04-28 J"orn Rennecke <joern dot rennecke at superh dot 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