https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123439
Taylor Hutt <taylor.hutt at broadcom dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|DUPLICATE |---
Status|RESOLVED |UNCONFIRMED
--- Comment #4 from Taylor Hutt <taylor.hutt at broadcom dot com> ---
(In reply to Andrew Pinski from comment #3)
> Not a GCC bug, a dup of bug 59842 which points to the 2 binutils issues.
>
> *** This bug has been marked as a duplicate of bug 59842 ***
I don't think this analysis is correct. The thunks come through the objcopy,
and the symbols are not being discarded.
nm launch.c.o
00000000 T external
U _GLOBAL_OFFSET_TABLE_
00000006 T internal
00000000 T __x86.get_pc_thunk.bx
nm launch.demoted.o
00000000 t external
U _GLOBAL_OFFSET_TABLE_
00000006 t internal
00000000 t __x86.get_pc_thunk.bx
(It's now a local symbol, but not removed)
If there is supposed to be special handling in the linker script for comdat,
please elucidate rather than ignoring the question and closing the ticket as a
duplicate.
> Really the code should move over to a versioning script instead of
> using objcopy and that would work much better and be slightly more portable.
In the ticket you used as the duplicate close target, you said the above. But,
the purpose of the objcopy here is only to demote symbols from being public to
being private. Without doing this step, the public symbols in the enclave can
conflict with the loader, causing different link errors.
But, what do you mean by 'versioning script'?
Allow me to reopen to hopefully make progress on understanding how to address
this issue or the issue why there is a change in behavior between gcc9 and 15.
If there are special linker script commands to create an output section that
would subsume the thunks, I'd be happy to learn about it; I've been
unsuccessful in doing that.