https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96385

--- Comment #14 from Richard Biener <rguenth at gcc dot gnu.org> ---
Note the symbol table entry should be "unused" (if there's anything like that).
At least ld usually treats it like so.  IIRC I left those dangling because
UNDEFs into the copied .debug_info section are bogus - and I did not want to
parse relocation sections to see where it is referenced from (otherwise I'd
assert for such UNDEFs).

I know it's all a bit awkward but originally this was supposed to be
a temporary measure until ld + plugin API understands how to only
partly claim an object and make ld link the original .gnu.debuglto_
prefixed debug-info sections unchanged into the final object ...

So you basically found a case where ld does _not_ treat the UNDEF as "unused".
In case that is not a bug in ld I am not really understanding how the bug
manifests which means I have a hard time creating a testcase for GCCs
LTO testsuite :/

Now the patch itself should be quite safe (we shouldn't be left with any
global UNDEFs).  But I'm curious if it resolves a "real" bug...

Reply via email to