Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Longjun Luo via Gdb <gdb@sourceware.org>
To: gdb@sourceware.org
Cc: Simon Marchi <simon.marchi@polymtl.ca>, Tom Tromey <tom@tromey.com>
Subject: [RFC] PR symtab/34741: expression lookup and overridden weak functions
Date: Tue, 13 Oct 2026 18:13:36 +0800	[thread overview]
Message-ID: <CAKL4jwWT+2suZyXxPL0r7m+D3B5OvEoqB4CVY+3x+v4fvHGTHg@mail.gmail.com> (raw)

Hi,

I filed PR symtab/34741:
https://sourceware.org/bugzilla/show_bug.cgi?id=34741

With ordinary compiler output, GDB can call an overridden weak function
instead of the strong definition used by the program. In the reproducer,
"print action()" returns 22 while the program's call returns 11. This
happens in the weak definition's CU and, depending on CU search order,
in unrelated CUs too.

For ordinary global function lookup, my local fix uses the main ELF
executable's minimal symbol to select a full definition with the same
linkage name and address, taking both type and address from it. Lexical
and explicit file-qualified lookups are unchanged. Does this direction
look reasonable?

I have no FSF copyright assignment for GDB. The implementation is a few
hundred lines plus regression tests, so it is not a trivial change.
Would a DCO sign-off be acceptable, or should I arrange an assignment?

Thanks,
Longjun Luo

                 reply	other threads:[~2026-10-13 10:14 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=CAKL4jwWT+2suZyXxPL0r7m+D3B5OvEoqB4CVY+3x+v4fvHGTHg@mail.gmail.com \
    --to=gdb@sourceware.org \
    --cc=luolongjuna@gmail.com \
    --cc=simon.marchi@polymtl.ca \
    --cc=tom@tromey.com \
    /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: link
Be 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