aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCupertino Miranda <cmiranda@synopsys.com>2018-03-02 17:38:14 +0100
committerAndreas K. Hüttel <dilfridge@gentoo.org>2018-11-30 23:51:30 +0100
commitbdbabb42d61cb1ac38a6c5f1fea5468fbe0a376f (patch)
treeb4f761e7130e04fdaea8de2384468d0e4e32ee89
parent[ARC] Improved robustness. Return FALSE in case of NULL pointer. (diff)
downloadbinutils-gdb-bdbabb42d61cb1ac38a6c5f1fea5468fbe0a376f.tar.gz
binutils-gdb-bdbabb42d61cb1ac38a6c5f1fea5468fbe0a376f.tar.bz2
binutils-gdb-bdbabb42d61cb1ac38a6c5f1fea5468fbe0a376f.zip
[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. (cherry picked from commit 3ee995cd6ea600693097c393493b587b3474a7d1) Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
-rw-r--r--bfd/ChangeLog9
-rw-r--r--bfd/elf32-arc.c7
2 files changed, 14 insertions, 2 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 318bf9412c1..c01914fe274 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 1d0b6b8abec..8c1434a8cdc 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)