summaryrefslogtreecommitdiffstats
path: root/package/binutils/2.31.1/0013-x86-Properly-merge-GNU_PROPERTY_X86_ISA_1_USED.patch
blob: a4c48985d9a21011db0d72b26e40ddb217d5d8d9 (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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
From d55c3e36094f06bb1fb02f5eac19fdccf1d91f7e Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Wed, 8 Aug 2018 06:09:15 -0700
Subject: [PATCH] x86: Properly merge GNU_PROPERTY_X86_ISA_1_USED
MIME-Version: 1.0
Content-Type: text/plain; charset=utf8
Content-Transfer-Encoding: 8bit

Without the GNU_PROPERTY_X86_ISA_1_USED property, all ISAs may be used.
If a bit in the GNU_PROPERTY_X86_ISA_1_USED property is unset, the
corresponding x86 instruction set isn’t used.  When merging properties
from 2 input files and one input file doesn't have the
GNU_PROPERTY_X86_ISA_1_USED property, the output file shouldn't have
it neither.  This patch removes the GNU_PROPERTY_X86_ISA_1_USED
property if an input file doesn't have it.

This patch replaces the GNU_PROPERTY_X86_ISA_1_USED property with the
GNU_PROPERTY_X86_ISA_1_NEEDED property which is the minimum ISA
requirement.

bfd/

	PR ld/23486
	* elfxx-x86.c (_bfd_x86_elf_merge_gnu_properties): Remove
	GNU_PROPERTY_X86_ISA_1_USED if an input file doesn't have it.
	(_bfd_x86_elf_link_setup_gnu_properties): Adding the
	GNU_PROPERTY_X86_ISA_1_NEEDED, instead of
	GNU_PROPERTY_X86_ISA_1_USED, property.

ld/

	PR ld/23486
	* testsuite/ld-i386/i386.exp: Run PR ld/23486 tests.
	* testsuite/ld-x86-64/x86-64.exp: Likewise.
	* testsuite/ld-i386/pr23486a.d: New file.
	* testsuite/ld-i386/pr23486b.d: Likewise.
	* testsuite/ld-x86-64/pr23486a-x32.d: Likewise.
	* testsuite/ld-x86-64/pr23486a.d: Likewise.
	* testsuite/ld-x86-64/pr23486a.s: Likewise.
	* testsuite/ld-x86-64/pr23486b-x32.d: Likewise.
	* testsuite/ld-x86-64/pr23486b.d: Likewise.
	* testsuite/ld-x86-64/pr23486b.s: Likewise.
	* testsuite/ld-i386/property-3.r: Remove "x86 ISA used".
	* testsuite/ld-i386/property-4.r: Likewise.
	* testsuite/ld-i386/property-5.r: Likewise.
	* testsuite/ld-i386/property-x86-ibt3a.d: Likewise.
	* testsuite/ld-i386/property-x86-ibt3b.d: Likewise.
	* testsuite/ld-i386/property-x86-shstk3a.d: Likewise.
	* testsuite/ld-i386/property-x86-shstk3b.d: Likewise.
	* testsuite/ld-x86-64/property-3.r: Likewise.
	* testsuite/ld-x86-64/property-4.r: Likewise.
	* testsuite/ld-x86-64/property-5.r: Likewise.
	* testsuite/ld-x86-64/property-x86-ibt3a-x32.d: Likewise.
	* testsuite/ld-x86-64/property-x86-ibt3a.d: Likewise.
	* testsuite/ld-x86-64/property-x86-ibt3b-x32.d: Likewise.
	* testsuite/ld-x86-64/property-x86-ibt3b.d: Likewise.
	* testsuite/ld-x86-64/property-x86-shstk3a-x32.d: Likewise.
	* testsuite/ld-x86-64/property-x86-shstk3a.d: Likewise.
	* testsuite/ld-x86-64/property-x86-shstk3b-x32.d: Likewise.
	* testsuite/ld-x86-64/property-x86-shstk3b.d: Likewise.

(cherry picked from commit f7309df20c4e787041cedc4a6aced89c15259e54)
Signed-off-by: Norbert Lange <nolange79@gmail.com>
---
 bfd/ChangeLog                                     |  9 +++++++
 bfd/elfxx-x86.c                                   | 25 ++++++++++++++----
 ld/ChangeLog                                      | 32 +++++++++++++++++++++++
 ld/testsuite/ld-i386/i386.exp                     |  2 ++
 ld/testsuite/ld-i386/pr23486a.d                   | 10 +++++++
 ld/testsuite/ld-i386/pr23486b.d                   | 10 +++++++
 ld/testsuite/ld-i386/property-3.r                 |  1 -
 ld/testsuite/ld-i386/property-4.r                 |  1 -
 ld/testsuite/ld-i386/property-5.r                 |  1 -
 ld/testsuite/ld-i386/property-x86-ibt3a.d         |  5 ++--
 ld/testsuite/ld-i386/property-x86-ibt3b.d         |  5 ++--
 ld/testsuite/ld-i386/property-x86-shstk3a.d       |  5 ++--
 ld/testsuite/ld-i386/property-x86-shstk3b.d       |  5 ++--
 ld/testsuite/ld-x86-64/pr23486a-x32.d             | 10 +++++++
 ld/testsuite/ld-x86-64/pr23486a.d                 | 10 +++++++
 ld/testsuite/ld-x86-64/pr23486a.s                 | 30 +++++++++++++++++++++
 ld/testsuite/ld-x86-64/pr23486b-x32.d             | 10 +++++++
 ld/testsuite/ld-x86-64/pr23486b.d                 | 10 +++++++
 ld/testsuite/ld-x86-64/pr23486b.s                 | 30 +++++++++++++++++++++
 ld/testsuite/ld-x86-64/property-3.r               |  1 -
 ld/testsuite/ld-x86-64/property-4.r               |  1 -
 ld/testsuite/ld-x86-64/property-5.r               |  1 -
 ld/testsuite/ld-x86-64/property-x86-ibt3a-x32.d   |  5 ++--
 ld/testsuite/ld-x86-64/property-x86-ibt3a.d       |  5 ++--
 ld/testsuite/ld-x86-64/property-x86-ibt3b-x32.d   |  5 ++--
 ld/testsuite/ld-x86-64/property-x86-ibt3b.d       |  5 ++--
 ld/testsuite/ld-x86-64/property-x86-shstk3a-x32.d |  5 ++--
 ld/testsuite/ld-x86-64/property-x86-shstk3a.d     |  5 ++--
 ld/testsuite/ld-x86-64/property-x86-shstk3b-x32.d |  5 ++--
 ld/testsuite/ld-x86-64/property-x86-shstk3b.d     |  5 ++--
 ld/testsuite/ld-x86-64/x86-64.exp                 |  4 +++
 31 files changed, 211 insertions(+), 47 deletions(-)
 create mode 100644 ld/testsuite/ld-i386/pr23486a.d
 create mode 100644 ld/testsuite/ld-i386/pr23486b.d
 create mode 100644 ld/testsuite/ld-x86-64/pr23486a-x32.d
 create mode 100644 ld/testsuite/ld-x86-64/pr23486a.d
 create mode 100644 ld/testsuite/ld-x86-64/pr23486a.s
 create mode 100644 ld/testsuite/ld-x86-64/pr23486b-x32.d
 create mode 100644 ld/testsuite/ld-x86-64/pr23486b.d
 create mode 100644 ld/testsuite/ld-x86-64/pr23486b.s

diff --git a/bfd/elfxx-x86.c b/bfd/elfxx-x86.c
index 2e4ff88..7ccfd25 100644
--- a/bfd/elfxx-x86.c
+++ b/bfd/elfxx-x86.c
@@ -2407,12 +2407,27 @@ _bfd_x86_elf_merge_gnu_properties (struct bfd_link_info *info,
   switch (pr_type)
     {
     case GNU_PROPERTY_X86_ISA_1_USED:
+      if (aprop == NULL || bprop == NULL)
+	{
+	  /* Only one of APROP and BPROP can be NULL.  */
+	  if (aprop != NULL)
+	    {
+	      /* Remove this property since the other input file doesn't
+		 have it.  */
+	      aprop->pr_kind = property_remove;
+	      updated = TRUE;
+	    }
+	  break;
+	}
+      goto or_property;
+
     case GNU_PROPERTY_X86_ISA_1_NEEDED:
       if (aprop != NULL && bprop != NULL)
 	{
+or_property:
 	  number = aprop->u.number;
 	  aprop->u.number = number | bprop->u.number;
-	  /* Remove the property if ISA bits are empty.  */
+	  /* Remove the property if all bits are empty.  */
 	  if (aprop->u.number == 0)
 	    {
 	      aprop->pr_kind = property_remove;
@@ -2428,14 +2443,14 @@ _bfd_x86_elf_merge_gnu_properties (struct bfd_link_info *info,
 	    {
 	      if (aprop->u.number == 0)
 		{
-		  /* Remove APROP if ISA bits are empty.  */
+		  /* Remove APROP if all bits are empty.  */
 		  aprop->pr_kind = property_remove;
 		  updated = TRUE;
 		}
 	    }
 	  else
 	    {
-	      /* Return TRUE if APROP is NULL and ISA bits of BPROP
+	      /* Return TRUE if APROP is NULL and all bits of BPROP
 		 aren't empty to indicate that BPROP should be added
 		 to ABFD.  */
 	      updated = bprop->u.number != 0;
@@ -2582,9 +2597,9 @@ _bfd_x86_elf_link_setup_gnu_properties
 	{
 	  /* If the separate code program header is needed, make sure
 	     that the first read-only PT_LOAD segment has no code by
-	     adding a GNU_PROPERTY_X86_ISA_1_USED note.  */
+	     adding a GNU_PROPERTY_X86_ISA_1_NEEDED note.  */
 	  prop = _bfd_elf_get_property (ebfd,
-					GNU_PROPERTY_X86_ISA_1_USED,
+					GNU_PROPERTY_X86_ISA_1_NEEDED,
 					4);
 	  prop->u.number = GNU_PROPERTY_X86_ISA_1_486;
 	  prop->pr_kind = property_number;
diff --git a/ld/testsuite/ld-i386/i386.exp b/ld/testsuite/ld-i386/i386.exp
index 6d794fe..78dad02 100644
--- a/ld/testsuite/ld-i386/i386.exp
+++ b/ld/testsuite/ld-i386/i386.exp
@@ -462,6 +462,8 @@ run_dump_test "pr23189"
 run_dump_test "pr23194"
 run_dump_test "pr23372a"
 run_dump_test "pr23372b"
+run_dump_test "pr23486a"
+run_dump_test "pr23486b"

 if { !([istarget "i?86-*-linux*"]
        || [istarget "i?86-*-gnu*"]
diff --git a/ld/testsuite/ld-i386/pr23486a.d b/ld/testsuite/ld-i386/pr23486a.d
new file mode 100644
index 0000000..41a6dcf
--- /dev/null
+++ b/ld/testsuite/ld-i386/pr23486a.d
@@ -0,0 +1,10 @@
+#source: ../ld-x86-64/pr23486a.s
+#source: ../ld-x86-64/pr23486b.s
+#as: --32
+#ld: -r -m elf_i386
+#readelf: -n
+
+Displaying notes found in: .note.gnu.property
+  Owner                 Data size	Description
+  GNU                  0x0000000c	NT_GNU_PROPERTY_TYPE_0
+      Properties: x86 ISA needed: i486, 586
diff --git a/ld/testsuite/ld-i386/pr23486b.d b/ld/testsuite/ld-i386/pr23486b.d
new file mode 100644
index 0000000..08019b7
--- /dev/null
+++ b/ld/testsuite/ld-i386/pr23486b.d
@@ -0,0 +1,10 @@
+#source: ../ld-x86-64/pr23486b.s
+#source: ../ld-x86-64/pr23486a.s
+#as: --32
+#ld: -r -m elf_i386
+#readelf: -n
+
+Displaying notes found in: .note.gnu.property
+  Owner                 Data size	Description
+  GNU                  0x0000000c	NT_GNU_PROPERTY_TYPE_0
+      Properties: x86 ISA needed: i486, 586
diff --git a/ld/testsuite/ld-i386/property-3.r b/ld/testsuite/ld-i386/property-3.r
index 0ed91f5..d03203c 100644
--- a/ld/testsuite/ld-i386/property-3.r
+++ b/ld/testsuite/ld-i386/property-3.r
@@ -3,6 +3,5 @@ Displaying notes found in: .note.gnu.property
   Owner                 Data size	Description
   GNU                  0x[0-9a-f]+	NT_GNU_PROPERTY_TYPE_0
       Properties: stack size: 0x800000
-	x86 ISA used: 586, SSE
 	x86 ISA needed: i486, 586
 #pass
diff --git a/ld/testsuite/ld-i386/property-4.r b/ld/testsuite/ld-i386/property-4.r
index cb2bc15..da295eb 100644
--- a/ld/testsuite/ld-i386/property-4.r
+++ b/ld/testsuite/ld-i386/property-4.r
@@ -3,6 +3,5 @@ Displaying notes found in: .note.gnu.property
   Owner                 Data size	Description
   GNU                  0x[0-9a-f]+	NT_GNU_PROPERTY_TYPE_0
       Properties: stack size: 0x800000
-	x86 ISA used: i486, 586, SSE
 	x86 ISA needed: i486, 586, SSE
 #pass
diff --git a/ld/testsuite/ld-i386/property-5.r b/ld/testsuite/ld-i386/property-5.r
index 5529650..e414159 100644
--- a/ld/testsuite/ld-i386/property-5.r
+++ b/ld/testsuite/ld-i386/property-5.r
@@ -3,6 +3,5 @@ Displaying notes found in: .note.gnu.property
   Owner                 Data size	Description
   GNU                  0x[0-9a-f]+	NT_GNU_PROPERTY_TYPE_0
       Properties: stack size: 0x900000
-	x86 ISA used: i486, 586, SSE
 	x86 ISA needed: i486, 586, SSE
 #pass
diff --git a/ld/testsuite/ld-i386/property-x86-ibt3a.d b/ld/testsuite/ld-i386/property-x86-ibt3a.d
index 4bb35b0..0aedea1 100644
--- a/ld/testsuite/ld-i386/property-x86-ibt3a.d
+++ b/ld/testsuite/ld-i386/property-x86-ibt3a.d
@@ -6,6 +6,5 @@

 Displaying notes found in: .note.gnu.property
   Owner                 Data size	Description
-  GNU                  0x00000018	NT_GNU_PROPERTY_TYPE_0
-      Properties: x86 ISA used: i486, 586, SSE2, SSE3
-	x86 ISA needed: 586, SSE, SSE3, SSE4_1
+  GNU                  0x0000000c	NT_GNU_PROPERTY_TYPE_0
+      Properties: x86 ISA needed: 586, SSE, SSE3, SSE4_1
diff --git a/ld/testsuite/ld-i386/property-x86-ibt3b.d b/ld/testsuite/ld-i386/property-x86-ibt3b.d
index 418d58a..bd69ac6 100644
--- a/ld/testsuite/ld-i386/property-x86-ibt3b.d
+++ b/ld/testsuite/ld-i386/property-x86-ibt3b.d
@@ -6,6 +6,5 @@

 Displaying notes found in: .note.gnu.property
   Owner                 Data size	Description
-  GNU                  0x00000018	NT_GNU_PROPERTY_TYPE_0
-      Properties: x86 ISA used: i486, 586, SSE2, SSE3
-	x86 ISA needed: 586, SSE, SSE3, SSE4_1
+  GNU                  0x0000000c	NT_GNU_PROPERTY_TYPE_0
+      Properties: x86 ISA needed: 586, SSE, SSE3, SSE4_1
diff --git a/ld/testsuite/ld-i386/property-x86-shstk3a.d b/ld/testsuite/ld-i386/property-x86-shstk3a.d
index e261038..76d2a39 100644
--- a/ld/testsuite/ld-i386/property-x86-shstk3a.d
+++ b/ld/testsuite/ld-i386/property-x86-shstk3a.d
@@ -6,6 +6,5 @@

 Displaying notes found in: .note.gnu.property
   Owner                 Data size	Description
-  GNU                  0x00000018	NT_GNU_PROPERTY_TYPE_0
-      Properties: x86 ISA used: i486, 586, SSE2, SSE3
-	x86 ISA needed: 586, SSE, SSE3, SSE4_1
+  GNU                  0x0000000c	NT_GNU_PROPERTY_TYPE_0
+      Properties: x86 ISA needed: 586, SSE, SSE3, SSE4_1
diff --git a/ld/testsuite/ld-i386/property-x86-shstk3b.d b/ld/testsuite/ld-i386/property-x86-shstk3b.d
index 25f3d23..e770ecf 100644
--- a/ld/testsuite/ld-i386/property-x86-shstk3b.d
+++ b/ld/testsuite/ld-i386/property-x86-shstk3b.d
@@ -6,6 +6,5 @@

 Displaying notes found in: .note.gnu.property
   Owner                 Data size	Description
-  GNU                  0x00000018	NT_GNU_PROPERTY_TYPE_0
-      Properties: x86 ISA used: i486, 586, SSE2, SSE3
-	x86 ISA needed: 586, SSE, SSE3, SSE4_1
+  GNU                  0x0000000c	NT_GNU_PROPERTY_TYPE_0
+      Properties: x86 ISA needed: 586, SSE, SSE3, SSE4_1
diff --git a/ld/testsuite/ld-x86-64/pr23486a-x32.d b/ld/testsuite/ld-x86-64/pr23486a-x32.d
new file mode 100644
index 0000000..6d9fa68
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/pr23486a-x32.d
@@ -0,0 +1,10 @@
+#source: pr23486a.s
+#source: pr23486b.s
+#as: --x32
+#ld: -r -m elf32_x86_64
+#readelf: -n
+
+Displaying notes found in: .note.gnu.property
+  Owner                 Data size	Description
+  GNU                  0x0000000c	NT_GNU_PROPERTY_TYPE_0
+      Properties: x86 ISA needed: i486, 586
diff --git a/ld/testsuite/ld-x86-64/pr23486a.d b/ld/testsuite/ld-x86-64/pr23486a.d
new file mode 100644
index 0000000..dc2b7bf
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/pr23486a.d
@@ -0,0 +1,10 @@
+#source: pr23486a.s
+#source: pr23486b.s
+#as: --64 -defsym __64_bit__=1
+#ld: -r -m elf_x86_64
+#readelf: -n
+
+Displaying notes found in: .note.gnu.property
+  Owner                 Data size	Description
+  GNU                  0x00000010	NT_GNU_PROPERTY_TYPE_0
+      Properties: x86 ISA needed: i486, 586
diff --git a/ld/testsuite/ld-x86-64/pr23486a.s b/ld/testsuite/ld-x86-64/pr23486a.s
new file mode 100644
index 0000000..a07d0c7
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/pr23486a.s
@@ -0,0 +1,30 @@
+	.section ".note.gnu.property", "a"
+.ifdef __64_bit__
+	.p2align 3
+.else
+	.p2align 2
+.endif
+	.long 1f - 0f		/* name length.  */
+	.long 4f - 1f		/* data length.  */
+	/* NT_GNU_PROPERTY_TYPE_0 */
+	.long 5			/* note type.  */
+0:
+	.asciz "GNU"		/* vendor name.  */
+1:
+.ifdef __64_bit__
+	.p2align 3
+.else
+	.p2align 2
+.endif
+	/* GNU_PROPERTY_X86_ISA_1_USED */
+	.long 0xc0000000	/* pr_type.  */
+	.long 3f - 2f		/* pr_datasz.  */
+2:
+	.long 0xa
+3:
+.ifdef __64_bit__
+	.p2align 3
+.else
+	.p2align 2
+.endif
+4:
diff --git a/ld/testsuite/ld-x86-64/pr23486b-x32.d b/ld/testsuite/ld-x86-64/pr23486b-x32.d
new file mode 100644
index 0000000..0445e69
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/pr23486b-x32.d
@@ -0,0 +1,10 @@
+#source: pr23486b.s
+#source: pr23486a.s
+#as: --x32
+#ld: -r -m elf32_x86_64
+#readelf: -n
+
+Displaying notes found in: .note.gnu.property
+  Owner                 Data size	Description
+  GNU                  0x0000000c	NT_GNU_PROPERTY_TYPE_0
+      Properties: x86 ISA needed: i486, 586
diff --git a/ld/testsuite/ld-x86-64/pr23486b.d b/ld/testsuite/ld-x86-64/pr23486b.d
new file mode 100644
index 0000000..dc2b7bf
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/pr23486b.d
@@ -0,0 +1,10 @@
+#source: pr23486a.s
+#source: pr23486b.s
+#as: --64 -defsym __64_bit__=1
+#ld: -r -m elf_x86_64
+#readelf: -n
+
+Displaying notes found in: .note.gnu.property
+  Owner                 Data size	Description
+  GNU                  0x00000010	NT_GNU_PROPERTY_TYPE_0
+      Properties: x86 ISA needed: i486, 586
diff --git a/ld/testsuite/ld-x86-64/pr23486b.s b/ld/testsuite/ld-x86-64/pr23486b.s
new file mode 100644
index 0000000..c5167ee
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/pr23486b.s
@@ -0,0 +1,30 @@
+	.section ".note.gnu.property", "a"
+.ifdef __64_bit__
+	.p2align 3
+.else
+	.p2align 2
+.endif
+	.long 1f - 0f		/* name length.  */
+	.long 4f - 1f		/* data length.  */
+	/* NT_GNU_PROPERTY_TYPE_0 */
+	.long 5			/* note type.  */
+0:
+	.asciz "GNU"		/* vendor name.  */
+1:
+.ifdef __64_bit__
+	.p2align 3
+.else
+	.p2align 2
+.endif
+	/* GNU_PROPERTY_X86_ISA_1_NEEDED */
+	.long 0xc0000001	/* pr_type.  */
+	.long 3f - 2f		/* pr_datasz.  */
+2:
+	.long 0x3
+3:
+.ifdef __64_bit__
+	.p2align 3
+.else
+	.p2align 2
+.endif
+4:
diff --git a/ld/testsuite/ld-x86-64/property-3.r b/ld/testsuite/ld-x86-64/property-3.r
index 0ed91f5..d03203c 100644
--- a/ld/testsuite/ld-x86-64/property-3.r
+++ b/ld/testsuite/ld-x86-64/property-3.r
@@ -3,6 +3,5 @@ Displaying notes found in: .note.gnu.property
   Owner                 Data size	Description
   GNU                  0x[0-9a-f]+	NT_GNU_PROPERTY_TYPE_0
       Properties: stack size: 0x800000
-	x86 ISA used: 586, SSE
 	x86 ISA needed: i486, 586
 #pass
diff --git a/ld/testsuite/ld-x86-64/property-4.r b/ld/testsuite/ld-x86-64/property-4.r
index cb2bc15..da295eb 100644
--- a/ld/testsuite/ld-x86-64/property-4.r
+++ b/ld/testsuite/ld-x86-64/property-4.r
@@ -3,6 +3,5 @@ Displaying notes found in: .note.gnu.property
   Owner                 Data size	Description
   GNU                  0x[0-9a-f]+	NT_GNU_PROPERTY_TYPE_0
       Properties: stack size: 0x800000
-	x86 ISA used: i486, 586, SSE
 	x86 ISA needed: i486, 586, SSE
 #pass
diff --git a/ld/testsuite/ld-x86-64/property-5.r b/ld/testsuite/ld-x86-64/property-5.r
index 5529650..e414159 100644
--- a/ld/testsuite/ld-x86-64/property-5.r
+++ b/ld/testsuite/ld-x86-64/property-5.r
@@ -3,6 +3,5 @@ Displaying notes found in: .note.gnu.property
   Owner                 Data size	Description
   GNU                  0x[0-9a-f]+	NT_GNU_PROPERTY_TYPE_0
       Properties: stack size: 0x900000
-	x86 ISA used: i486, 586, SSE
 	x86 ISA needed: i486, 586, SSE
 #pass
diff --git a/ld/testsuite/ld-x86-64/property-x86-ibt3a-x32.d b/ld/testsuite/ld-x86-64/property-x86-ibt3a-x32.d
index 011426f..4cec728 100644
--- a/ld/testsuite/ld-x86-64/property-x86-ibt3a-x32.d
+++ b/ld/testsuite/ld-x86-64/property-x86-ibt3a-x32.d
@@ -6,6 +6,5 @@

 Displaying notes found in: .note.gnu.property
   Owner                 Data size	Description
-  GNU                  0x00000018	NT_GNU_PROPERTY_TYPE_0
-      Properties: x86 ISA used: 586, SSE, SSE3, SSE4_1
-	x86 ISA needed: i486, 586, SSE2, SSE3
+  GNU                  0x0000000c	NT_GNU_PROPERTY_TYPE_0
+      Properties: x86 ISA needed: i486, 586, SSE2, SSE3
diff --git a/ld/testsuite/ld-x86-64/property-x86-ibt3a.d b/ld/testsuite/ld-x86-64/property-x86-ibt3a.d
index 1b4229a..a8df49a 100644
--- a/ld/testsuite/ld-x86-64/property-x86-ibt3a.d
+++ b/ld/testsuite/ld-x86-64/property-x86-ibt3a.d
@@ -6,6 +6,5 @@

 Displaying notes found in: .note.gnu.property
   Owner                 Data size	Description
-  GNU                  0x00000020	NT_GNU_PROPERTY_TYPE_0
-      Properties: x86 ISA used: 586, SSE, SSE3, SSE4_1
-	x86 ISA needed: i486, 586, SSE2, SSE3
+  GNU                  0x00000010	NT_GNU_PROPERTY_TYPE_0
+      Properties: x86 ISA needed: i486, 586, SSE2, SSE3
diff --git a/ld/testsuite/ld-x86-64/property-x86-ibt3b-x32.d b/ld/testsuite/ld-x86-64/property-x86-ibt3b-x32.d
index 290ed6a..c112626 100644
--- a/ld/testsuite/ld-x86-64/property-x86-ibt3b-x32.d
+++ b/ld/testsuite/ld-x86-64/property-x86-ibt3b-x32.d
@@ -6,6 +6,5 @@

 Displaying notes found in: .note.gnu.property
   Owner                 Data size	Description
-  GNU                  0x00000018	NT_GNU_PROPERTY_TYPE_0
-      Properties: x86 ISA used: 586, SSE, SSE3, SSE4_1
-	x86 ISA needed: i486, 586, SSE2, SSE3
+  GNU                  0x0000000c	NT_GNU_PROPERTY_TYPE_0
+      Properties: x86 ISA needed: i486, 586, SSE2, SSE3
diff --git a/ld/testsuite/ld-x86-64/property-x86-ibt3b.d b/ld/testsuite/ld-x86-64/property-x86-ibt3b.d
index 1142e03..f10dffd 100644
--- a/ld/testsuite/ld-x86-64/property-x86-ibt3b.d
+++ b/ld/testsuite/ld-x86-64/property-x86-ibt3b.d
@@ -6,6 +6,5 @@

 Displaying notes found in: .note.gnu.property
   Owner                 Data size	Description
-  GNU                  0x00000020	NT_GNU_PROPERTY_TYPE_0
-      Properties: x86 ISA used: 586, SSE, SSE3, SSE4_1
-	x86 ISA needed: i486, 586, SSE2, SSE3
+  GNU                  0x00000010	NT_GNU_PROPERTY_TYPE_0
+      Properties: x86 ISA needed: i486, 586, SSE2, SSE3
diff --git a/ld/testsuite/ld-x86-64/property-x86-shstk3a-x32.d b/ld/testsuite/ld-x86-64/property-x86-shstk3a-x32.d
index 819542d..0147a3c 100644
--- a/ld/testsuite/ld-x86-64/property-x86-shstk3a-x32.d
+++ b/ld/testsuite/ld-x86-64/property-x86-shstk3a-x32.d
@@ -6,6 +6,5 @@

 Displaying notes found in: .note.gnu.property
   Owner                 Data size	Description
-  GNU                  0x00000018	NT_GNU_PROPERTY_TYPE_0
-      Properties: x86 ISA used: 586, SSE, SSE3, SSE4_1
-	x86 ISA needed: i486, 586, SSE2, SSE3
+  GNU                  0x0000000c	NT_GNU_PROPERTY_TYPE_0
+      Properties: x86 ISA needed: i486, 586, SSE2, SSE3
diff --git a/ld/testsuite/ld-x86-64/property-x86-shstk3a.d b/ld/testsuite/ld-x86-64/property-x86-shstk3a.d
index 4c5d0e0..1f8c2dc 100644
--- a/ld/testsuite/ld-x86-64/property-x86-shstk3a.d
+++ b/ld/testsuite/ld-x86-64/property-x86-shstk3a.d
@@ -6,6 +6,5 @@

 Displaying notes found in: .note.gnu.property
   Owner                 Data size	Description
-  GNU                  0x00000020	NT_GNU_PROPERTY_TYPE_0
-      Properties: x86 ISA used: 586, SSE, SSE3, SSE4_1
-	x86 ISA needed: i486, 586, SSE2, SSE3
+  GNU                  0x00000010	NT_GNU_PROPERTY_TYPE_0
+      Properties: x86 ISA needed: i486, 586, SSE2, SSE3
diff --git a/ld/testsuite/ld-x86-64/property-x86-shstk3b-x32.d b/ld/testsuite/ld-x86-64/property-x86-shstk3b-x32.d
index ba181e0..7ca2539 100644
--- a/ld/testsuite/ld-x86-64/property-x86-shstk3b-x32.d
+++ b/ld/testsuite/ld-x86-64/property-x86-shstk3b-x32.d
@@ -6,6 +6,5 @@

 Displaying notes found in: .note.gnu.property
   Owner                 Data size	Description
-  GNU                  0x00000018	NT_GNU_PROPERTY_TYPE_0
-      Properties: x86 ISA used: 586, SSE, SSE3, SSE4_1
-	x86 ISA needed: i486, 586, SSE2, SSE3
+  GNU                  0x0000000c	NT_GNU_PROPERTY_TYPE_0
+      Properties: x86 ISA needed: i486, 586, SSE2, SSE3
diff --git a/ld/testsuite/ld-x86-64/property-x86-shstk3b.d b/ld/testsuite/ld-x86-64/property-x86-shstk3b.d
index 5216f38..f66a40e 100644
--- a/ld/testsuite/ld-x86-64/property-x86-shstk3b.d
+++ b/ld/testsuite/ld-x86-64/property-x86-shstk3b.d
@@ -6,6 +6,5 @@

 Displaying notes found in: .note.gnu.property
   Owner                 Data size	Description
-  GNU                  0x00000020	NT_GNU_PROPERTY_TYPE_0
-      Properties: x86 ISA used: 586, SSE, SSE3, SSE4_1
-	x86 ISA needed: i486, 586, SSE2, SSE3
+  GNU                  0x00000010	NT_GNU_PROPERTY_TYPE_0
+      Properties: x86 ISA needed: i486, 586, SSE2, SSE3
diff --git a/ld/testsuite/ld-x86-64/x86-64.exp b/ld/testsuite/ld-x86-64/x86-64.exp
index 6edb9e8..ae21e55 100644
--- a/ld/testsuite/ld-x86-64/x86-64.exp
+++ b/ld/testsuite/ld-x86-64/x86-64.exp
@@ -403,6 +403,10 @@ run_dump_test "pr23372a"
 run_dump_test "pr23372a-x32"
 run_dump_test "pr23372b"
 run_dump_test "pr23372b-x32"
+run_dump_test "pr23486a"
+run_dump_test "pr23486a-x32"
+run_dump_test "pr23486b"
+run_dump_test "pr23486b-x32"

 if { ![istarget "x86_64-*-linux*"] && ![istarget "x86_64-*-nacl*"]} {
     return
--
2.9.3

OpenPOWER on IntegriCloud