* [PATCH] elf: Add is_standard_elf
@ 2024-01-25 18:08 H.J. Lu
2024-01-26 12:00 ` Nick Clifton
2024-04-12 10:07 ` Nick Clifton
0 siblings, 2 replies; 4+ messages in thread
From: H.J. Lu @ 2024-01-25 18:08 UTC (permalink / raw)
To: binutils
PR ld/31289 tests failed for fr30-elf, frv-elf, ft32-elf, iq2000-elf,
mn10200-elf, ms1-elf and msp430-elf targets:
FAIL: ld-elf/fatal-warnings-2a
FAIL: ld-elf/fatal-warnings-2b
FAIL: ld-elf/fatal-warnings-3a
FAIL: ld-elf/fatal-warnings-3b
FAIL: ld-elf/fatal-warnings-4a
FAIL: ld-elf/fatal-warnings-4b
even though PR ld/31289 targets xfail for [is_generic] targets. These
targets not only don't use the generic_link_hash_table linker, but also
don't use the standard ELF emulation. Add is_standard_elf for ELF
targets which use the standard ELF emulation and replace [is_generic]
with ![is_standard_elf] in PR ld/31289 tests.
binutils/
PR ld/31289
* testsuite/lib/binutils-common.exp (is_standard_elf): New.
ld/
PR ld/31289
* testsuite/lib/binutils-common.exp (is_generic): Return 1 for
fr30-*-*, frv-*-elf, ft32-*-*, iq2000-*-*, mn10200-*-*,
moxie-*-moxiebox*, msp430-*-* and mt-*-*.
* testsuite/ld-elf/fatal-warnings-2a.d: Replace [is_generic]
with ![is_standard_elf].
* testsuite/ld-elf/fatal-warnings-2b.d: Likewise.
* testsuite/ld-elf/fatal-warnings-3a.d: Likewise.
* testsuite/ld-elf/fatal-warnings-3b.d: Likewise.
* testsuite/ld-elf/fatal-warnings-4a.d: Likewise.
* testsuite/ld-elf/fatal-warnings-4b.d: Likewise.
---
binutils/testsuite/lib/binutils-common.exp | 21 +++++++++++++++++++++
ld/testsuite/ld-elf/fatal-warnings-2a.d | 4 ++--
ld/testsuite/ld-elf/fatal-warnings-2b.d | 4 ++--
ld/testsuite/ld-elf/fatal-warnings-3a.d | 4 ++--
ld/testsuite/ld-elf/fatal-warnings-3b.d | 4 ++--
ld/testsuite/ld-elf/fatal-warnings-4a.d | 4 ++--
ld/testsuite/ld-elf/fatal-warnings-4b.d | 4 ++--
7 files changed, 33 insertions(+), 12 deletions(-)
diff --git a/binutils/testsuite/lib/binutils-common.exp b/binutils/testsuite/lib/binutils-common.exp
index dc140f8a922..b304801e718 100644
--- a/binutils/testsuite/lib/binutils-common.exp
+++ b/binutils/testsuite/lib/binutils-common.exp
@@ -275,6 +275,27 @@ proc is_generic { } {
return 0
}
+# Return true if target uses the standard ELF emulation.
+proc is_standard_elf { } {
+ if { ![is_elf_format] || [is_generic] } {
+ return 0
+ }
+
+ # These targets don't use elf.em.
+ if { [istarget "fr30-*-*"]
+ || [istarget "frv-*-elf"]
+ || [istarget "ft32-*-*"]
+ || [istarget "iq2000-*-*"]
+ || [istarget "mn10200-*-*"]
+ || [istarget "moxie-*-moxiebox*"]
+ || [istarget "msp430-*-*"]
+ || [istarget "mt-*-*"] } {
+ return 0
+ }
+
+ return 1
+}
+
# True if the object format is ELF with unused section symbols.
proc is_elf_unused_section_symbols {} {
global AS ASFLAGS READELF
diff --git a/ld/testsuite/ld-elf/fatal-warnings-2a.d b/ld/testsuite/ld-elf/fatal-warnings-2a.d
index 5c46f4300c6..b17abb1b274 100644
--- a/ld/testsuite/ld-elf/fatal-warnings-2a.d
+++ b/ld/testsuite/ld-elf/fatal-warnings-2a.d
@@ -2,5 +2,5 @@
#source: start.s
#ld: -z bad-option1 -z bad-option2
#warning: -z bad-option1 ignored
-#xfail: [is_generic]
-# generic linker targets don't support -z options.
+#xfail: ![is_standard_elf]
+# These targets don't support -z options.
diff --git a/ld/testsuite/ld-elf/fatal-warnings-2b.d b/ld/testsuite/ld-elf/fatal-warnings-2b.d
index 5fa94e467af..7aedb531dd4 100644
--- a/ld/testsuite/ld-elf/fatal-warnings-2b.d
+++ b/ld/testsuite/ld-elf/fatal-warnings-2b.d
@@ -2,5 +2,5 @@
#source: start.s
#ld: -z bad-option1 -z bad-option2
#warning: -z bad-option2 ignored
-#xfail: [is_generic]
-# generic linker targets don't support -z options.
+#xfail: ![is_standard_elf]
+# These targets don't support -z options.
diff --git a/ld/testsuite/ld-elf/fatal-warnings-3a.d b/ld/testsuite/ld-elf/fatal-warnings-3a.d
index a377b738b1d..1b52f8fe0c5 100644
--- a/ld/testsuite/ld-elf/fatal-warnings-3a.d
+++ b/ld/testsuite/ld-elf/fatal-warnings-3a.d
@@ -2,5 +2,5 @@
#source: start.s
#ld: --fatal-warnings -z bad-option1 -z bad-option2
#error: unsupported option: -z bad-option1
-#xfail: [is_generic]
-# generic linker targets don't support -z options.
+#xfail: ![is_standard_elf]
+# These targets don't support -z options.
diff --git a/ld/testsuite/ld-elf/fatal-warnings-3b.d b/ld/testsuite/ld-elf/fatal-warnings-3b.d
index 87ea286d748..870a1eb2fea 100644
--- a/ld/testsuite/ld-elf/fatal-warnings-3b.d
+++ b/ld/testsuite/ld-elf/fatal-warnings-3b.d
@@ -2,5 +2,5 @@
#source: start.s
#ld: --fatal-warnings -z bad-option1 -z bad-option2
#error: unsupported option: -z bad-option2
-#xfail: [is_generic]
-# generic linker targets don't support -z options.
+#xfail: ![is_standard_elf]
+# These targets don't support -z options.
diff --git a/ld/testsuite/ld-elf/fatal-warnings-4a.d b/ld/testsuite/ld-elf/fatal-warnings-4a.d
index 4685e3877d6..cf7373b4625 100644
--- a/ld/testsuite/ld-elf/fatal-warnings-4a.d
+++ b/ld/testsuite/ld-elf/fatal-warnings-4a.d
@@ -2,5 +2,5 @@
#source: start.s
#ld: -z bad-option1 -z bad-option2 --fatal-warnings
#error: unsupported option: -z bad-option1
-#xfail: [is_generic]
-# generic linker targets don't support -z options.
+#xfail: ![is_standard_elf]
+# These targets don't support -z options.
diff --git a/ld/testsuite/ld-elf/fatal-warnings-4b.d b/ld/testsuite/ld-elf/fatal-warnings-4b.d
index 6fc2185f126..7cdb2b4db7a 100644
--- a/ld/testsuite/ld-elf/fatal-warnings-4b.d
+++ b/ld/testsuite/ld-elf/fatal-warnings-4b.d
@@ -2,5 +2,5 @@
#source: start.s
#ld: -z bad-option1 -z bad-option2 --fatal-warnings
#error: unsupported option: -z bad-option2
-#xfail: [is_generic]
-# generic linker targets don't support -z options.
+#xfail: ![is_standard_elf]
+# These targets don't support -z options.
--
2.43.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] elf: Add is_standard_elf
2024-01-25 18:08 [PATCH] elf: Add is_standard_elf H.J. Lu
@ 2024-01-26 12:00 ` Nick Clifton
2024-01-26 13:59 ` H.J. Lu
2024-04-12 10:07 ` Nick Clifton
1 sibling, 1 reply; 4+ messages in thread
From: Nick Clifton @ 2024-01-26 12:00 UTC (permalink / raw)
To: H.J. Lu, binutils
Hi H.J.
> even though PR ld/31289 targets xfail for [is_generic] targets. These
> targets not only don't use the generic_link_hash_table linker, but also
> don't use the standard ELF emulation. Add is_standard_elf for ELF
> targets which use the standard ELF emulation and replace [is_generic]
> with ![is_standard_elf] in PR ld/31289 tests.
I think that is_standard_elf might be a bit pejorative. Those targets
are conforming to the ELF standard, they are just choosing to use their
own methods for implementing it. May I instead suggest: "uses_elf_em"
as an alternative, since this seems to capture the reason for
segregating these particular targets.
Cheers
Nick
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] elf: Add is_standard_elf
2024-01-26 12:00 ` Nick Clifton
@ 2024-01-26 13:59 ` H.J. Lu
0 siblings, 0 replies; 4+ messages in thread
From: H.J. Lu @ 2024-01-26 13:59 UTC (permalink / raw)
To: Nick Clifton; +Cc: binutils
On Fri, Jan 26, 2024 at 4:00 AM Nick Clifton <nickc@redhat.com> wrote:
>
> Hi H.J.
>
> > even though PR ld/31289 targets xfail for [is_generic] targets. These
> > targets not only don't use the generic_link_hash_table linker, but also
> > don't use the standard ELF emulation. Add is_standard_elf for ELF
> > targets which use the standard ELF emulation and replace [is_generic]
> > with ![is_standard_elf] in PR ld/31289 tests.
>
> I think that is_standard_elf might be a bit pejorative. Those targets
> are conforming to the ELF standard, they are just choosing to use their
> own methods for implementing it. May I instead suggest: "uses_elf_em"
> as an alternative, since this seems to capture the reason for
> segregating these particular targets.
Here is the patch:
https://sourceware.org/pipermail/binutils/2024-January/132170.html
Thanks.
--
H.J.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] elf: Add is_standard_elf
2024-01-25 18:08 [PATCH] elf: Add is_standard_elf H.J. Lu
2024-01-26 12:00 ` Nick Clifton
@ 2024-04-12 10:07 ` Nick Clifton
1 sibling, 0 replies; 4+ messages in thread
From: Nick Clifton @ 2024-04-12 10:07 UTC (permalink / raw)
To: H.J. Lu, binutils
Hi H.J.
> PR ld/31289 tests failed for fr30-elf, frv-elf, ft32-elf, iq2000-elf,
> mn10200-elf, ms1-elf and msp430-elf targets:
>
> FAIL: ld-elf/fatal-warnings-2a
> FAIL: ld-elf/fatal-warnings-2b
> FAIL: ld-elf/fatal-warnings-3a
> FAIL: ld-elf/fatal-warnings-3b
> FAIL: ld-elf/fatal-warnings-4a
> FAIL: ld-elf/fatal-warnings-4b
>
> even though PR ld/31289 targets xfail for [is_generic] targets. These
> targets not only don't use the generic_link_hash_table linker, but also
> don't use the standard ELF emulation. Add is_standard_elf for ELF
> targets which use the standard ELF emulation and replace [is_generic]
> with ![is_standard_elf] in PR ld/31289 tests.
Approved - please apply.
Cheers
Nick
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-04-12 10:07 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-25 18:08 [PATCH] elf: Add is_standard_elf H.J. Lu
2024-01-26 12:00 ` Nick Clifton
2024-01-26 13:59 ` H.J. Lu
2024-04-12 10:07 ` Nick Clifton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).