[PATCH] Leave merging of non-visibility flags to the backends

Alan Modra amodra@bigpond.net.au
Wed Dec 6 07:24:00 GMT 2006


On Tue, Aug 15, 2006 at 01:16:05PM +0100, Nick Clifton wrote:
> >2006-08-10  Thiemo Seufer  <ths@mips.com>
> >            Nigel Stephens  <nigel@mips.com>
> >
> >	* elf32-mips.c, elf64-mips.c, elfn32-mips.c
> >	(elf_backend_merge_symbol_attribute): Define.
> >	* elflink.c (elf_link_add_object_symbols): Merge only the ELF
> >	visibility flags.
> >	* elfxx-mips.c (_bfd_mips_elf_merge_symbol_attribute): New function.

This patch caused testsuite failures on alpha.  Fixed like so.

	* elf64-alpha.c (elf64_alpha_merge_symbol_attribute): New function.
	(elf_backend_merge_symbol_attribute): Define.

Index: bfd/elf64-alpha.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-alpha.c,v
retrieving revision 1.154
diff -u -p -r1.154 elf64-alpha.c
--- bfd/elf64-alpha.c	17 Oct 2006 13:41:47 -0000	1.154
+++ bfd/elf64-alpha.c	5 Dec 2006 13:22:40 -0000
@@ -2035,6 +2035,19 @@ elf64_alpha_adjust_dynamic_symbol (struc
   return TRUE;
 }
 
+/* Record STO_ALPHA_NOPV and STO_ALPHA_STD_GPLOAD.  */
+
+static void
+elf64_alpha_merge_symbol_attribute (struct elf_link_hash_entry *h,
+				    const Elf_Internal_Sym *isym,
+				    bfd_boolean definition,
+				    bfd_boolean dynamic)
+{
+  if (!dynamic && definition)
+    h->other = ((h->other & ELF_ST_VISIBILITY (-1))
+		| (isym->st_other & ~ELF_ST_VISIBILITY (-1)));
+}
+
 /* Symbol versioning can create new symbols, and make our old symbols
    indirect to the new ones.  Consolidate the got and reloc information
    in these situations.  */
@@ -5271,6 +5284,8 @@ static const struct elf_size_info alpha_
   elf64_alpha_create_dynamic_sections
 #define elf_backend_adjust_dynamic_symbol \
   elf64_alpha_adjust_dynamic_symbol
+#define elf_backend_merge_symbol_attribute \
+  elf64_alpha_merge_symbol_attribute
 #define elf_backend_always_size_sections \
   elf64_alpha_always_size_sections
 #define elf_backend_size_dynamic_sections \

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre



More information about the Binutils mailing list