0013-x86-Properly-merge-GNU_PROPERTY_X86_ISA_1_USED.patch 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588
  1. From d55c3e36094f06bb1fb02f5eac19fdccf1d91f7e Mon Sep 17 00:00:00 2001
  2. From: "H.J. Lu" <hjl.tools@gmail.com>
  3. Date: Wed, 8 Aug 2018 06:09:15 -0700
  4. Subject: [PATCH] x86: Properly merge GNU_PROPERTY_X86_ISA_1_USED
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=utf8
  7. Content-Transfer-Encoding: 8bit
  8. Without the GNU_PROPERTY_X86_ISA_1_USED property, all ISAs may be used.
  9. If a bit in the GNU_PROPERTY_X86_ISA_1_USED property is unset, the
  10. corresponding x86 instruction set isn’t used. When merging properties
  11. from 2 input files and one input file doesn't have the
  12. GNU_PROPERTY_X86_ISA_1_USED property, the output file shouldn't have
  13. it neither. This patch removes the GNU_PROPERTY_X86_ISA_1_USED
  14. property if an input file doesn't have it.
  15. This patch replaces the GNU_PROPERTY_X86_ISA_1_USED property with the
  16. GNU_PROPERTY_X86_ISA_1_NEEDED property which is the minimum ISA
  17. requirement.
  18. bfd/
  19. PR ld/23486
  20. * elfxx-x86.c (_bfd_x86_elf_merge_gnu_properties): Remove
  21. GNU_PROPERTY_X86_ISA_1_USED if an input file doesn't have it.
  22. (_bfd_x86_elf_link_setup_gnu_properties): Adding the
  23. GNU_PROPERTY_X86_ISA_1_NEEDED, instead of
  24. GNU_PROPERTY_X86_ISA_1_USED, property.
  25. ld/
  26. PR ld/23486
  27. * testsuite/ld-i386/i386.exp: Run PR ld/23486 tests.
  28. * testsuite/ld-x86-64/x86-64.exp: Likewise.
  29. * testsuite/ld-i386/pr23486a.d: New file.
  30. * testsuite/ld-i386/pr23486b.d: Likewise.
  31. * testsuite/ld-x86-64/pr23486a-x32.d: Likewise.
  32. * testsuite/ld-x86-64/pr23486a.d: Likewise.
  33. * testsuite/ld-x86-64/pr23486a.s: Likewise.
  34. * testsuite/ld-x86-64/pr23486b-x32.d: Likewise.
  35. * testsuite/ld-x86-64/pr23486b.d: Likewise.
  36. * testsuite/ld-x86-64/pr23486b.s: Likewise.
  37. * testsuite/ld-i386/property-3.r: Remove "x86 ISA used".
  38. * testsuite/ld-i386/property-4.r: Likewise.
  39. * testsuite/ld-i386/property-5.r: Likewise.
  40. * testsuite/ld-i386/property-x86-ibt3a.d: Likewise.
  41. * testsuite/ld-i386/property-x86-ibt3b.d: Likewise.
  42. * testsuite/ld-i386/property-x86-shstk3a.d: Likewise.
  43. * testsuite/ld-i386/property-x86-shstk3b.d: Likewise.
  44. * testsuite/ld-x86-64/property-3.r: Likewise.
  45. * testsuite/ld-x86-64/property-4.r: Likewise.
  46. * testsuite/ld-x86-64/property-5.r: Likewise.
  47. * testsuite/ld-x86-64/property-x86-ibt3a-x32.d: Likewise.
  48. * testsuite/ld-x86-64/property-x86-ibt3a.d: Likewise.
  49. * testsuite/ld-x86-64/property-x86-ibt3b-x32.d: Likewise.
  50. * testsuite/ld-x86-64/property-x86-ibt3b.d: Likewise.
  51. * testsuite/ld-x86-64/property-x86-shstk3a-x32.d: Likewise.
  52. * testsuite/ld-x86-64/property-x86-shstk3a.d: Likewise.
  53. * testsuite/ld-x86-64/property-x86-shstk3b-x32.d: Likewise.
  54. * testsuite/ld-x86-64/property-x86-shstk3b.d: Likewise.
  55. (cherry picked from commit f7309df20c4e787041cedc4a6aced89c15259e54)
  56. Signed-off-by: Norbert Lange <nolange79@gmail.com>
  57. ---
  58. bfd/ChangeLog | 9 +++++++
  59. bfd/elfxx-x86.c | 25 ++++++++++++++----
  60. ld/ChangeLog | 32 +++++++++++++++++++++++
  61. ld/testsuite/ld-i386/i386.exp | 2 ++
  62. ld/testsuite/ld-i386/pr23486a.d | 10 +++++++
  63. ld/testsuite/ld-i386/pr23486b.d | 10 +++++++
  64. ld/testsuite/ld-i386/property-3.r | 1 -
  65. ld/testsuite/ld-i386/property-4.r | 1 -
  66. ld/testsuite/ld-i386/property-5.r | 1 -
  67. ld/testsuite/ld-i386/property-x86-ibt3a.d | 5 ++--
  68. ld/testsuite/ld-i386/property-x86-ibt3b.d | 5 ++--
  69. ld/testsuite/ld-i386/property-x86-shstk3a.d | 5 ++--
  70. ld/testsuite/ld-i386/property-x86-shstk3b.d | 5 ++--
  71. ld/testsuite/ld-x86-64/pr23486a-x32.d | 10 +++++++
  72. ld/testsuite/ld-x86-64/pr23486a.d | 10 +++++++
  73. ld/testsuite/ld-x86-64/pr23486a.s | 30 +++++++++++++++++++++
  74. ld/testsuite/ld-x86-64/pr23486b-x32.d | 10 +++++++
  75. ld/testsuite/ld-x86-64/pr23486b.d | 10 +++++++
  76. ld/testsuite/ld-x86-64/pr23486b.s | 30 +++++++++++++++++++++
  77. ld/testsuite/ld-x86-64/property-3.r | 1 -
  78. ld/testsuite/ld-x86-64/property-4.r | 1 -
  79. ld/testsuite/ld-x86-64/property-5.r | 1 -
  80. ld/testsuite/ld-x86-64/property-x86-ibt3a-x32.d | 5 ++--
  81. ld/testsuite/ld-x86-64/property-x86-ibt3a.d | 5 ++--
  82. ld/testsuite/ld-x86-64/property-x86-ibt3b-x32.d | 5 ++--
  83. ld/testsuite/ld-x86-64/property-x86-ibt3b.d | 5 ++--
  84. ld/testsuite/ld-x86-64/property-x86-shstk3a-x32.d | 5 ++--
  85. ld/testsuite/ld-x86-64/property-x86-shstk3a.d | 5 ++--
  86. ld/testsuite/ld-x86-64/property-x86-shstk3b-x32.d | 5 ++--
  87. ld/testsuite/ld-x86-64/property-x86-shstk3b.d | 5 ++--
  88. ld/testsuite/ld-x86-64/x86-64.exp | 4 +++
  89. 31 files changed, 211 insertions(+), 47 deletions(-)
  90. create mode 100644 ld/testsuite/ld-i386/pr23486a.d
  91. create mode 100644 ld/testsuite/ld-i386/pr23486b.d
  92. create mode 100644 ld/testsuite/ld-x86-64/pr23486a-x32.d
  93. create mode 100644 ld/testsuite/ld-x86-64/pr23486a.d
  94. create mode 100644 ld/testsuite/ld-x86-64/pr23486a.s
  95. create mode 100644 ld/testsuite/ld-x86-64/pr23486b-x32.d
  96. create mode 100644 ld/testsuite/ld-x86-64/pr23486b.d
  97. create mode 100644 ld/testsuite/ld-x86-64/pr23486b.s
  98. diff --git a/bfd/elfxx-x86.c b/bfd/elfxx-x86.c
  99. index 2e4ff88..7ccfd25 100644
  100. --- a/bfd/elfxx-x86.c
  101. +++ b/bfd/elfxx-x86.c
  102. @@ -2407,12 +2407,27 @@ _bfd_x86_elf_merge_gnu_properties (struct bfd_link_info *info,
  103. switch (pr_type)
  104. {
  105. case GNU_PROPERTY_X86_ISA_1_USED:
  106. + if (aprop == NULL || bprop == NULL)
  107. + {
  108. + /* Only one of APROP and BPROP can be NULL. */
  109. + if (aprop != NULL)
  110. + {
  111. + /* Remove this property since the other input file doesn't
  112. + have it. */
  113. + aprop->pr_kind = property_remove;
  114. + updated = TRUE;
  115. + }
  116. + break;
  117. + }
  118. + goto or_property;
  119. +
  120. case GNU_PROPERTY_X86_ISA_1_NEEDED:
  121. if (aprop != NULL && bprop != NULL)
  122. {
  123. +or_property:
  124. number = aprop->u.number;
  125. aprop->u.number = number | bprop->u.number;
  126. - /* Remove the property if ISA bits are empty. */
  127. + /* Remove the property if all bits are empty. */
  128. if (aprop->u.number == 0)
  129. {
  130. aprop->pr_kind = property_remove;
  131. @@ -2428,14 +2443,14 @@ _bfd_x86_elf_merge_gnu_properties (struct bfd_link_info *info,
  132. {
  133. if (aprop->u.number == 0)
  134. {
  135. - /* Remove APROP if ISA bits are empty. */
  136. + /* Remove APROP if all bits are empty. */
  137. aprop->pr_kind = property_remove;
  138. updated = TRUE;
  139. }
  140. }
  141. else
  142. {
  143. - /* Return TRUE if APROP is NULL and ISA bits of BPROP
  144. + /* Return TRUE if APROP is NULL and all bits of BPROP
  145. aren't empty to indicate that BPROP should be added
  146. to ABFD. */
  147. updated = bprop->u.number != 0;
  148. @@ -2582,9 +2597,9 @@ _bfd_x86_elf_link_setup_gnu_properties
  149. {
  150. /* If the separate code program header is needed, make sure
  151. that the first read-only PT_LOAD segment has no code by
  152. - adding a GNU_PROPERTY_X86_ISA_1_USED note. */
  153. + adding a GNU_PROPERTY_X86_ISA_1_NEEDED note. */
  154. prop = _bfd_elf_get_property (ebfd,
  155. - GNU_PROPERTY_X86_ISA_1_USED,
  156. + GNU_PROPERTY_X86_ISA_1_NEEDED,
  157. 4);
  158. prop->u.number = GNU_PROPERTY_X86_ISA_1_486;
  159. prop->pr_kind = property_number;
  160. diff --git a/ld/testsuite/ld-i386/i386.exp b/ld/testsuite/ld-i386/i386.exp
  161. index 6d794fe..78dad02 100644
  162. --- a/ld/testsuite/ld-i386/i386.exp
  163. +++ b/ld/testsuite/ld-i386/i386.exp
  164. @@ -462,6 +462,8 @@ run_dump_test "pr23189"
  165. run_dump_test "pr23194"
  166. run_dump_test "pr23372a"
  167. run_dump_test "pr23372b"
  168. +run_dump_test "pr23486a"
  169. +run_dump_test "pr23486b"
  170. if { !([istarget "i?86-*-linux*"]
  171. || [istarget "i?86-*-gnu*"]
  172. diff --git a/ld/testsuite/ld-i386/pr23486a.d b/ld/testsuite/ld-i386/pr23486a.d
  173. new file mode 100644
  174. index 0000000..41a6dcf
  175. --- /dev/null
  176. +++ b/ld/testsuite/ld-i386/pr23486a.d
  177. @@ -0,0 +1,10 @@
  178. +#source: ../ld-x86-64/pr23486a.s
  179. +#source: ../ld-x86-64/pr23486b.s
  180. +#as: --32
  181. +#ld: -r -m elf_i386
  182. +#readelf: -n
  183. +
  184. +Displaying notes found in: .note.gnu.property
  185. + Owner Data size Description
  186. + GNU 0x0000000c NT_GNU_PROPERTY_TYPE_0
  187. + Properties: x86 ISA needed: i486, 586
  188. diff --git a/ld/testsuite/ld-i386/pr23486b.d b/ld/testsuite/ld-i386/pr23486b.d
  189. new file mode 100644
  190. index 0000000..08019b7
  191. --- /dev/null
  192. +++ b/ld/testsuite/ld-i386/pr23486b.d
  193. @@ -0,0 +1,10 @@
  194. +#source: ../ld-x86-64/pr23486b.s
  195. +#source: ../ld-x86-64/pr23486a.s
  196. +#as: --32
  197. +#ld: -r -m elf_i386
  198. +#readelf: -n
  199. +
  200. +Displaying notes found in: .note.gnu.property
  201. + Owner Data size Description
  202. + GNU 0x0000000c NT_GNU_PROPERTY_TYPE_0
  203. + Properties: x86 ISA needed: i486, 586
  204. diff --git a/ld/testsuite/ld-i386/property-3.r b/ld/testsuite/ld-i386/property-3.r
  205. index 0ed91f5..d03203c 100644
  206. --- a/ld/testsuite/ld-i386/property-3.r
  207. +++ b/ld/testsuite/ld-i386/property-3.r
  208. @@ -3,6 +3,5 @@ Displaying notes found in: .note.gnu.property
  209. Owner Data size Description
  210. GNU 0x[0-9a-f]+ NT_GNU_PROPERTY_TYPE_0
  211. Properties: stack size: 0x800000
  212. - x86 ISA used: 586, SSE
  213. x86 ISA needed: i486, 586
  214. #pass
  215. diff --git a/ld/testsuite/ld-i386/property-4.r b/ld/testsuite/ld-i386/property-4.r
  216. index cb2bc15..da295eb 100644
  217. --- a/ld/testsuite/ld-i386/property-4.r
  218. +++ b/ld/testsuite/ld-i386/property-4.r
  219. @@ -3,6 +3,5 @@ Displaying notes found in: .note.gnu.property
  220. Owner Data size Description
  221. GNU 0x[0-9a-f]+ NT_GNU_PROPERTY_TYPE_0
  222. Properties: stack size: 0x800000
  223. - x86 ISA used: i486, 586, SSE
  224. x86 ISA needed: i486, 586, SSE
  225. #pass
  226. diff --git a/ld/testsuite/ld-i386/property-5.r b/ld/testsuite/ld-i386/property-5.r
  227. index 5529650..e414159 100644
  228. --- a/ld/testsuite/ld-i386/property-5.r
  229. +++ b/ld/testsuite/ld-i386/property-5.r
  230. @@ -3,6 +3,5 @@ Displaying notes found in: .note.gnu.property
  231. Owner Data size Description
  232. GNU 0x[0-9a-f]+ NT_GNU_PROPERTY_TYPE_0
  233. Properties: stack size: 0x900000
  234. - x86 ISA used: i486, 586, SSE
  235. x86 ISA needed: i486, 586, SSE
  236. #pass
  237. diff --git a/ld/testsuite/ld-i386/property-x86-ibt3a.d b/ld/testsuite/ld-i386/property-x86-ibt3a.d
  238. index 4bb35b0..0aedea1 100644
  239. --- a/ld/testsuite/ld-i386/property-x86-ibt3a.d
  240. +++ b/ld/testsuite/ld-i386/property-x86-ibt3a.d
  241. @@ -6,6 +6,5 @@
  242. Displaying notes found in: .note.gnu.property
  243. Owner Data size Description
  244. - GNU 0x00000018 NT_GNU_PROPERTY_TYPE_0
  245. - Properties: x86 ISA used: i486, 586, SSE2, SSE3
  246. - x86 ISA needed: 586, SSE, SSE3, SSE4_1
  247. + GNU 0x0000000c NT_GNU_PROPERTY_TYPE_0
  248. + Properties: x86 ISA needed: 586, SSE, SSE3, SSE4_1
  249. diff --git a/ld/testsuite/ld-i386/property-x86-ibt3b.d b/ld/testsuite/ld-i386/property-x86-ibt3b.d
  250. index 418d58a..bd69ac6 100644
  251. --- a/ld/testsuite/ld-i386/property-x86-ibt3b.d
  252. +++ b/ld/testsuite/ld-i386/property-x86-ibt3b.d
  253. @@ -6,6 +6,5 @@
  254. Displaying notes found in: .note.gnu.property
  255. Owner Data size Description
  256. - GNU 0x00000018 NT_GNU_PROPERTY_TYPE_0
  257. - Properties: x86 ISA used: i486, 586, SSE2, SSE3
  258. - x86 ISA needed: 586, SSE, SSE3, SSE4_1
  259. + GNU 0x0000000c NT_GNU_PROPERTY_TYPE_0
  260. + Properties: x86 ISA needed: 586, SSE, SSE3, SSE4_1
  261. diff --git a/ld/testsuite/ld-i386/property-x86-shstk3a.d b/ld/testsuite/ld-i386/property-x86-shstk3a.d
  262. index e261038..76d2a39 100644
  263. --- a/ld/testsuite/ld-i386/property-x86-shstk3a.d
  264. +++ b/ld/testsuite/ld-i386/property-x86-shstk3a.d
  265. @@ -6,6 +6,5 @@
  266. Displaying notes found in: .note.gnu.property
  267. Owner Data size Description
  268. - GNU 0x00000018 NT_GNU_PROPERTY_TYPE_0
  269. - Properties: x86 ISA used: i486, 586, SSE2, SSE3
  270. - x86 ISA needed: 586, SSE, SSE3, SSE4_1
  271. + GNU 0x0000000c NT_GNU_PROPERTY_TYPE_0
  272. + Properties: x86 ISA needed: 586, SSE, SSE3, SSE4_1
  273. diff --git a/ld/testsuite/ld-i386/property-x86-shstk3b.d b/ld/testsuite/ld-i386/property-x86-shstk3b.d
  274. index 25f3d23..e770ecf 100644
  275. --- a/ld/testsuite/ld-i386/property-x86-shstk3b.d
  276. +++ b/ld/testsuite/ld-i386/property-x86-shstk3b.d
  277. @@ -6,6 +6,5 @@
  278. Displaying notes found in: .note.gnu.property
  279. Owner Data size Description
  280. - GNU 0x00000018 NT_GNU_PROPERTY_TYPE_0
  281. - Properties: x86 ISA used: i486, 586, SSE2, SSE3
  282. - x86 ISA needed: 586, SSE, SSE3, SSE4_1
  283. + GNU 0x0000000c NT_GNU_PROPERTY_TYPE_0
  284. + Properties: x86 ISA needed: 586, SSE, SSE3, SSE4_1
  285. diff --git a/ld/testsuite/ld-x86-64/pr23486a-x32.d b/ld/testsuite/ld-x86-64/pr23486a-x32.d
  286. new file mode 100644
  287. index 0000000..6d9fa68
  288. --- /dev/null
  289. +++ b/ld/testsuite/ld-x86-64/pr23486a-x32.d
  290. @@ -0,0 +1,10 @@
  291. +#source: pr23486a.s
  292. +#source: pr23486b.s
  293. +#as: --x32
  294. +#ld: -r -m elf32_x86_64
  295. +#readelf: -n
  296. +
  297. +Displaying notes found in: .note.gnu.property
  298. + Owner Data size Description
  299. + GNU 0x0000000c NT_GNU_PROPERTY_TYPE_0
  300. + Properties: x86 ISA needed: i486, 586
  301. diff --git a/ld/testsuite/ld-x86-64/pr23486a.d b/ld/testsuite/ld-x86-64/pr23486a.d
  302. new file mode 100644
  303. index 0000000..dc2b7bf
  304. --- /dev/null
  305. +++ b/ld/testsuite/ld-x86-64/pr23486a.d
  306. @@ -0,0 +1,10 @@
  307. +#source: pr23486a.s
  308. +#source: pr23486b.s
  309. +#as: --64 -defsym __64_bit__=1
  310. +#ld: -r -m elf_x86_64
  311. +#readelf: -n
  312. +
  313. +Displaying notes found in: .note.gnu.property
  314. + Owner Data size Description
  315. + GNU 0x00000010 NT_GNU_PROPERTY_TYPE_0
  316. + Properties: x86 ISA needed: i486, 586
  317. diff --git a/ld/testsuite/ld-x86-64/pr23486a.s b/ld/testsuite/ld-x86-64/pr23486a.s
  318. new file mode 100644
  319. index 0000000..a07d0c7
  320. --- /dev/null
  321. +++ b/ld/testsuite/ld-x86-64/pr23486a.s
  322. @@ -0,0 +1,30 @@
  323. + .section ".note.gnu.property", "a"
  324. +.ifdef __64_bit__
  325. + .p2align 3
  326. +.else
  327. + .p2align 2
  328. +.endif
  329. + .long 1f - 0f /* name length. */
  330. + .long 4f - 1f /* data length. */
  331. + /* NT_GNU_PROPERTY_TYPE_0 */
  332. + .long 5 /* note type. */
  333. +0:
  334. + .asciz "GNU" /* vendor name. */
  335. +1:
  336. +.ifdef __64_bit__
  337. + .p2align 3
  338. +.else
  339. + .p2align 2
  340. +.endif
  341. + /* GNU_PROPERTY_X86_ISA_1_USED */
  342. + .long 0xc0000000 /* pr_type. */
  343. + .long 3f - 2f /* pr_datasz. */
  344. +2:
  345. + .long 0xa
  346. +3:
  347. +.ifdef __64_bit__
  348. + .p2align 3
  349. +.else
  350. + .p2align 2
  351. +.endif
  352. +4:
  353. diff --git a/ld/testsuite/ld-x86-64/pr23486b-x32.d b/ld/testsuite/ld-x86-64/pr23486b-x32.d
  354. new file mode 100644
  355. index 0000000..0445e69
  356. --- /dev/null
  357. +++ b/ld/testsuite/ld-x86-64/pr23486b-x32.d
  358. @@ -0,0 +1,10 @@
  359. +#source: pr23486b.s
  360. +#source: pr23486a.s
  361. +#as: --x32
  362. +#ld: -r -m elf32_x86_64
  363. +#readelf: -n
  364. +
  365. +Displaying notes found in: .note.gnu.property
  366. + Owner Data size Description
  367. + GNU 0x0000000c NT_GNU_PROPERTY_TYPE_0
  368. + Properties: x86 ISA needed: i486, 586
  369. diff --git a/ld/testsuite/ld-x86-64/pr23486b.d b/ld/testsuite/ld-x86-64/pr23486b.d
  370. new file mode 100644
  371. index 0000000..dc2b7bf
  372. --- /dev/null
  373. +++ b/ld/testsuite/ld-x86-64/pr23486b.d
  374. @@ -0,0 +1,10 @@
  375. +#source: pr23486a.s
  376. +#source: pr23486b.s
  377. +#as: --64 -defsym __64_bit__=1
  378. +#ld: -r -m elf_x86_64
  379. +#readelf: -n
  380. +
  381. +Displaying notes found in: .note.gnu.property
  382. + Owner Data size Description
  383. + GNU 0x00000010 NT_GNU_PROPERTY_TYPE_0
  384. + Properties: x86 ISA needed: i486, 586
  385. diff --git a/ld/testsuite/ld-x86-64/pr23486b.s b/ld/testsuite/ld-x86-64/pr23486b.s
  386. new file mode 100644
  387. index 0000000..c5167ee
  388. --- /dev/null
  389. +++ b/ld/testsuite/ld-x86-64/pr23486b.s
  390. @@ -0,0 +1,30 @@
  391. + .section ".note.gnu.property", "a"
  392. +.ifdef __64_bit__
  393. + .p2align 3
  394. +.else
  395. + .p2align 2
  396. +.endif
  397. + .long 1f - 0f /* name length. */
  398. + .long 4f - 1f /* data length. */
  399. + /* NT_GNU_PROPERTY_TYPE_0 */
  400. + .long 5 /* note type. */
  401. +0:
  402. + .asciz "GNU" /* vendor name. */
  403. +1:
  404. +.ifdef __64_bit__
  405. + .p2align 3
  406. +.else
  407. + .p2align 2
  408. +.endif
  409. + /* GNU_PROPERTY_X86_ISA_1_NEEDED */
  410. + .long 0xc0000001 /* pr_type. */
  411. + .long 3f - 2f /* pr_datasz. */
  412. +2:
  413. + .long 0x3
  414. +3:
  415. +.ifdef __64_bit__
  416. + .p2align 3
  417. +.else
  418. + .p2align 2
  419. +.endif
  420. +4:
  421. diff --git a/ld/testsuite/ld-x86-64/property-3.r b/ld/testsuite/ld-x86-64/property-3.r
  422. index 0ed91f5..d03203c 100644
  423. --- a/ld/testsuite/ld-x86-64/property-3.r
  424. +++ b/ld/testsuite/ld-x86-64/property-3.r
  425. @@ -3,6 +3,5 @@ Displaying notes found in: .note.gnu.property
  426. Owner Data size Description
  427. GNU 0x[0-9a-f]+ NT_GNU_PROPERTY_TYPE_0
  428. Properties: stack size: 0x800000
  429. - x86 ISA used: 586, SSE
  430. x86 ISA needed: i486, 586
  431. #pass
  432. diff --git a/ld/testsuite/ld-x86-64/property-4.r b/ld/testsuite/ld-x86-64/property-4.r
  433. index cb2bc15..da295eb 100644
  434. --- a/ld/testsuite/ld-x86-64/property-4.r
  435. +++ b/ld/testsuite/ld-x86-64/property-4.r
  436. @@ -3,6 +3,5 @@ Displaying notes found in: .note.gnu.property
  437. Owner Data size Description
  438. GNU 0x[0-9a-f]+ NT_GNU_PROPERTY_TYPE_0
  439. Properties: stack size: 0x800000
  440. - x86 ISA used: i486, 586, SSE
  441. x86 ISA needed: i486, 586, SSE
  442. #pass
  443. diff --git a/ld/testsuite/ld-x86-64/property-5.r b/ld/testsuite/ld-x86-64/property-5.r
  444. index 5529650..e414159 100644
  445. --- a/ld/testsuite/ld-x86-64/property-5.r
  446. +++ b/ld/testsuite/ld-x86-64/property-5.r
  447. @@ -3,6 +3,5 @@ Displaying notes found in: .note.gnu.property
  448. Owner Data size Description
  449. GNU 0x[0-9a-f]+ NT_GNU_PROPERTY_TYPE_0
  450. Properties: stack size: 0x900000
  451. - x86 ISA used: i486, 586, SSE
  452. x86 ISA needed: i486, 586, SSE
  453. #pass
  454. diff --git a/ld/testsuite/ld-x86-64/property-x86-ibt3a-x32.d b/ld/testsuite/ld-x86-64/property-x86-ibt3a-x32.d
  455. index 011426f..4cec728 100644
  456. --- a/ld/testsuite/ld-x86-64/property-x86-ibt3a-x32.d
  457. +++ b/ld/testsuite/ld-x86-64/property-x86-ibt3a-x32.d
  458. @@ -6,6 +6,5 @@
  459. Displaying notes found in: .note.gnu.property
  460. Owner Data size Description
  461. - GNU 0x00000018 NT_GNU_PROPERTY_TYPE_0
  462. - Properties: x86 ISA used: 586, SSE, SSE3, SSE4_1
  463. - x86 ISA needed: i486, 586, SSE2, SSE3
  464. + GNU 0x0000000c NT_GNU_PROPERTY_TYPE_0
  465. + Properties: x86 ISA needed: i486, 586, SSE2, SSE3
  466. diff --git a/ld/testsuite/ld-x86-64/property-x86-ibt3a.d b/ld/testsuite/ld-x86-64/property-x86-ibt3a.d
  467. index 1b4229a..a8df49a 100644
  468. --- a/ld/testsuite/ld-x86-64/property-x86-ibt3a.d
  469. +++ b/ld/testsuite/ld-x86-64/property-x86-ibt3a.d
  470. @@ -6,6 +6,5 @@
  471. Displaying notes found in: .note.gnu.property
  472. Owner Data size Description
  473. - GNU 0x00000020 NT_GNU_PROPERTY_TYPE_0
  474. - Properties: x86 ISA used: 586, SSE, SSE3, SSE4_1
  475. - x86 ISA needed: i486, 586, SSE2, SSE3
  476. + GNU 0x00000010 NT_GNU_PROPERTY_TYPE_0
  477. + Properties: x86 ISA needed: i486, 586, SSE2, SSE3
  478. diff --git a/ld/testsuite/ld-x86-64/property-x86-ibt3b-x32.d b/ld/testsuite/ld-x86-64/property-x86-ibt3b-x32.d
  479. index 290ed6a..c112626 100644
  480. --- a/ld/testsuite/ld-x86-64/property-x86-ibt3b-x32.d
  481. +++ b/ld/testsuite/ld-x86-64/property-x86-ibt3b-x32.d
  482. @@ -6,6 +6,5 @@
  483. Displaying notes found in: .note.gnu.property
  484. Owner Data size Description
  485. - GNU 0x00000018 NT_GNU_PROPERTY_TYPE_0
  486. - Properties: x86 ISA used: 586, SSE, SSE3, SSE4_1
  487. - x86 ISA needed: i486, 586, SSE2, SSE3
  488. + GNU 0x0000000c NT_GNU_PROPERTY_TYPE_0
  489. + Properties: x86 ISA needed: i486, 586, SSE2, SSE3
  490. diff --git a/ld/testsuite/ld-x86-64/property-x86-ibt3b.d b/ld/testsuite/ld-x86-64/property-x86-ibt3b.d
  491. index 1142e03..f10dffd 100644
  492. --- a/ld/testsuite/ld-x86-64/property-x86-ibt3b.d
  493. +++ b/ld/testsuite/ld-x86-64/property-x86-ibt3b.d
  494. @@ -6,6 +6,5 @@
  495. Displaying notes found in: .note.gnu.property
  496. Owner Data size Description
  497. - GNU 0x00000020 NT_GNU_PROPERTY_TYPE_0
  498. - Properties: x86 ISA used: 586, SSE, SSE3, SSE4_1
  499. - x86 ISA needed: i486, 586, SSE2, SSE3
  500. + GNU 0x00000010 NT_GNU_PROPERTY_TYPE_0
  501. + Properties: x86 ISA needed: i486, 586, SSE2, SSE3
  502. diff --git a/ld/testsuite/ld-x86-64/property-x86-shstk3a-x32.d b/ld/testsuite/ld-x86-64/property-x86-shstk3a-x32.d
  503. index 819542d..0147a3c 100644
  504. --- a/ld/testsuite/ld-x86-64/property-x86-shstk3a-x32.d
  505. +++ b/ld/testsuite/ld-x86-64/property-x86-shstk3a-x32.d
  506. @@ -6,6 +6,5 @@
  507. Displaying notes found in: .note.gnu.property
  508. Owner Data size Description
  509. - GNU 0x00000018 NT_GNU_PROPERTY_TYPE_0
  510. - Properties: x86 ISA used: 586, SSE, SSE3, SSE4_1
  511. - x86 ISA needed: i486, 586, SSE2, SSE3
  512. + GNU 0x0000000c NT_GNU_PROPERTY_TYPE_0
  513. + Properties: x86 ISA needed: i486, 586, SSE2, SSE3
  514. diff --git a/ld/testsuite/ld-x86-64/property-x86-shstk3a.d b/ld/testsuite/ld-x86-64/property-x86-shstk3a.d
  515. index 4c5d0e0..1f8c2dc 100644
  516. --- a/ld/testsuite/ld-x86-64/property-x86-shstk3a.d
  517. +++ b/ld/testsuite/ld-x86-64/property-x86-shstk3a.d
  518. @@ -6,6 +6,5 @@
  519. Displaying notes found in: .note.gnu.property
  520. Owner Data size Description
  521. - GNU 0x00000020 NT_GNU_PROPERTY_TYPE_0
  522. - Properties: x86 ISA used: 586, SSE, SSE3, SSE4_1
  523. - x86 ISA needed: i486, 586, SSE2, SSE3
  524. + GNU 0x00000010 NT_GNU_PROPERTY_TYPE_0
  525. + Properties: x86 ISA needed: i486, 586, SSE2, SSE3
  526. diff --git a/ld/testsuite/ld-x86-64/property-x86-shstk3b-x32.d b/ld/testsuite/ld-x86-64/property-x86-shstk3b-x32.d
  527. index ba181e0..7ca2539 100644
  528. --- a/ld/testsuite/ld-x86-64/property-x86-shstk3b-x32.d
  529. +++ b/ld/testsuite/ld-x86-64/property-x86-shstk3b-x32.d
  530. @@ -6,6 +6,5 @@
  531. Displaying notes found in: .note.gnu.property
  532. Owner Data size Description
  533. - GNU 0x00000018 NT_GNU_PROPERTY_TYPE_0
  534. - Properties: x86 ISA used: 586, SSE, SSE3, SSE4_1
  535. - x86 ISA needed: i486, 586, SSE2, SSE3
  536. + GNU 0x0000000c NT_GNU_PROPERTY_TYPE_0
  537. + Properties: x86 ISA needed: i486, 586, SSE2, SSE3
  538. diff --git a/ld/testsuite/ld-x86-64/property-x86-shstk3b.d b/ld/testsuite/ld-x86-64/property-x86-shstk3b.d
  539. index 5216f38..f66a40e 100644
  540. --- a/ld/testsuite/ld-x86-64/property-x86-shstk3b.d
  541. +++ b/ld/testsuite/ld-x86-64/property-x86-shstk3b.d
  542. @@ -6,6 +6,5 @@
  543. Displaying notes found in: .note.gnu.property
  544. Owner Data size Description
  545. - GNU 0x00000020 NT_GNU_PROPERTY_TYPE_0
  546. - Properties: x86 ISA used: 586, SSE, SSE3, SSE4_1
  547. - x86 ISA needed: i486, 586, SSE2, SSE3
  548. + GNU 0x00000010 NT_GNU_PROPERTY_TYPE_0
  549. + Properties: x86 ISA needed: i486, 586, SSE2, SSE3
  550. diff --git a/ld/testsuite/ld-x86-64/x86-64.exp b/ld/testsuite/ld-x86-64/x86-64.exp
  551. index 6edb9e8..ae21e55 100644
  552. --- a/ld/testsuite/ld-x86-64/x86-64.exp
  553. +++ b/ld/testsuite/ld-x86-64/x86-64.exp
  554. @@ -403,6 +403,10 @@ run_dump_test "pr23372a"
  555. run_dump_test "pr23372a-x32"
  556. run_dump_test "pr23372b"
  557. run_dump_test "pr23372b-x32"
  558. +run_dump_test "pr23486a"
  559. +run_dump_test "pr23486a-x32"
  560. +run_dump_test "pr23486b"
  561. +run_dump_test "pr23486b-x32"
  562. if { ![istarget "x86_64-*-linux*"] && ![istarget "x86_64-*-nacl*"]} {
  563. return
  564. --
  565. 2.9.3