You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ CXX=$(which clang++) LD=bfd make test -B # ok
$ CXX=$(which clang++) LD=gold make test -B # ok
$ CXX=$(which clang++) LD=lld make test -B # BROKEN
$ CXX=$(which g++) LD=bfd make test -B # ok
$ CXX=$(which g++) LD=gold make test -B # ok
$ CXX=$(which g++) LD=lld make test -B # BROKEN
ld.lld's behavior is different from GNU ld and gold, but the behavior is still correct (it improves text section compressing). .custom has a dynamic relocation. After rtld applies the relocation, the location in .custom will point to the string literal. See https://maskray.me/blog/2020-12-19-lld-and-gnu-linker-incompatibilities--apply-dynamic-relocs
My application stores a pointer to a string in a custom ELF section. LLD leaves the pointer 0, while other linkers set it correctly.
Minimal repro:
combined with:
Test cases:
Example good output:
Example bad output:
Versions:
The text was updated successfully, but these errors were encountered: