From bdbabb42d61cb1ac38a6c5f1fea5468fbe0a376f Mon Sep 17 00:00:00 2001 From: Cupertino Miranda Date: Fri, 2 Mar 2018 17:38:14 +0100 Subject: [ARC] Make sure global symbol is not an indirect or warning. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 * elf32-arc.c (elf_arc_check_relocs): Changed. (cherry picked from commit 3ee995cd6ea600693097c393493b587b3474a7d1) Signed-off-by: Andreas K. Hüttel --- bfd/ChangeLog | 9 ++++++++- bfd/elf32-arc.c | 7 ++++++- 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 Backport from mainline - 2018-03-01 Cupertino Miranda + 2018-03-02 Cupertino Miranda + * elf32-arc.c (elf_arc_check_relocs): Changed. + + +2018-11-15 Claudiu Zissulescu + + Backport from mainline + 2018-03-02 Cupertino Miranda * 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) -- cgit v1.2.3-65-gdbad