]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[ARC] Make sure global symbol is not an indirect or warning.
authorCupertino Miranda <cmiranda@synopsys.com>
Fri, 2 Mar 2018 16:38:14 +0000 (17:38 +0100)
committerClaudiu Zissulescu <claziss@gmail.com>
Thu, 15 Nov 2018 15:27:38 +0000 (17:27 +0200)
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.

bfd/ChangeLog
bfd/elf32-arc.c

index 318bf9412c1054a81c6b516348ace87d911f1018..c01914fe274b04c29092b2788ea6f60cb071f85f 100644 (file)
@@ -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.
 
index 1d0b6b8abec350eb9710c0bfa0f5ba67e478c560..8c1434a8cdcccac49a199f9554d861881f894dcc 100644 (file)
@@ -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)