blob: 01e42c03bb1230f9eaebbfd7db4ebd9aad188541 [file] [log] [blame]
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08001From 9d09ce14b4eef2b56f24660fd69a44acd45128b2 Mon Sep 17 00:00:00 2001
2From: Cupertino Miranda <cmiranda@synopsys.com>
3Date: Fri, 2 Mar 2018 17:38:14 +0100
4Subject: [PATCH] Make sure global symbol is not an indirect or warning.
5
6Problem identified in the context of glibc with latest upstream binutils.
7Dynamic symbol space was being reserved but, no actual information for the
8symbol was being set. Data for the symbol was kept initialized with -1.
9No easy test case was possible to be created.
10
11bfd/
122018-03-01 Cupertino Miranda <cmiranda@synopsys.com>
13
14 * elf32-arc.c (elf_arc_check_relocs): Changed.
15
16Signed-off-by: Cupertino Miranda <cmiranda@synopsys.com>
17Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
18[Romain: rebase on top of 2.31]
19Signed-off-by: Romain Naour <romain.naour@gmail.com>
20
21Upstream-Status: Pending
22---
23 bfd/elf32-arc.c | 7 ++++++-
24 1 file changed, 6 insertions(+), 1 deletion(-)
25
26diff --git a/bfd/elf32-arc.c b/bfd/elf32-arc.c
27index 33fc72cff6e..9b72c5b4f4f 100644
28--- a/bfd/elf32-arc.c
29+++ b/bfd/elf32-arc.c
30@@ -1960,7 +1960,12 @@ elf_arc_check_relocs (bfd * abfd,
31 if (r_symndx < symtab_hdr->sh_info) /* Is a local symbol. */
32 h = NULL;
33 else /* Global one. */
34- h = sym_hashes[r_symndx - symtab_hdr->sh_info];
35+ {
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;
40+ }
41
42
43 switch (r_type)
44--
452.14.4
46