From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 0Et9DOJDSWOMJwwAWB0awg (envelope-from ) for ; Fri, 14 Oct 2022 07:11:30 -0400 Received: by simark.ca (Postfix, from userid 112) id 311801E112; Fri, 14 Oct 2022 07:11:30 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=XsE+9+xy; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id D03151E0D5 for ; Fri, 14 Oct 2022 07:11:29 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 81E443850227 for ; Fri, 14 Oct 2022 11:11:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 81E443850227 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1665745889; bh=faTmsID7244kr0J9l1g/355loskQR4dBG4PIB4p7NoU=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=XsE+9+xyENPGtQBDjD+NBHYc25qW9N9rxbmDc1RPKtr/7/HGxumo0kq91JgheteFa 8oSLEVu2NW83lITYydZxyTvM2yGu6UCHCedJov94/dsEdfdxRfG7r7JtugcnljCQmA Nh/fUrXZhXLmg+oqvFeGtLddB3nKUEM7XYxARJpQ= Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 455F23850873 for ; Fri, 14 Oct 2022 11:11:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 455F23850873 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 7E9FF21A28 for ; Fri, 14 Oct 2022 11:11:09 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 6CBD713451 for ; Fri, 14 Oct 2022 11:11:09 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id BAtzGc1DSWPBWgAAMHmgww (envelope-from ) for ; Fri, 14 Oct 2022 11:11:09 +0000 Date: Fri, 14 Oct 2022 13:11:08 +0200 To: gdb-patches@sourceware.org Subject: [committed][gdb/testsuite] Fix gdb.base/infoline-reloc-main-from-zero.exp with PIE Message-ID: <20221014111106.GA11274@delia.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Tom de Vries via Gdb-patches Reply-To: Tom de Vries Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" Hi, With test-case gdb.base/infoline-reloc-main-from-zero.exp and target board 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 ... 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]=$hex, with debug_info, \ not stripped ... despite not having been compiled with -static. Fix the compilation by adding -static to the compilation flags. Tested on x86_64-linux. Committed to trunk. Thanks, - Tom [gdb/testsuite] Fix gdb.base/infoline-reloc-main-from-zero.exp with PIE --- 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=-nostdlib -emain -Wl,-Ttext=0x00 -Wl,-N" +lappend opts additional_flags=-static set ld_flags ldflags=-Wl,--no-warn-rwx-segments if { [gdb_can_simple_compile ld-flags {int main () { return 0; }} executable \