public inbox for gdb-prs@sourceware.org help / color / mirror / Atom feed
From: "vries at gcc dot gnu.org" <sourceware-bugzilla@sourceware.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 [thread overview] Message-ID: <bug-29814-4717-ZZzZvrAGnE@http.sourceware.org/bugzilla/> (raw) In-Reply-To: <bug-29814-4717@http.sourceware.org/bugzilla/> https://sourceware.org/bugzilla/show_bug.cgi?id=29814 Tom de Vries <vries at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |cel at us dot ibm.com, | |ulrich.weigand at de dot ibm.com --- Comment #3 from Tom de Vries <vries at gcc dot gnu.org> --- 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 == NULL) return pc; + const char *name = fun.minsym->linkage_name (); + const char *atsign = strchr (name, '@'); + bool is_at_symbol = atsign != nullptr && atsign > name; + bool is_plt = is_at_symbol && strcmp (atsign, "@plt") == 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 do. 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 <foo@plt>: 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? -- You are receiving this mail because: You are on the CC list for the bug.
next prev parent reply other threads:[~2022-11-23 11:11 UTC|newest] Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-11-21 13:27 [Bug tdep/29814] New: " vries at gcc dot gnu.org 2022-11-21 16:32 ` [Bug tdep/29814] " vries at gcc dot gnu.org 2022-11-23 10:14 ` vries at gcc dot gnu.org 2022-11-23 11:11 ` vries at gcc dot gnu.org [this message] 2022-11-23 11:59 ` uweigand at gcc dot gnu.org 2022-11-23 16:16 ` vries at gcc dot gnu.org 2022-11-23 16:37 ` cel at us dot ibm.com 2022-11-23 17:03 ` uweigand at gcc dot gnu.org 2022-11-23 20:43 ` cel at us dot ibm.com 2022-11-24 12:45 ` vries at gcc dot gnu.org 2022-11-28 9:50 ` cvs-commit at gcc dot gnu.org 2022-11-28 9:51 ` vries at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-29814-4717-ZZzZvrAGnE@http.sourceware.org/bugzilla/ \ --to=sourceware-bugzilla@sourceware.org \ --cc=gdb-prs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).