RFR: 8336849: Remove .llvm_addrsig section from JDK/VM static libraries (.a files)
Jiangli Zhou
jiangli at openjdk.org
Mon Jul 22 17:51:31 UTC 2024
On Mon, 22 Jul 2024 12:15:59 GMT, Julian Waters <jwaters at openjdk.org> wrote:
> This seems odd, since I recall Magnus forcing the JDK to use lld when clang is the compiler, so ld being invoked seems strange to me. Does this still happen with lld?
The issue occurs with clang linker `lld` during linking executable using `.a` static libraries created using `ld -r`. There are two different linking phases involved:
1) Create `.a` static libraries using `ld -r`. I only tested with clang linker `lld` for this issue.
2) Create executable using the `.a` libraries created by above step (or/and created using `objcopy`). I only tested with clang linker `lld`.
As the short summary described in https://bugs.openjdk.org/browse/JDK-8336849, the specific issue is:
The `-Wl,--icf=safe` linker option cannot work well with binaries created using `ld -r` or `objcopy`. `--icf=safe` uses `.llvm_addrsig` section, which contains symbol indexes and `ld -r` or `objcopy` may change the the symbol table. That causes the linker errors referenced above.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/20265#issuecomment-2243496659
More information about the build-dev
mailing list