[Bug symtab/34464] GCC binaries in -fPIE -ffunction-sections --gc-sections have DWARF subprograms overlapping main, breaking function resolution

tromey at sourceware dot org via Gdb-prs <[email protected]> Thu, 30 Jul 2026 18:37:53 +0000
Newsgroups gmane.comp.gdb.bugs.discuss
Message-ID <[email protected]/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=3D34464

--- Comment #6 from Tom Tromey <tromey at sourceware dot org> ---
(In reply to nyanpasu64 from comment #3)

> Would it suffice to comment on Bug 32506 that the DWARF standard has
> specified in (unreleased) version 6 that GCed functions should have their
> low PC set to -1/0x...FFFF, and it may be worth changing ld to avoid
> ambiguity which has led to three independent bug reports so far?

I can't really speak for binutils but I think a comment to this effect
would be warranted.  If this is how DWARF wants it to work then at
some point someone is going to have to update binutils to do this.

> (We *would*
> have to test for regressions in tooling still, as arithmetic on 0x...FFFF=
 is
> highly prone to integer overflow if not checked. But lld binaries already
> have this behavior, so tools *should* handle it already?)

Who knows, it depends on whether those tools have been tested in this
particular setup, which isn't perhaps extremely common.  Anyway there
was a gdb patch to this effect; though it seems to me that it didn't
cover all the relevant spots, just the line table.

--=20
You are receiving this mail because:
You are on the CC list for the bug.=