This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH 1/6] [ARC] Make sure global symbol is not an indirect or warning.
- From: Claudiu Zissulescu <claziss at gmail dot com>
- To: binutils at sourceware dot org
- Cc: claziss at synopsys dot com, cmiranda at synopsys dot com, vgupta at sysnopsys dot com
- Date: Thu, 15 Nov 2018 17:44:25 +0200
- Subject: [PATCH 1/6] [ARC] Make sure global symbol is not an indirect or warning.
- References: <20181115154430.23071-1-claziss@gmail.com>
From: Cupertino Miranda <cmiranda@synopsys.com>
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 | 9 ++++++++-
bfd/elf32-arc.c | 7 ++++++-
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 318bf9412c..c01914fe27 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 1d0b6b8abe..8c1434a8cd 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)
--
2.19.1