summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/binutils/binutils/0017-Do-not-emit-R_RISCV_NONE-reloc-in-the-extra-unused-r.patch
blob: 99bb38eb67ee49b32d5aa090cac6d60889e1b9b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
From 5b61c40c34c3db699de723c3128ba704501ccdac Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Mon, 20 Apr 2020 14:23:57 -0700
Subject: [PATCH 17/17] Do not emit R_RISCV_NONE reloc in the extra unused
 reloc space.

Redundant R_RISCV_DTPMOD* R_RISCV_DTPREL* results from Global Dynamic -> Local Exec relaxation
which generates

Patch from https://sourceware.org/bugzilla/show_bug.cgi?id=24673

Upstream-Status: Pending

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 bfd/elfnn-riscv.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/bfd/elfnn-riscv.c b/bfd/elfnn-riscv.c
index a5fa415309a..1e582052aa9 100644
--- a/bfd/elfnn-riscv.c
+++ b/bfd/elfnn-riscv.c
@@ -2090,13 +2090,14 @@ riscv_elf_relocate_section (bfd *output_bfd,
 		  pic = bfd_link_pic (info);
 
 		  if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, pic, h)
-		      && (!pic || !SYMBOL_REFERENCES_LOCAL (info, h)))
+		      && (bfd_link_dll (info)
+			  || !SYMBOL_REFERENCES_LOCAL (info, h)))
 		    indx = h->dynindx;
 		}
 
 	      /* The GOT entries have not been initialized yet.  Do it
 		 now, and emit any relocations.  */
-	      if ((bfd_link_pic (info) || indx != 0)
+	      if ((bfd_link_dll (info) || indx != 0)
 		  && (h == NULL
 		      || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
 		      || h->root.type != bfd_link_hash_undefweak))
-- 
2.28.0