* [RFC] PR symtab/34741: expression lookup and overridden weak functions
@ 2026-10-13 10:13 Longjun Luo via Gdb
2026-10-30 17:44 ` Tom Tromey
0 siblings, 1 reply; 2+ messages 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] 2+ messages in thread
* Re: [RFC] PR symtab/34741: expression lookup and overridden weak functions
2026-10-13 10:13 [RFC] PR symtab/34741: expression lookup and overridden weak functions Longjun Luo via Gdb
@ 2026-10-30 17:44 ` Tom Tromey
0 siblings, 0 replies; 2+ messages in thread
From: Tom Tromey @ 2026-10-30 17:44 UTC (permalink / raw)
To: Longjun Luo via Gdb; +Cc: Longjun Luo, Simon Marchi, Tom Tromey
>>>>> Longjun Luo via Gdb <gdb@sourceware.org> writes:
I didn't see a reply to this.
> 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 don't really know this area well, so I can't comment on this; but here:
> 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?
I think you should get an assignment.
thanks,
Tom
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-10-30 17:45 UTC | newest]
Thread overview: 2+ messages (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
2026-10-30 17:44 ` Tom Tromey
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox