[PATCH v5 0/3] elf: Add GNU_PROPERTY_MEMORY_SEAL gnu property

Alan Modra amodra@gmail.com
Wed Jan 15 05:18:32 GMT 2025


On Wed, Jan 15, 2025 at 03:30:55PM +1030, Alan Modra wrote:
> On Wed, Jan 15, 2025 at 12:09:57PM +0800, Nelson Chu wrote:
> > >From risc-v side, I see the "-z memory-seal ignored" for property-seal-7/8
> > if building elf32/64 target and cause failed, but linux32/64 passed.  Maybe
> > the property-seal-7/8 also needs #xfail: ![check_shared_lib_support] ?
> > 
> > Nelson
> 
> I'll be adding
> #notarget: ![check_memory_seal_support]
> to those tests and making a bunch of other fixes too.

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 --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.
 
 #...

-- 
Alan Modra


More information about the Binutils mailing list