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

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #3)
> It is not about debug info, but about linker behaving differently if all the
> linked *.o objects don't have the marking they are looking for.
> 
> That is why we e.g. copy over .note.GNU-stack section, or .note.gnu.property.
> E.g. if we didn't copy .note.GNU-stack, the linked binary would be marked as
> (potentially) having executable stack because we couldn't prove otherwise
> (because *.debug.temp.o files wouldn't tell).

Oh, I see.  Then that looks OK.  I wonder if there's any good target hook
(from common/) that we could use to make this more accessible.

> Note, while I've tested the patch on x86_64-linux and i686-linux so far
> (where it doesn't break anything, quite obviously) and bootstrapped on
> aarch64-linux, I'm still in make check there and only when that is over will
> test whether it fixed the actual problem (that -flto -g compiled/linked
> binaries don't have the expected features).

Adding a testcase should be possible (would fail only with new binutils, but
still)?

Reply via email to