elf: Update GNU_PROPERTY_UINT32_[AND|OR]_XXX tests

Message ID CAMe9rOpr7w6DJdLK00gE61-eNjnRzmGeJUagjGG7r6-3Qc5_fA@mail.gmail.com
State New
Headers show
Series
  • elf: Update GNU_PROPERTY_UINT32_[AND|OR]_XXX tests
Related show

Commit Message

H.J. Lu via Binutils June 19, 2021, 3:27 a.m.
On Fri, Jun 18, 2021 at 6:49 PM Alan Modra <amodra@gmail.com> wrote:
>

> On Fri, Jun 18, 2021 at 02:19:08PM +0000, H.J. Lu via Binutils-cvs wrote:

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

>

> The new tests fail on a number of targets.

>

> am33_2.0-linux  +FAIL: ld-elf/property-and-1

> am33_2.0-linux  +FAIL: ld-elf/property-and-2

> am33_2.0-linux  +FAIL: ld-elf/property-and-3

> am33_2.0-linux  +FAIL: ld-elf/property-and-4

> am33_2.0-linux  +FAIL: ld-elf/property-or-2

> am33_2.0-linux  +FAIL: ld-elf/property-or-3

> am33_2.0-linux  +FAIL: ld-elf/property-or-4

> hppa64-hp-hpux11.23  +FAIL: ld-elf/property-and-1

> hppa64-hp-hpux11.23  +FAIL: ld-elf/property-and-2

> hppa64-hp-hpux11.23  +FAIL: ld-elf/property-and-3

> hppa64-hp-hpux11.23  +FAIL: ld-elf/property-and-4

> hppa64-hp-hpux11.23  +FAIL: ld-elf/property-or-1

> hppa64-hp-hpux11.23  +FAIL: ld-elf/property-or-2

> hppa64-hp-hpux11.23  +FAIL: ld-elf/property-or-3

> hppa64-hp-hpux11.23  +FAIL: ld-elf/property-or-4

> mn10300-elf  +FAIL: ld-elf/property-and-1

> mn10300-elf  +FAIL: ld-elf/property-and-2

> mn10300-elf  +FAIL: ld-elf/property-and-3

> mn10300-elf  +FAIL: ld-elf/property-and-4

> mn10300-elf  +FAIL: ld-elf/property-or-2

> mn10300-elf  +FAIL: ld-elf/property-or-3

> mn10300-elf  +FAIL: ld-elf/property-or-4

> xtensa-elf  +FAIL: ld-elf/property-and-1

> xtensa-elf  +FAIL: ld-elf/property-and-2

> xtensa-elf  +FAIL: ld-elf/property-and-3

> xtensa-elf  +FAIL: ld-elf/property-and-4

> xtensa-elf  +FAIL: ld-elf/property-or-1

> xtensa-elf  +FAIL: ld-elf/property-or-2

> xtensa-elf  +FAIL: ld-elf/property-or-3

> xtensa-elf  +FAIL: ld-elf/property-or-4

>

> --

> Alan Modra

> Australia Development Lab, IBM


Here is the patch to fix these.

BTW, mn10300 and xtensa have relocations in .note.gnu.property
section for some reason.  Luckily xtensa leaves correct values in
.note.gnu.property section.  But mn10300 doesn't.


-- 
H.J.

Comments

H.J. Lu via Binutils June 19, 2021, 4:23 a.m. | #1
On Fri, Jun 18, 2021 at 08:27:00PM -0700, H.J. Lu wrote:
> On Fri, Jun 18, 2021 at 6:49 PM Alan Modra <amodra@gmail.com> wrote:

> >

> > On Fri, Jun 18, 2021 at 02:19:08PM +0000, H.J. Lu via Binutils-cvs wrote:

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

> >

> > The new tests fail on a number of targets.

> >

> Here is the patch to fix these.


Thanks!

-- 
Alan Modra
Australia Development Lab, IBM

Patch

From 8e4dae1533b47e9808b60adc1927fe63246687a6 Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Fri, 18 Jun 2021 19:56:47 -0700
Subject: [PATCH] elf: Update GNU_PROPERTY_UINT32_[AND|OR]_XXX tests

1. Skip am33_2.0-*-* hppa*-*-hpux* mn10300-*-* since assembly source file
for the HPPA assembler is renamed and modifed by sed.  mn10300 has RELA
relocations in .note.gnu.property section which elf_parse_notes doesn't
support.
2. Pass --generate-missing-build-notes=no to assembler.
3. Allow other note sections for xtensa.

	* testsuite/ld-elf/property-and-1.d: Skip am33_2.0, hppa-hpux
	and mn10300.
	Pass --generate-missing-build-notes=no to assembler.  Allow
	other note sections for xtensa.
	* testsuite/ld-elf/property-and-2.d: Likewise.
	* testsuite/ld-elf/property-and-3.d: Likewise.
	* testsuite/ld-elf/property-and-4.d: Likewise.
	* testsuite/ld-elf/property-or-1.d: Likewise.
	* testsuite/ld-elf/property-or-2.d: Likewise.
	* testsuite/ld-elf/property-or-3.d: Likewise.
	* testsuite/ld-elf/property-or-4.d: Likewise.
---
 ld/ChangeLog                         | 14 ++++++++++++++
 ld/testsuite/ld-elf/property-and-1.d | 11 ++++++++++-
 ld/testsuite/ld-elf/property-and-2.d | 11 ++++++++++-
 ld/testsuite/ld-elf/property-and-3.d | 11 ++++++++++-
 ld/testsuite/ld-elf/property-and-4.d |  8 +++++++-
 ld/testsuite/ld-elf/property-or-1.d  |  8 +++++++-
 ld/testsuite/ld-elf/property-or-2.d  |  8 +++++++-
 ld/testsuite/ld-elf/property-or-3.d  |  8 +++++++-
 ld/testsuite/ld-elf/property-or-4.d  |  8 +++++++-
 9 files changed, 79 insertions(+), 8 deletions(-)

diff --git a/ld/ChangeLog b/ld/ChangeLog
index 0395aabde06..c84992d7633 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,17 @@ 
+2021-06-18  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* testsuite/ld-elf/property-and-1.d: Skip am33_2.0, hppa-hpux
+	and mn10300.
+	Pass --generate-missing-build-notes=no to assembler.  Allow
+	other note sections for xtensa.
+	* testsuite/ld-elf/property-and-2.d: Likewise.
+	* testsuite/ld-elf/property-and-3.d: Likewise.
+	* testsuite/ld-elf/property-and-4.d: Likewise.
+	* testsuite/ld-elf/property-or-1.d: Likewise.
+	* testsuite/ld-elf/property-or-2.d: Likewise.
+	* testsuite/ld-elf/property-or-3.d: Likewise.
+	* testsuite/ld-elf/property-or-4.d: Likewise.
+
 2021-06-18  H.J. Lu  <hongjiu.lu@intel.com>
 
 	* ld.texi: Move -z unique-symbol after -z undefs.
diff --git a/ld/testsuite/ld-elf/property-and-1.d b/ld/testsuite/ld-elf/property-and-1.d
index 480d16e3704..bb7ca1516f5 100644
--- a/ld/testsuite/ld-elf/property-and-1.d
+++ b/ld/testsuite/ld-elf/property-and-1.d
@@ -1,6 +1,15 @@ 
 #source: empty.s
 #source: property-and-1.s
-#as:
+#as: --generate-missing-build-notes=no
 #ld: -shared
 #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.
+
+#failif
+#...
+Displaying notes found in: .note.gnu.property
+#pass
diff --git a/ld/testsuite/ld-elf/property-and-2.d b/ld/testsuite/ld-elf/property-and-2.d
index 007ba482e65..20ce29a15af 100644
--- a/ld/testsuite/ld-elf/property-and-2.d
+++ b/ld/testsuite/ld-elf/property-and-2.d
@@ -1,7 +1,16 @@ 
 #source: property-and-1.s
 #source: empty.s
 #source: property-and-2.s
-#as:
+#as: --generate-missing-build-notes=no
 #ld: -shared
 #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.
+
+#failif
+#...
+Displaying notes found in: .note.gnu.property
+#pass
diff --git a/ld/testsuite/ld-elf/property-and-3.d b/ld/testsuite/ld-elf/property-and-3.d
index 8d5e57915ef..46f1c6ba9cc 100644
--- a/ld/testsuite/ld-elf/property-and-3.d
+++ b/ld/testsuite/ld-elf/property-and-3.d
@@ -1,7 +1,16 @@ 
 #source: property-and-1.s
 #source: property-and-empty.s
 #source: property-and-2.s
-#as:
+#as: --generate-missing-build-notes=no
 #ld: -shared
 #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.
+
+#failif
+#...
+Displaying notes found in: .note.gnu.property
+#pass
diff --git a/ld/testsuite/ld-elf/property-and-4.d b/ld/testsuite/ld-elf/property-and-4.d
index 84bf404383f..8ab03d0e46e 100644
--- a/ld/testsuite/ld-elf/property-and-4.d
+++ b/ld/testsuite/ld-elf/property-and-4.d
@@ -1,12 +1,18 @@ 
 #source: property-and-1.s
 #source: property-and-2.s
 #source: property-and-3.s
-#as:
+#as: --generate-missing-build-notes=no
 #ld: -shared
 #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.
 
+#...
 Displaying notes found in: .note.gnu.property
 [ 	]+Owner[ 	]+Data size[ 	]+Description
   GNU                  0x[0-9a-f]+	NT_GNU_PROPERTY_TYPE_0
       Properties: UINT32_AND \(0xb0007fff\): 0x1
+#pass
diff --git a/ld/testsuite/ld-elf/property-or-1.d b/ld/testsuite/ld-elf/property-or-1.d
index f5392c42cf9..bcc8da162c4 100644
--- a/ld/testsuite/ld-elf/property-or-1.d
+++ b/ld/testsuite/ld-elf/property-or-1.d
@@ -1,11 +1,17 @@ 
 #source: empty.s
 #source: property-or-1.s
-#as:
+#as: --generate-missing-build-notes=no
 #ld: -shared
 #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.
 
+#...
 Displaying notes found in: .note.gnu.property
 [ 	]+Owner[ 	]+Data size[ 	]+Description
   GNU                  0x[0-9a-f]+	NT_GNU_PROPERTY_TYPE_0
       Properties: UINT32_OR \(0xb000ffff\): 0x3
+#pass
diff --git a/ld/testsuite/ld-elf/property-or-2.d b/ld/testsuite/ld-elf/property-or-2.d
index 85b754833cb..7be3a25e8b9 100644
--- a/ld/testsuite/ld-elf/property-or-2.d
+++ b/ld/testsuite/ld-elf/property-or-2.d
@@ -1,12 +1,18 @@ 
 #source: property-or-1.s
 #source: empty.s
 #source: property-or-2.s
-#as:
+#as: --generate-missing-build-notes=no
 #ld: -shared
 #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.
 
+#...
 Displaying notes found in: .note.gnu.property
 [ 	]+Owner[ 	]+Data size[ 	]+Description
   GNU                  0x[0-9a-f]+	NT_GNU_PROPERTY_TYPE_0
       Properties: UINT32_OR \(0xb000ffff\): 0x103
+#pass
diff --git a/ld/testsuite/ld-elf/property-or-3.d b/ld/testsuite/ld-elf/property-or-3.d
index 2d687db4a61..34cb558c18f 100644
--- a/ld/testsuite/ld-elf/property-or-3.d
+++ b/ld/testsuite/ld-elf/property-or-3.d
@@ -1,12 +1,18 @@ 
 #source: property-or-1.s
 #source: property-and-empty.s
 #source: property-or-2.s
-#as:
+#as: --generate-missing-build-notes=no
 #ld: -shared
 #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.
 
+#...
 Displaying notes found in: .note.gnu.property
 [ 	]+Owner[ 	]+Data size[ 	]+Description
   GNU                  0x[0-9a-f]+	NT_GNU_PROPERTY_TYPE_0
       Properties: UINT32_OR \(0xb000ffff\): 0x103
+#pass
diff --git a/ld/testsuite/ld-elf/property-or-4.d b/ld/testsuite/ld-elf/property-or-4.d
index fee22b155c6..3ef3f5385be 100644
--- a/ld/testsuite/ld-elf/property-or-4.d
+++ b/ld/testsuite/ld-elf/property-or-4.d
@@ -1,12 +1,18 @@ 
 #source: property-or-1.s
 #source: property-or-2.s
 #source: property-or-3.s
-#as:
+#as: --generate-missing-build-notes=no
 #ld: -shared
 #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.
 
+#...
 Displaying notes found in: .note.gnu.property
 [ 	]+Owner[ 	]+Data size[ 	]+Description
   GNU                  0x[0-9a-f]+	NT_GNU_PROPERTY_TYPE_0
       Properties: UINT32_OR \(0xb000ffff\): 0x1103
+#pass
-- 
2.31.1