Fix SHF_GNU_RETAIN testsuite fallout
authorJozef Lawrynowicz <jozef.l@mittosystems.com>
Fri, 20 Nov 2020 10:31:07 +0000 (10:31 +0000)
committerJozef Lawrynowicz <jozef.l@mittosystems.com>
Fri, 20 Nov 2020 10:33:28 +0000 (10:33 +0000)
binutils/ChangeLog:

* testsuite/binutils-all/readelf-maskos-1a.d: Fix test for unrecognized
bit set in SHF_MASKOS range.
* testsuite/binutils-all/readelf-maskos-1b.d: Likewise.
* testsuite/binutils-all/readelf-maskos-unknown.s: New test.

ld/ChangeLog:

* testsuite/ld-elf/retain3.s: Move symbolic reference into writeable
.data section from read-only .text section.
* testsuite/ld-elf/retain5.d: Don't pass --print-gc-sections for test
that doesn't require it.
* testsuite/ld-elf/retain6a.d: Adjust test.
* testsuite/ld-elf/retain6main.s: Move symbolic reference into writeable
.data section from read-only .text section.

binutils/ChangeLog
binutils/testsuite/binutils-all/readelf-maskos-1a.d
binutils/testsuite/binutils-all/readelf-maskos-1b.d
binutils/testsuite/binutils-all/readelf-maskos-unknown.s [new file with mode: 0644]
ld/ChangeLog
ld/testsuite/ld-elf/retain3.s
ld/testsuite/ld-elf/retain5.d
ld/testsuite/ld-elf/retain6a.d
ld/testsuite/ld-elf/retain6main.s

index e8bcd97e8cae5541ec5584c914e16efd3e910198..4acc0d479a12827fa74877a6e69a20d45d3ca7a2 100644 (file)
@@ -1,3 +1,10 @@
+2020-11-20  Jozef Lawrynowicz  <jozef.l@mittosystems.com>
+
+       * testsuite/binutils-all/readelf-maskos-1a.d: Fix test for unrecognized
+       bit set in SHF_MASKOS range.
+       * testsuite/binutils-all/readelf-maskos-1b.d: Likewise.
+       * testsuite/binutils-all/readelf-maskos-unknown.s: New test.
+
 2020-11-18  Jozef Lawrynowicz  <jozef.l@mittosystems.com>
 
        * NEWS: Announce SHF_GNU_RETAIN support.
index 7b273585996b863d339cf5d45a9012a4afc33cfe..cb18b3b08bd3cfcd08335dc0b64c4a2278b5821f 100644 (file)
@@ -1,10 +1,10 @@
 #name: Unknown SHF_MASKOS value in section
-#source: readelf-maskos.s
-#notarget: [supports_gnu_osabi] msp430-*-elf visium-*-elf
-#xfail: arm-*-elf
+#source: readelf-maskos-unknown.s
+#notarget: mips-*-* hppa-*-* score-*-* msp430-*-elf visium-*-elf
 #readelf: -S --wide
-# PR26722 for the arm-*-elf XFAIL
+# Only run this test for targets that are not ELFOSABI_STANDALONE, and do not
+# set SHF_MASKOS bit 0x8000000.
 
 #...
-  \[[ 0-9]+\] .data.retain_var.*WAo.*
+  \[[ 0-9]+\] .data.var.*WAo.*
 #pass
index 2cbb58a73b1a958d8bdd88f0059c469a2df977e8..5c363f698f933a478fabfb55a778d9cdcccd6450 100644 (file)
@@ -1,12 +1,12 @@
 #name: -t (section details) for unknown SHF_MASKOS value in section
-#source: readelf-maskos.s
-#notarget: [supports_gnu_osabi] msp430-*-elf visium-*-elf
-#xfail: arm-*-elf
+#source: readelf-maskos-unknown.s
+#notarget: mips-*-* hppa-*-* score-*-* msp430-*-elf visium-*-elf
 #readelf: -S -t --wide
