summaryrefslogtreecommitdiff
blob: 8e0e091e6cebd71148ad5e4b17270ad84e1d175d (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
43
44
45
From 74afb38257f4a35d681883348ef54317674827e3 Mon Sep 17 00:00:00 2001
From: Sergei Trofimovich <slyfox@gentoo.org>
Date: Thu, 1 Mar 2018 12:35:03 +0100
Subject: [PATCH 8/9] Gentoo: Restore TEXTREL warnings for non-shared objects

---
 bfd/elflink.c                | 4 ++--
 ld/testsuite/ld-i386/warn1.d | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/bfd/elflink.c b/bfd/elflink.c
index 90ada7a1cc..b4636885aa 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -12934,7 +12934,7 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info)
 	goto error_return;
 
       /* Check for DT_TEXTREL (late, in case the backend removes it).  */
-      if (((info->warn_shared_textrel && bfd_link_pic (info))
+      if ((info->warn_shared_textrel
 	   || info->error_textrel)
 	  && (o = bfd_get_linker_section (dynobj, ".dynamic")) != NULL)
 	{
@@ -12955,7 +12955,7 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info)
 		      (_("%P%X: read-only segment has dynamic relocations\n"));
 		  else
 		    info->callbacks->einfo
-		      (_("%P: warning: creating a DT_TEXTREL in a shared object\n"));
+		      (_("%P: warning: creating a DT_TEXTREL in object\n"));
 		  break;
 		}
 	    }
diff --git a/ld/testsuite/ld-i386/warn1.d b/ld/testsuite/ld-i386/warn1.d
index 3c78f31efd..49bcb5171f 100644
--- a/ld/testsuite/ld-i386/warn1.d
+++ b/ld/testsuite/ld-i386/warn1.d
@@ -1,4 +1,4 @@
 #name: --warn-shared-textrel --fatal-warnings
 #as: --32
 #ld: -shared -melf_i386 --warn-shared-textrel --fatal-warnings
-#error: .*warning: creating a DT_TEXTREL in a shared object
+#error: .*warning: creating a DT_TEXTREL in object
-- 
2.26.2