summaryrefslogtreecommitdiff
path: root/extra/binutils/0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch
blob: 6e1fa7731c9ef274620b6a057c298fed764635cd (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
46
47
48
49
50
51
52
53
54
55
From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <ariadne@dereferenced.org>
Date: Tue, 21 Sep 2021 14:53:13 +0000
Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared
 libraries"

This revert is needed to avoid wrongly tagging objects with the incompatible
IBM long double ABI, which is not supported by musl and will result in
linking errors if used.

This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba.
---
 bfd/elf32-tic6x.c |  3 ---
 ld/ldlang.c       | 10 ++++------
 2 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c
index 5754f3cb860..3ad1d612749 100644
--- a/bfd/elf32-tic6x.c
+++ b/bfd/elf32-tic6x.c
@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
 
 	case Tag_ABI_PIC:
 	case Tag_ABI_PID:
-	  /* Don't transfer these tags from dynamic objects.  */
-	  if ((ibfd->flags & DYNAMIC) != 0)
-	    continue;
 	  if (out_attr[i].i > in_attr[i].i)
 	    out_attr[i].i = in_attr[i].i;
 	  break;
diff --git a/ld/ldlang.c b/ld/ldlang.c
index 37b64c89ee1..f13beaef9d9 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -7071,13 +7071,11 @@ lang_check (void)
 		   bfd_printable_name (input_bfd), input_bfd,
 		   bfd_printable_name (link_info.output_bfd));
 	}
-
-      /* If the input bfd has no contents, it shouldn't set the
-	 private data of the output bfd.  */
-      else if (!file->flags.just_syms
-	       && ((input_bfd->flags & DYNAMIC) != 0
-		   || bfd_count_sections (input_bfd) != 0))
+      else if (bfd_count_sections (input_bfd))
 	{
+	  /* If the input bfd has no contents, it shouldn't set the
+	     private data of the output bfd.  */
+
 	  bfd_error_handler_type pfn = NULL;
 
 	  /* If we aren't supposed to warn about mismatched input
-- 
2.33.0