From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2205) id 03C71385842F; Fri, 14 Oct 2022 11:10:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 03C71385842F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1665745824; bh=0aeavPI1BNTqvfIaaH6svUWqO7cjOJ2C3C4kmGCZs0w=; h=From:To:Subject:Date:From; b=dlrt9EMSiQT38lYeFB86V4kRQ01BBrSGyO3B9vzzrDoB8Gl4ylxhEwI158peJ7Jyz urPSPkQulau5UsF/ue8pQ9ddsGiTqhallF7wB/XlQB6dasuJOMPAUx44P7mDgh7JHN 6pmsQDeNlxIWhcL5Q7zhDUhVlcC8aK/B5p1z/QmE= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom de Vries To: gdb-cvs@sourceware.org Subject: [binutils-gdb] [gdb/testsuite] Fix gdb.base/infoline-reloc-main-from-zero.exp with PIE X-Act-Checkin: binutils-gdb X-Git-Author: Tom de Vries X-Git-Refname: refs/heads/master X-Git-Oldrev: 21f507efad6bf16edf2432b65b763e7686349b8a X-Git-Newrev: f98a7af815ce6f656eebe95e8dc21b63bb8ec9d2 Message-Id: <20221014111024.03C71385842F@sourceware.org> Date: Fri, 14 Oct 2022 11:10:23 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Df98a7af815ce= 6f656eebe95e8dc21b63bb8ec9d2 commit f98a7af815ce6f656eebe95e8dc21b63bb8ec9d2 Author: Tom de Vries Date: Fri Oct 14 13:09:51 2022 +0200 [gdb/testsuite] Fix gdb.base/infoline-reloc-main-from-zero.exp with PIE =20 With test-case gdb.base/infoline-reloc-main-from-zero.exp and target bo= ard unix/-fPIE/-pie I run into: ... gdb compile failed, ld: infoline-reloc-main-from-zero: error: \ PHDR segment not covered by LOAD segment collect2: error: ld returned 1 exit status ... =20 When running with native, I find that the executable is static: ... $ file infoline-reloc-main-from-zero infoline-reloc-main-from-zero: ELF 64-bit LSB executable, x86-64, \ version 1 (SYSV), statically linked, BuildID[sha1]=3D$hex, with debug= _info, \ not stripped ... despite not having been compiled with -static. =20 Fix the compilation by adding -static to the compilation flags. =20 Tested on x86_64-linux. Diff: --- gdb/testsuite/gdb.base/infoline-reloc-main-from-zero.exp | 1 + 1 file changed, 1 insertion(+) 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 c1391ee22c9..93c729535bb 100644 --- a/gdb/testsuite/gdb.base/infoline-reloc-main-from-zero.exp +++ b/gdb/testsuite/gdb.base/infoline-reloc-main-from-zero.exp @@ -28,6 +28,7 @@ standard_testfile .c set opts {} lappend opts debug lappend opts "ldflags=3D-nostdlib -emain -Wl,-Ttext=3D0x00 -Wl,-N" +lappend opts additional_flags=3D-static =20 set ld_flags ldflags=3D-Wl,--no-warn-rwx-segments if { [gdb_can_simple_compile ld-flags {int main () { return 0; }} executab= le \