[binutils-gdb] Re: elf: Add GNU_PROPERTY_MEMORY_SEAL gnu property

Alan Modra amodra@sourceware.org
Wed Jan 15 05:19:36 GMT 2025


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=f40e5f0224597f5a148203691d4bdb51393e1b37

commit f40e5f0224597f5a148203691d4bdb51393e1b37
Author: Alan Modra <amodra@gmail.com>
Date:   Wed Jan 15 14:27:11 2025 +1030

    Re: elf: Add GNU_PROPERTY_MEMORY_SEAL gnu property
    
    Don't run tests on targets without required support.  Supply an
    explicit -z nomemory-seal rather then relying on the harness default,
    to lessen confusion for people looking at the test.  Don't use numeric
    labels for the sake of hppa64*-hpux, and run the tests there.  Remove
    incorrect comment about source editing.  Also, xfail rather than
    notarget failing tests with a list of target triples so we check that
    the list is correct.

Diff:
---
 ld/testsuite/ld-elf/property-seal-1.d |  9 ++++-----
 ld/testsuite/ld-elf/property-seal-1.s | 12 ++++++------
 ld/testsuite/ld-elf/property-seal-2.d |  9 ++++-----
 ld/testsuite/ld-elf/property-seal-3.d |  8 ++++----
 ld/testsuite/ld-elf/property-seal-4.d |  8 ++++----
 ld/testsuite/ld-elf/property-seal-5.d |  6 +-----
 ld/testsuite/ld-elf/property-seal-6.d |  7 +++----
 ld/testsuite/ld-elf/property-seal-7.d |  5 +----
 ld/testsuite/ld-elf/property-seal-8.d |  6 +++---
 9 files changed, 30 insertions(+), 40 deletions(-)

diff --git a/ld/testsuite/ld-elf/property-seal-1.d b/ld/testsuite/ld-elf/property-seal-1.d
index a0b1feedf31..486025a1fb1 100644
--- a/ld/testsuite/ld-elf/property-seal-1.d
+++ b/ld/testsuite/ld-elf/property-seal-1.d
@@ -2,12 +2,11 @@
 # ET_DYN.
 #source: property-seal-1.s
 #as: --generate-missing-build-notes=no
-#ld: -shared
+#ld: -shared -z nomemory-seal
 #readelf: -n
-#xfail: ![check_shared_lib_support]
-#notarget: am33_2.0-*-* hppa*-*-hpux* mn10300-*-*
-# Assembly source file for the HPPA assembler is renamed and modifed by
-# sed.  mn10300 has relocations in .note.gnu.property section which
+#notarget: ![check_shared_lib_support] ![check_memory_seal_support]
+#xfail: am33_2.0-*-* mn10300-*-*
+# mn10300 has relocations in .note.gnu.property section which
 # elf_parse_notes doesn't support.
 
 #failif
diff --git a/ld/testsuite/ld-elf/property-seal-1.s b/ld/testsuite/ld-elf/property-seal-1.s
index aa28a3d0516..d04a70c9c1c 100644
--- a/ld/testsuite/ld-elf/property-seal-1.s
+++ b/ld/testsuite/ld-elf/property-seal-1.s
@@ -1,11 +1,11 @@
 	.section ".note.gnu.property", "a"
 	.p2align ALIGN
-	.long 1f - 0f		/* name length */
-	.long 3f - 2f		/* data length */
+	.long .L1 - .L0		/* name length */
+	.long .L3 - .L2		/* data length */
 	.long 5			/* note type */
-0:	.asciz "GNU"		/* vendor name */
-1:
+.L0:	.asciz "GNU"		/* vendor name */
+.L1:
 	.p2align ALIGN
-2:	.long 3			/* pr_type.  */
+.L2:	.long 3			/* pr_type.  */
 	.long 0			/* pr_datasz.  */
-3:
+.L3:
diff --git a/ld/testsuite/ld-elf/property-seal-2.d b/ld/testsuite/ld-elf/property-seal-2.d
index ebdaa623e0c..dadb9e50bea 100644
--- a/ld/testsuite/ld-elf/property-seal-2.d
+++ b/ld/testsuite/ld-elf/property-seal-2.d
@@ -3,12 +3,11 @@
 #source: empty.s
 #source: property-seal-1.s
 #as: --generate-missing-build-notes=no
-#ld: -shared
+#ld: -shared -z nomemory-seal
 #readelf: -n
-#xfail: ![check_shared_lib_support]
-#notarget: am33_2.0-*-* hppa*-*-hpux* mn10300-*-*
-# Assembly source file for the HPPA assembler is renamed and modifed by
-# sed.  mn10300 has relocations in .note.gnu.property section which
+#notarget: ![check_shared_lib_support] ![check_memory_seal_support]
+#xfail: am33_2.0-*-* mn10300-*-*
+# mn10300 has relocations in .note.gnu.property section which
 # elf_parse_notes doesn't support.
 
 #failif
diff --git a/ld/testsuite/ld-elf/property-seal-3.d b/ld/testsuite/ld-elf/property-seal-3.d
index 969729ee0f4..38a41a05b59 100644
--- a/ld/testsuite/ld-elf/property-seal-3.d
+++ b/ld/testsuite/ld-elf/property-seal-3.d
@@ -2,12 +2,12 @@
 # ET_EXEC.
 #source: property-seal-1.s
 #as: --generate-missing-build-notes=no
