Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* [RFC] PR symtab/34741: expression lookup and overridden weak functions
@ 2026-10-13 10:13 Longjun Luo via Gdb
  0 siblings, 0 replies; only message in thread
From: Longjun Luo via Gdb @ 2026-10-13 10:13 UTC (permalink / raw)
  To: gdb; +Cc: Simon Marchi, Tom Tromey

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-10-13 10:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-13 10:13 [RFC] PR symtab/34741: expression lookup and overridden weak functions Longjun Luo via Gdb

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox