This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[committed] PR 10549: MIPS/LD: Handle OSABI setting for STB_GNU_UNIQUE


Add missing OSABI handling for MIPS/LD, complementing:

commit f64b2e8d60f277b705c96d4b4e585f5f7c847cc4
Author: Nick Clifton <nickc@redhat.com>
Date:   Mon Apr 11 08:13:22 2011 +0000

Adjust test coverage accordingly.

	bfd/
	PR 10549
	* elfxx-mips.c (_bfd_mips_elf_add_symbol_hook): Handle 
	STB_GNU_UNIQUE.

	ld/
	PR 10549
	* testsuite/ld-unique/unique.exp: Also run for `mips*-*-*'.
---

 No failures across unique.exp with the BFD change in place.  I have 
committed this change now.

  Maciej

binutils-mips-bfd-stb-gnu-unique.diff
Index: binutils/bfd/elfxx-mips.c
===================================================================
--- binutils.orig/bfd/elfxx-mips.c	2016-04-30 01:24:32.357523230 +0100
+++ binutils/bfd/elfxx-mips.c	2016-04-30 01:32:56.627218284 +0100
@@ -7526,6 +7526,11 @@ _bfd_mips_elf_add_symbol_hook (bfd *abfd
       mips_elf_hash_table (info)->rld_symbol = h;
     }
 
+  if (ELF_ST_BIND (sym->st_info) == STB_GNU_UNIQUE
+      && (abfd->flags & DYNAMIC) == 0
+      && bfd_get_flavour (info->output_bfd) == bfd_target_elf_flavour)
+    elf_tdata (info->output_bfd)->has_gnu_symbols |= elf_gnu_symbol_unique;
+
   /* If this is a mips16 text symbol, add 1 to the value to make it
      odd.  This will cause something like .word SYM to come up with
      the right value when it is loaded into the PC.  */
Index: binutils/ld/testsuite/ld-unique/unique.exp
===================================================================
--- binutils.orig/ld/testsuite/ld-unique/unique.exp	2016-04-30 01:24:32.294511848 +0100
+++ binutils/ld/testsuite/ld-unique/unique.exp	2016-04-30 01:33:04.756828654 +0100
@@ -25,10 +25,11 @@
 
 
 # STB_GNU_UNIQUE support has only been implemented for the ix86, x86_64,
-# arm, powerpc, and sparc so far.
+# arm, mips, powerpc, and sparc so far.
 if {!(([istarget "i?86-*-*"]
        || [istarget "x86_64-*-*"]
        || [istarget "arm*-*-*"]
+       || [istarget "mips*-*-*"]
        || [istarget "powerpc*-*-*"]
        || [istarget "sparc*-*-*"])
       && ([istarget "*-*-elf*"]


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]