From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0985C3857B9B; Wed, 23 Nov 2022 11:11:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0985C3857B9B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1669201898; bh=RsuGtY3ChCT0u6jqxDoBp2zgEnf4hjJ3WGbHiweDseo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=xW3CEWFa1JItLRhRcd05SvqTePX21I3b9Fw8fYHY956iEiz8n1QV14hs+9Hkxsx0+ NEoPhIckeSYV/IHDVvSHhjHVld0qhSDavpP6PxxqfFHWMveZIjlSfFq11DWZpRY07+ 05D1JfUjMC1tjAuPxB/LYduo+MBJsSTcUaaZ/16U= From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug tdep/29814] [gdb/tdep, powerpc64le] FAIL: gdb.base/msym-bp-shl.exp: debug=0: before run: info breakpoint Date: Wed, 23 Nov 2022 11:11:37 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: tdep X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vries at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D29814 Tom de Vries changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |cel at us dot ibm.com, | |ulrich.weigand at de dot i= bm.com --- Comment #3 from Tom de Vries --- This is a more generic fix: ... diff --git a/gdb/ppc-linux-tdep.c b/gdb/ppc-linux-tdep.c index cc5a26431ba..f7a7703e01e 100644 --- a/gdb/ppc-linux-tdep.c +++ b/gdb/ppc-linux-tdep.c @@ -1662,6 +1662,14 @@ ppc_elfv2_skip_entrypoint (struct gdbarch *gdbarch, CORE_ADDR pc) if (fun.minsym =3D=3D NULL) return pc; + const char *name =3D fun.minsym->linkage_name (); + const char *atsign =3D strchr (name, '@'); + bool is_at_symbol =3D atsign !=3D nullptr && atsign > name; + bool is_plt =3D is_at_symbol && strcmp (atsign, "@plt") =3D=3D 0; + + if (is_plt) + return pc; + /* See ppc_elfv2_elf_make_msymbol_special for how local entry point offset values are encoded. */ if (fun.minsym->target_flag_1 ()) ... Not great to do the string comparison here, but I'm not sure what else to d= o. I saw: ... 0x0000000070000000 (PPC64_GLINK) 0x9fc ... and: ... 00000000000009e8 <__glink_PLTresolve>: 9e8: a6 02 08 7c mflr r0 ... a18: 20 04 80 4e bctr 0000000000000a1c <__cxa_finalize@plt>: a1c: cc ff ff 4b b 9e8 <__glink_PLTresolve> 0000000000000a20 <__libc_start_main@plt>: a20: c8 ff ff 4b b 9e8 <__glink_PLTresolve> 0000000000000a24 <__gmon_start__@plt>: a24: c4 ff ff 4b b 9e8 <__glink_PLTresolve> 0000000000000a28 : a28: c0 ff ff 4b b 9e8 <__glink_PLTresolve> Disassembly of section .fini: 0000000000000a2c <_fini>: ... So maybe we can compare the address to PPC64_GLINK, and if it's bigger than that and in the text section we can consider it plt? --=20 You are receiving this mail because: You are on the CC list for the bug.=