1 From 9d09ce14b4eef2b56f24660fd69a44acd45128b2 Mon Sep 17 00:00:00 2001
2 From: Cupertino Miranda <cmiranda@synopsys.com>
3 Date: Fri, 2 Mar 2018 17:38:14 +0100
4 Subject: [PATCH] Make sure global symbol is not an indirect or warning.
6 Problem identified in the context of glibc with latest upstream binutils.
7 Dynamic symbol space was being reserved but, no actual information for the
8 symbol was being set. Data for the symbol was kept initialized with -1.
9 No easy test case was possible to be created.
12 2018-03-01 Cupertino Miranda <cmiranda@synopsys.com>
14 * elf32-arc.c (elf_arc_check_relocs): Changed.
16 Signed-off-by: Cupertino Miranda <cmiranda@synopsys.com>
17 Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
18 [Romain: rebase on top of 2.31]
19 Signed-off-by: Romain Naour <romain.naour@gmail.com>
21 Upstream-Status: Pending
23 bfd/elf32-arc.c | 7 ++++++-
24 1 file changed, 6 insertions(+), 1 deletion(-)
26 diff --git a/bfd/elf32-arc.c b/bfd/elf32-arc.c
27 index 33fc72cff6e..9b72c5b4f4f 100644
30 @@ -1960,7 +1960,12 @@ elf_arc_check_relocs (bfd * abfd,
31 if (r_symndx < symtab_hdr->sh_info) /* Is a local symbol. */
33 else /* Global one. */
34 - h = sym_hashes[r_symndx - symtab_hdr->sh_info];
36 + h = sym_hashes[r_symndx - symtab_hdr->sh_info];
37 + while (h->root.type == bfd_link_hash_indirect
38 + || h->root.type == bfd_link_hash_warning)
39 + h = (struct elf_link_hash_entry *) h->root.u.i.link;