From 4625b4d081eb0a243c6c7370f9a12c97bf6bcf65 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Wed, 24 Jul 2019 17:16:01 +0200 Subject: [PATCH] [gdb/testsuite] Fix infoline-reloc-main-from-zero.exp compilation 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 PR testsuite/24612 * gdb.base/infoline-reloc-main-from-zero.exp: Add -Wl,-N to additional_flags. --- gdb/testsuite/ChangeLog | 6 ++++++ gdb/testsuite/gdb.base/infoline-reloc-main-from-zero.exp | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 32f7ea1..dde5e9c 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,5 +1,11 @@ 2019-07-24 Tom de Vries + PR testsuite/24612 + * gdb.base/infoline-reloc-main-from-zero.exp: Add -Wl,-N to + additional_flags. + +2019-07-24 Tom de Vries + PR testsuite/24831 * gdb.multi/tids.exp: Update error messages for info threads. diff --git a/gdb/testsuite/gdb.base/infoline-reloc-main-from-zero.exp b/gdb/testsuite/gdb.base/infoline-reloc-main-from-zero.exp index 99f5770..670f611 100644 --- a/gdb/testsuite/gdb.base/infoline-reloc-main-from-zero.exp +++ b/gdb/testsuite/gdb.base/infoline-reloc-main-from-zero.exp @@ -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" -- 2.7.4