-#ld: -e _start
+#ld: -e _start -z nomemory-seal
 #warning: .*: warning: cannot find entry symbol .*
 #readelf: -n
-#notarget: am33_2.0-*-* hppa*-*-hpux* mn10300-*-*
-# Assembly source file for the HPPA assembler is renamed and modifed by
-# sed.  mn10300 has relocations in .note.gnu.property section which
+#notarget: ![check_memory_seal_support]
+#xfail: am33_2.0-*-* mn10300-*-*
+# mn10300 has relocations in .note.gnu.property section which
 # elf_parse_notes doesn't support.
 
 #failif
diff --git a/ld/testsuite/ld-elf/property-seal-4.d b/ld/testsuite/ld-elf/property-seal-4.d
index 3dd990dd68a..ee1aeb96d55 100644
--- a/ld/testsuite/ld-elf/property-seal-4.d
+++ b/ld/testsuite/ld-elf/property-seal-4.d
@@ -3,11 +3,11 @@
 #source: empty.s
 #source: property-seal-1.s
 #as: --generate-missing-build-notes=no
-#ld: -e _start
+#ld: -e _start -z nomemory-seal
 #readelf: -n
-#notarget: am33_2.0-*-* hppa*-*-hpux* mn10300-*-*
-# Assembly source file for the HPPA assembler is renamed and modifed by
-# sed.  mn10300 has relocations in .note.gnu.property section which
+#notarget: ![check_memory_seal_support]
+#xfail: am33_2.0-*-* mn10300-*-*
+# mn10300 has relocations in .note.gnu.property section which
 # elf_parse_notes doesn't support.
 
 #failif
diff --git a/ld/testsuite/ld-elf/property-seal-5.d b/ld/testsuite/ld-elf/property-seal-5.d
index 0b92a8eb6eb..4d983890676 100644
--- a/ld/testsuite/ld-elf/property-seal-5.d
+++ b/ld/testsuite/ld-elf/property-seal-5.d
@@ -1,11 +1,7 @@
 #source: empty.s
 #ld: -shared -z memory-seal
 #readelf: -n
-#xfail: ![check_shared_lib_support]
-#notarget: am33_2.0-*-* hppa*-*-hpux* mn10300-*-*
-# Assembly source file for the HPPA assembler is renamed and modifed by
-# sed.  mn10300 has relocations in .note.gnu.property section which
-# elf_parse_notes doesn't support.
+#notarget: ![check_shared_lib_support] ![check_memory_seal_support]
 
 #...
 Displaying notes found in: .note.gnu.property
diff --git a/ld/testsuite/ld-elf/property-seal-6.d b/ld/testsuite/ld-elf/property-seal-6.d
index 725911acae7..124355443b1 100644
--- a/ld/testsuite/ld-elf/property-seal-6.d
+++ b/ld/testsuite/ld-elf/property-seal-6.d
@@ -2,10 +2,9 @@
 #source: property-seal-1.s
 #ld: -shared -z memory-seal
 #readelf: -n
-#xfail: ![check_shared_lib_support]
-#notarget: am33_2.0-*-* hppa*-*-hpux* mn10300-*-*
-# Assembly source file for the HPPA assembler is renamed and modifed by
-# sed.  mn10300 has relocations in .note.gnu.property section which
+#notarget: ![check_shared_lib_support] ![check_memory_seal_support]
+#xfail: am33_2.0-*-* mn10300-*-*
+# mn10300 has relocations in .note.gnu.property section which
 # elf_parse_notes doesn't support.
 
 #...
diff --git a/ld/testsuite/ld-elf/property-seal-7.d b/ld/testsuite/ld-elf/property-seal-7.d
index 12339e83ebd..75ff151bca7 100644
--- a/ld/testsuite/ld-elf/property-seal-7.d
+++ b/ld/testsuite/ld-elf/property-seal-7.d
@@ -1,10 +1,7 @@
 #source: empty.s
 #ld: -z memory-seal
 #readelf: -n
-#notarget: am33_2.0-*-* hppa*-*-hpux* mn10300-*-*
-# Assembly source file for the HPPA assembler is renamed and modifed by
-# sed.  mn10300 has relocations in .note.gnu.property section which
-# elf_parse_notes doesn't support.
+#notarget: ![check_memory_seal_support]
 
 #...
 Displaying notes found in: .note.gnu.property
diff --git a/ld/testsuite/ld-elf/property-seal-8.d b/ld/testsuite/ld-elf/property-seal-8.d
index 0c4c4e4907e..62c776b2b8e 100644
--- a/ld/testsuite/ld-elf/property-seal-8.d
+++ b/ld/testsuite/ld-elf/property-seal-8.d
@@ -2,9 +2,9 @@
 #source: property-seal-1.s
 #ld: -z memory-seal
 #readelf: -n
-#notarget: am33_2.0-*-* hppa*-*-hpux* mn10300-*-*
-# Assembly source file for the HPPA assembler is renamed and modifed by
-# sed.  mn10300 has relocations in .note.gnu.property section which
+#notarget: ![check_memory_seal_support]
+#xfail: am33_2.0-*-* mn10300-*-*
+# mn10300 has relocations in .note.gnu.property section which
 # elf_parse_notes doesn't support.
 
 #...


More information about the Binutils-cvs mailing list