This is the mail archive of the binutils-cvs@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]

[binutils-gdb/binutils-2_31-branch] [ARC] Make sure global symbol is not an indirect or warning.


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=3ee995cd6ea600693097c393493b587b3474a7d1

commit 3ee995cd6ea600693097c393493b587b3474a7d1
Author: Cupertino Miranda <cmiranda@synopsys.com>
Date:   Fri Mar 2 17:38:14 2018 +0100

    [ARC] Make sure global symbol is not an indirect or warning.
    
    Problem identified in the context of glibc with latest upstream binutils.
    Dynamic symbol space was being reserved but, no actual information for the
    symbol was being set. Data for the symbol was kept initialized with -1.
    No easy test case was possible to be created.
    
    bfd/
    2018-03-01  Cupertino Miranda <cmiranda@synopsys.com>
    
    	* elf32-arc.c (elf_arc_check_relocs): Changed.

Diff:
---
 bfd/ChangeLog   | 9 ++++++++-
 bfd/elf32-arc.c | 7 ++++++-
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 318bf94..c01914f 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,7 +1,14 @@
 2018-11-15  Claudiu Zissulescu  <claziss@synopsys.com>
 
 	Backport from mainline
-	2018-03-01  Cupertino Miranda <cmiranda@synopsys.com>
+	2018-03-02  Cupertino Miranda <cmiranda@synopsys.com>
+	* elf32-arc.c (elf_arc_check_relocs): Changed.
+
+
+2018-11-15  Claudiu Zissulescu  <claziss@synopsys.com>
+
+	Backport from mainline
+	2018-03-02  Cupertino Miranda <cmiranda@synopsys.com>
 	* elf32-arc.c (elf_arc_finish_dynamic_symbol) Return FALSE in case
 	arc_htab is NULL.
 
diff --git a/bfd/elf32-arc.c b/bfd/elf32-arc.c
index 1d0b6b8..8c1434a 100644
--- a/bfd/elf32-arc.c
+++ b/bfd/elf32-arc.c
@@ -1960,7 +1960,12 @@ elf_arc_check_relocs (bfd *			 abfd,
       if (r_symndx < symtab_hdr->sh_info) /* Is a local symbol.  */
 	h = NULL;
       else /* Global one.  */
-	h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+	{
+	  h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+	  while (h->root.type == bfd_link_hash_indirect
+		 || h->root.type == bfd_link_hash_warning)
+	    h = (struct elf_link_hash_entry *) h->root.u.i.link;
+	}
 
 
       switch (r_type)


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