[binutils-gdb] Move uses_elf_em to ld-lib.exp

Alan Modra amodra@sourceware.org
Sat Sep 28 06:19:42 GMT 2024


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

commit f6abafcd91fcdc63d301314c828989b39e061092
Author: Alan Modra <amodra@gmail.com>
Date:   Fri Sep 27 09:52:07 2024 +0930

    Move uses_elf_em to ld-lib.exp
    
    and add a missing entry from uses_genelf.
    
    binutils/
            * testsuite/lib/binutils-common.exp (uses_elf_em): Delete.
    ld/
            * testsuite/lib/ld-lib.exp (uses_genelf): Add moxie-*-moxiebox.
            (uses_elf_em): New.

Diff:
---
 binutils/testsuite/lib/binutils-common.exp | 21 ---------------------
 ld/testsuite/lib/ld-lib.exp                |  9 +++++++++
 2 files changed, 9 insertions(+), 21 deletions(-)

diff --git a/binutils/testsuite/lib/binutils-common.exp b/binutils/testsuite/lib/binutils-common.exp
index 8d284071087..403103da366 100644
--- a/binutils/testsuite/lib/binutils-common.exp
+++ b/binutils/testsuite/lib/binutils-common.exp
@@ -275,27 +275,6 @@ proc is_generic { } {
     return 0
 }
 
-# Return true if target uses elf.em.
-proc uses_elf_em { } {
-    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/lib/ld-lib.exp b/ld/testsuite/lib/ld-lib.exp
index c540940670d..4c434257725 100644
--- a/ld/testsuite/lib/ld-lib.exp
+++ b/ld/testsuite/lib/ld-lib.exp
@@ -1141,6 +1141,7 @@ proc uses_genelf { } {
 	 || [istarget "ft32-*-*"]
 	 || [istarget "iq2000-*-*"]
 	 || [istarget "mn10200-*-*"]
+	 || [istarget "moxie-*-moxiebox*"]
 	 || [istarget "msp430-*-*"]
 	 || [istarget "mt-*-*"]
 	 || [istarget "pj*-*-*"]
@@ -1151,6 +1152,14 @@ proc uses_genelf { } {
     return 0
 }
 
+# Return true if target uses elf.em.
+proc uses_elf_em { } {
+    if { [is_elf_format] && ![uses_genelf] } {
+	return 1;
+    }
+    return 0;
+}
+
 proc is_underscore_target { } {
     global is_underscore_target_saved
     global target_triplet


More information about the Binutils-cvs mailing list