-# PR26722 for the arm-*-elf XFAIL
+# Only run this test for targets that are not ELFOSABI_STANDALONE, and do not
+# set SHF_MASKOS bit 0x8000000.
 
 #...
-  \[[ 0-9]+\] .data.retain_var
+  \[[ 0-9]+\] .data.var
        PROGBITS +0+ +[0-9a-f]+ +[0-9a-f]+ +[0-9a-f]+ +0 +0 +(1|2|4|8)
-       \[00200003\]: WRITE, ALLOC, OS \(00200000\)
+       \[0+0800003\]: WRITE, ALLOC, OS \(0+0800000\)
 #pass
diff --git a/binutils/testsuite/binutils-all/readelf-maskos-unknown.s b/binutils/testsuite/binutils-all/readelf-maskos-unknown.s
new file mode 100644 (file)
index 0000000..b36066b
--- /dev/null
@@ -0,0 +1,11 @@
+  .section     .data.var,"0x800003"
+       .global var
+       .type   var, %object
+var:
+       .long   2
+
+       .section        .text._start,"ax"
+       .global _start
+       .type   _start, %function
+_start:
+       .word 0
index e9da9f8c887deb8edec37761117c4dba39595685..c0b47f480b36ec490561b757e236013114a2a1b8 100644 (file)
@@ -1,3 +1,13 @@
+2020-11-20  Jozef Lawrynowicz  <jozef.l@mittosystems.com>
+
+       * testsuite/ld-elf/retain3.s: Move symbolic reference into writeable
+       .data section from read-only .text section.
+       * testsuite/ld-elf/retain5.d: Don't pass --print-gc-sections for test
+       that doesn't require it.
+       * testsuite/ld-elf/retain6a.d: Adjust test.
+       * testsuite/ld-elf/retain6main.s: Move symbolic reference into writeable
+       .data section from read-only .text section.
+
 2020-11-18  Alan Modra  <amodra@gmail.com>
 
        * testsuite/ld-powerpc/group1.d,
index ce315cbaa632f80ded2593d7324791d2c4ac74f7..9e388330ab071e45b26d4f6d0cf2178367508922 100644 (file)
@@ -6,9 +6,9 @@
 foo:
        .word 0
 
-       .section        .text.bar,"axR"
+       .section        .data.bar,"awR"
        .global bar
-       .type   bar, %function
+       .type   bar, %object
 bar:
        .long foo
 
index 86e85f8da5d5f90eee3a6ce7326f6ff437034569..9759531d6577429f40d5812ccc258543fa1c6f68 100644 (file)
@@ -1,6 +1,6 @@
 #name: SHF_GNU_RETAIN 5 (don't pull SHF_GNU_RETAIN section out of lib)
 #source: retain5main.s
-#ld: --gc-sections -e _start --print-gc-sections -Ltmpdir -lretain5 -Map=retain5.map
+#ld: --gc-sections -e _start -Ltmpdir -lretain5 -Map=retain5.map
 #notarget: ![supports_gnu_osabi] ![check_gc_sections_available]
 #map: retain5.map
 #DUMPPROG: nm
index aa93117ae74d59f87a2dba45407eb7cba08acc67..c8a47d58c0aa7da9a373b00d1e4c22aceec662de 100644 (file)
@@ -9,5 +9,5 @@
 #...
 [0-9a-f]+ . retain_from_lib
 #...
-[0-9a-f]+ . retained_fn
+[0-9a-f]+ . retained_var
 #pass
index a66c5b3247ea18125cc4bca19972596b94fa1d2c..a1916dea85691beac7c2b9db018c87d65697d596 100644 (file)
@@ -1,9 +1,9 @@
-/* Undefined symbol reference in retained section .text.retained_fn requires
+/* Undefined symbol reference in retained section .data.retained_var requires
    symbol definition to be pulled out of library.  */
-       .section        .text.retained_fn,"axR"
-       .global retained_fn
-       .type   retained_fn, %function
-retained_fn:
+       .section        .data.retained_var,"awR"
+       .global retained_var
+       .type   retained_var, %object
+retained_var:
        .long bar
 
        .section        .text._start,"ax"