From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 3A65238432E3 for ; Thu, 24 Nov 2022 12:45:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3A65238432E3 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de 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 73A6821889; Thu, 24 Nov 2022 12:45:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1669293915; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=9N2Ddw/b83jxGCHHspz9gOYU8LskElcYygLmuh9Lob8=; b=EFpkMYmvKpfHJdYzQZMeOsHa9oSkgdDKupvgx0BJ9uLQbugj/3e8kdEasu63n63df7zpxD jDW8gX5mAwFzQd5LIgzxhMI9t+nNfOvC4TrsDqbI2m3xfl2VybQ6c61qtV0vLUtY7rCBCS ioecbdbdNRoHm0YL7lgj/ccg1hoxJUo= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1669293915; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=9N2Ddw/b83jxGCHHspz9gOYU8LskElcYygLmuh9Lob8=; b=4n4my4WZLUQPib4+epU3zz6Xqvj22DjFpXrsNyjvVz9F+YqVF4qcv+zTHMQSHrQgQp2Bex xl2UCfz0u38+T9DA== 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 6641D13488; Thu, 24 Nov 2022 12:45:15 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id qY5fGFtnf2MtDQAAMHmgww (envelope-from ); Thu, 24 Nov 2022 12:45:15 +0000 From: Tom de Vries To: gdb-patches@sourceware.org Cc: Carl Love , Ulrich Weigand Subject: [PATCH] [gdb/tdep] Fix gdb.base/msym-bp-shl.exp for ppc64le Date: Thu, 24 Nov 2022 13:45:15 +0100 Message-Id: <20221124124515.10182-1-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: With test-case gdb.base/msym-bp-shl.exp on powerpc64le-linux, I run into: ... (gdb) PASS: gdb.base/msym-bp-shl.exp: debug=0: before run: break foo info breakpoint^M Num Type Disp Enb Address What^M 1 breakpoint keep y ^M 1.1 y 0x00000000000008d4 ^M 1.2 y 0x0000000000000a34 crti.S:88^M (gdb) FAIL: gdb.base/msym-bp-shl.exp: debug=0: before run: info breakpoint ... The problem is that the prologue skipper walks from foo@plt at 0xa28 to 0xa34: ... 0000000000000a28 : a28: c0 ff ff 4b b 9e8 <__glink_PLTresolve> Disassembly of section .fini: 0000000000000a2c <_fini>: a2c: 02 00 4c 3c addis r2,r12,2 a30: d4 74 42 38 addi r2,r2,29908 a34: a6 02 08 7c mflr r0 ... This is caused by ppc_elfv2_elf_make_msymbol_special which marks foo@plt as having a local entry point, due incorrectly accessing an asymbol struct using a (larger) elf_symbol_type. Fix this by simply ignoring artificial symbols in ppc_elfv2_elf_make_msymbol_special. Tested on powerpc64le. Approved-By: Ulrich Weigand Reviewed-By: Carl Love Tested-By: Carl Love PR tdep/29814 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29814 --- gdb/ppc-linux-tdep.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gdb/ppc-linux-tdep.c b/gdb/ppc-linux-tdep.c index cc5a26431ba..39d692b2764 100644 --- a/gdb/ppc-linux-tdep.c +++ b/gdb/ppc-linux-tdep.c @@ -1632,6 +1632,11 @@ ppc_linux_core_read_description (struct gdbarch *gdbarch, static void ppc_elfv2_elf_make_msymbol_special (asymbol *sym, struct minimal_symbol *msym) { + if ((sym->flags & BSF_SYNTHETIC) != 0) + /* ELFv2 synthetic symbols (the PLT stubs and the __glink_PLTresolve + trampoline) do not have a local entry point. */ + return; + elf_symbol_type *elf_sym = (elf_symbol_type *)sym; /* If the symbol is marked as having a local entry point, set a target base-commit: 8ee52bcf39e95abbc9cfffbb0afbb55be67e8c3d -- 2.35.3