public inbox for binutils-cvs@sourceware.org
 help / color / mirror / Atom feed
* [binutils-gdb] Fix ld/x86: reduce testsuite dependency on system object files
@ 2023-12-02  2:55 H.J. Lu
  0 siblings, 0 replies; only message in thread
From: H.J. Lu @ 2023-12-02  2:55 UTC (permalink / raw)
  To: bfd-cvs

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

commit 260aa570edcf120332daefb4a102a08c90e4d9b4
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Dec 1 09:13:08 2023 -0800

    Fix ld/x86: reduce testsuite dependency on system object files
    
    commit eab996435fe65a421541f59557c5f1fd427573a3
    Author: Jan Beulich <jbeulich@suse.com>
    Date:   Tue Nov 7 13:58:32 2023 +0100
    
        ld/x86: reduce testsuite dependency on system object files
    
    changed some C compiler tests to assembler/linker tests which introduced
    2 problems:
    
    1. It broke x32 binutils tests since --64 was passed to assembler, but
    -m elf_x86_64 wasn't passed to linker.
    2. -nostdlib was passed to C compiler driver to exclude standard run-time
    files which should be avoided with -r option for linker tests.
    
    Fix them by passing -m elf_x86_64 to linker and removing -nostdlib for
    linker tests with -r.
    
            PR ld/30722
            * testsuite/ld-x86-64/x86-64.exp: Pass -m elf_x86_64 to linker
            for tests with --64.  Remove -nostdlib for tests with -r.

Diff:
---
 ld/testsuite/ld-x86-64/x86-64.exp | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/ld/testsuite/ld-x86-64/x86-64.exp b/ld/testsuite/ld-x86-64/x86-64.exp
index 71ecc92f081..95a2986265b 100644
--- a/ld/testsuite/ld-x86-64/x86-64.exp
+++ b/ld/testsuite/ld-x86-64/x86-64.exp
@@ -2101,7 +2101,7 @@ run_ld_link_tests [list \
     ] \
     [list \
 	"Build property 3" \
-	"" \
+	"-m elf_x86_64" \
 	"" \
 	"--64 -defsym __64_bit__=1 -mx86-used-note=yes" \
 	{property-stk.s property-x86-1.s} \
@@ -2110,7 +2110,7 @@ run_ld_link_tests [list \
     ] \
     [list \
 	"Build property 3 (.o)" \
-	"-r -nostdlib" \
+	"-m elf_x86_64 -r" \
 	"" \
 	"--64 -defsym __64_bit__=1 -mx86-used-note=yes" \
 	{property-x86-1.s property-stk.s} \
@@ -2119,7 +2119,7 @@ run_ld_link_tests [list \
     ] \
     [list \
 	"Build property 3 (.so)" \
-	"-shared" \
+	"-m elf_x86_64 -shared" \
 	"" \
 	"--64 -defsym __64_bit__=1 -mx86-used-note=yes" \
 	{property-x86-1.s property-stk.s} \
@@ -2128,7 +2128,7 @@ run_ld_link_tests [list \
     ] \
     [list \
 	"Build property 4" \
-	"" \
+	"-m elf_x86_64" \
 	"" \
 	"--64 -defsym __64_bit__=1 -mx86-used-note=yes" \
 	{property-stk.s property-x86-1.s property-x86-2.s} \
@@ -2137,7 +2137,7 @@ run_ld_link_tests [list \
     ] \
     [list \
 	"Build property 4 (.o)" \
-	"-r -nostdlib" \
+	"-m elf_x86_64 -r" \
 	"" \
 	"--64 -defsym __64_bit__=1 -mx86-used-note=yes" \
 	{property-x86-2.s property-x86-1.s property-stk.s} \
@@ -2146,7 +2146,7 @@ run_ld_link_tests [list \
     ] \
     [list \
 	"Build property 4 (.so)" \
-	"-shared" \
+	"-m elf_x86_64 -shared" \
 	"" \
 	"--64 -defsym __64_bit__=1 -mx86-used-note=yes" \
 	{property-x86-2.s property-x86-1.s property-stk.s} \
@@ -2155,7 +2155,7 @@ run_ld_link_tests [list \
     ] \
     [list \
 	"Build property 4 (-z stack-size=0)" \
-	"-z stack-size=0" \
+	"-m elf_x86_64 -z stack-size=0" \
 	"" \
 	"--64 -defsym __64_bit__=1 -mx86-used-note=yes" \
 	{property-stk.s property-x86-1.s property-x86-2.s} \
@@ -2164,7 +2164,7 @@ run_ld_link_tests [list \
     ] \
     [list \
 	"Build property 5" \
-	"-z stack-size=0x900000" \
+	"-m elf_x86_64 -z stack-size=0x900000" \
 	"" \
 	"--64 -defsym __64_bit__=1 -mx86-used-note=yes" \
 	{property-stk.s property-x86-1.s property-x86-2.s} \
@@ -2173,7 +2173,7 @@ run_ld_link_tests [list \
     ] \
     [list \
 	"Build property 5 (.o)" \
-	"-r -nostdlib -z stack-size=0x900000" \
+	"-m elf_x86_64 -r -z stack-size=0x900000" \
 	"" \
 	"--64 -defsym __64_bit__=1 -mx86-used-note=yes" \
 	{property-x86-2.s property-x86-1.s property-stk.s} \
@@ -2182,7 +2182,7 @@ run_ld_link_tests [list \
     ] \
     [list \
 	"Build property 5 (.so)" \
-	"-shared -z stack-size=0x900000" \
+	"-m elf_x86_64 -shared -z stack-size=0x900000" \
 	"" \
 	"--64 -defsym __64_bit__=1 -mx86-used-note=yes" \
 	{property-x86-2.s property-x86-1.s property-stk.s} \

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-12-02  2:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-02  2:55 [binutils-gdb] Fix ld/x86: reduce testsuite dependency on system object files H.J. Lu

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