New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lld error "undefined symbol: _GLOBAL_OFFSET_TABLE_ " with LTO #61101
Labels
LTO
Link time optimization (regular/full LTO or ThinLTO)
Comments
EugeneZelenko
added
LTO
Link time optimization (regular/full LTO or ThinLTO)
and removed
new issue
labels
Mar 1, 2023
Related to #38982 |
AngryLoki
added a commit
to AngryLoki/gentoo
that referenced
this issue
Mar 20, 2024
Changes since 5.7.2: * Added patch for new issue ROCm/rocWMMA#360 * Disabled LTO due to llvm/llvm-project#61101 Signed-off-by: Sv. Lockal <lockalsash@gmail.com>
AngryLoki
added a commit
to AngryLoki/gentoo
that referenced
this issue
Mar 23, 2024
Changes since 5.7.2: * Added patch for new issue ROCm/rocWMMA#360 * Disabled LTO due to llvm/llvm-project#61101 Signed-off-by: Sv. Lockal <lockalsash@gmail.com>
AngryLoki
added a commit
to AngryLoki/gentoo
that referenced
this issue
Mar 26, 2024
Changes since 5.7.2: * Added patch for new issue ROCm/rocWMMA#360 * Disabled LTO due to llvm/llvm-project#61101 Signed-off-by: Sv. Lockal <lockalsash@gmail.com>
AngryLoki
added a commit
to AngryLoki/gentoo
that referenced
this issue
Mar 30, 2024
Changes since 5.7.2: * Added patch for new issue ROCm/rocWMMA#360 * Disabled LTO due to llvm/llvm-project#61101 Signed-off-by: Sv. Lockal <lockalsash@gmail.com>
similar repro with x86-64 (medium code model with 0 large data threshold uses the GOT as the base register to address globals):
|
I can take this. I think the best workaround is to synthesize a |
MaskRay
added a commit
that referenced
this issue
Apr 24, 2024
In ELF, relocatable files generated for x86-32 and some code models of x86-64 (medium, large) may reference the special symbol `_GLOBAL_OFFSET_TABLE_` that is not used in the IR. In an LTO link, if there is no regular relocatable file referencing the special symbol, the linker may not define the symbol and lead to a spurious "undefined symbol" error. Fix #61101: record that `_GLOBAL_OFFSET_TABLE_` is used in the IR symbol table. Note: The `PreservedSymbols` mechanism (https://reviews.llvm.org/D112595) that just sets `FB_used` is not applicable. The `getRuntimeLibcallSymbols` for extracting lazy runtime library symbols is for symbols that are "always" potentially used, but linkers don't have the code model information to make a precise decision. Pull Request: #89463
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The following test file fails with LTO when compiled for x86. Other arches or bfd don't seem to exhibit this.
The text was updated successfully, but these errors were encountered: