From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2205) id 43F15385515E; Mon, 28 Nov 2022 09:50:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 43F15385515E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1669629007; bh=bGQQ+fBK+jls7XG8+n7cIS8cDoiNtBbaLW6v62lkuz0=; h=From:To:Subject:Date:From; b=BIw9NOZq1EIif5h+D+AgcNBotVx/F3OR4jx3seiGO0UHdsUdS9rXsVWsNv/ONo/G2 zetYgkNzbEfAQXEQAdPl39/m0iFAyuk+vOn/4QoKRLawY0Vw4CXJoqYOjMJfMS93fG YElnI8muLAhdnb+cU+fjMDQ8h7ORx7fQc9c18NLI= 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/tdep] Fix gdb.base/msym-bp-shl.exp for ppc64le X-Act-Checkin: binutils-gdb X-Git-Author: Tom de Vries X-Git-Refname: refs/heads/master X-Git-Oldrev: b8d7a9572d7e934be23f3b7ef74880e56957c233 X-Git-Newrev: 2650ea9730e31fc5c9111afc1a689dbca76707f5 Message-Id: <20221128095007.43F15385515E@sourceware.org> Date: Mon, 28 Nov 2022 09:50:07 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D2650ea9730e3= 1fc5c9111afc1a689dbca76707f5 commit 2650ea9730e31fc5c9111afc1a689dbca76707f5 Author: Tom de Vries Date: Mon Nov 28 10:50:03 2022 +0100 [gdb/tdep] Fix gdb.base/msym-bp-shl.exp for ppc64le =20 With test-case gdb.base/msym-bp-shl.exp on powerpc64le-linux, I run int= o: ... (gdb) PASS: gdb.base/msym-bp-shl.exp: debug=3D0: 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=3D0: before run: info break= point ... =20 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> =20 Disassembly of section .fini: =20 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 ... =20 This is caused by ppc_elfv2_elf_make_msymbol_special which marks foo@pl= t as having a local entry point, due to incorrectly accessing an asymbol str= uct using a (larger) elf_symbol_type. =20 Fix this by simply ignoring artificial symbols in ppc_elfv2_elf_make_msymbol_special. =20 Tested on powerpc64le. =20 Approved-By: Ulrich Weigand Reviewed-By: Carl Love Tested-By: Carl Love PR tdep/29814 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=3D29814 Diff: --- 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 *gdb= arch, static void ppc_elfv2_elf_make_msymbol_special (asymbol *sym, struct minimal_symbol *m= sym) { + if ((sym->flags & BSF_SYNTHETIC) !=3D 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 =3D (elf_symbol_type *)sym; =20 /* If the symbol is marked as having a local entry point, set a target