[gdb/testsuite] Fix infoline-reloc-main-from-zero.exp compilation
authorTom de Vries <tdevries@suse.de>
Wed, 24 Jul 2019 15:16:01 +0000 (17:16 +0200)
committerTom de Vries <tdevries@suse.de>
Wed, 24 Jul 2019 15:16:01 +0000 (17:16 +0200)
When running gdb.base/infoline-reloc-main-from-zero.exp, I see:
...
Running gdb/testsuite/gdb.base/infoline-reloc-main-from-zero.exp ...
gdb compile failed, ld: infoline-reloc-main-from-zero: \
  not enough room for program headers, try linking with -N
ld: final link failed: bad value
collect2: error: ld returned 1 exit status
UNTESTED: gdb.base/infoline-reloc-main-from-zero.exp: infoline-reloc-main-from-zero.exp
UNTESTED: gdb.base/infoline-reloc-main-from-zero.exp: failed to compile
...

Fix this by following the suggestion:
...
-set opts {debug "additional_flags=-nostdlib -emain -Wl,-Ttext=0x00"}
+set opts {debug "additional_flags=-nostdlib -emain -Wl,-Ttext=0x00 -Wl,-N"}
...

Tested on x86_64-linux.

gdb/testsuite/ChangeLog:

2019-07-24  Tom de Vries  <tdevries@suse.de>

PR testsuite/24612
* gdb.base/infoline-reloc-main-from-zero.exp: Add -Wl,-N to
additional_flags.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/infoline-reloc-main-from-zero.exp

index 32f7ea156a22868bb658564d6e507ac87fdba518..dde5e9cb4df48ca1ff4e4b3b3a5fdb30db4e8424 100644 (file)
@@ -1,3 +1,9 @@
+2019-07-24  Tom de Vries  <tdevries@suse.de>
+
+       PR testsuite/24612
+       * gdb.base/infoline-reloc-main-from-zero.exp: Add -Wl,-N to
+       additional_flags.
+
 2019-07-24  Tom de Vries  <tdevries@suse.de>
 
        PR testsuite/24831
index 99f577004e9f324725294bcfe14d68d509f235d9..670f61146659e91b08897b64aaffe0c94aa36329 100644 (file)
@@ -29,7 +29,7 @@ if [get_compiler_info] {
 
 # Build executable with stripped startup code and text section starting at zero
 
-set opts {debug "additional_flags=-nostdlib -emain -Wl,-Ttext=0x00"}
+set opts {debug "additional_flags=-nostdlib -emain -Wl,-Ttext=0x00 -Wl,-N"}
 
 if {[build_executable $testfile.exp $testfile $srcfile $opts] == -1} {
     untested "failed to compile"