[llvm] [BOLT] Update LSDA encoding for x86-64 large code model (PR #190685)
Maksim Panchenko via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 13 13:46:43 PDT 2026
================
@@ -2241,6 +2238,19 @@ Error RewriteInstance::readSpecialSections() {
"Use -update-debug-sections to keep it.\n";
}
+ // Detect large code model by the presence of .ltext sections.
+ if (opts::LargeCodeModel.getNumOccurrences() == 0 &&
+ BC->getUniqueSectionByName(".ltext")) {
+ BC->UseLargeCodeModel = true;
+ }
+
+ // Placed in a separate block so that we can check for it in lit tests
+ if (BC->TheTriple->getArch() == llvm::Triple::x86_64 &&
+ BC->UseLargeCodeModel) {
+ BC->outs() << "BOLT-INFO: large code model detected\n";
+ BC->updateLSDAEncoding();
+ }
----------------
maksfb wrote:
I'm thinking replacing the above with something like:
```
if (opts::LargeCodeModel.getNumOccurrences() == 0 &&
!BC->UseLargeCodeModel &&
BC->getUniqueSectionByName(".ltext")) {
BC->outs() << "BOLT-INFO: .ltext detected - enabling large code model\n";
BC->UseLargeCodeModel = true;
BC->updateLSDAEncoding();
}
https://github.com/llvm/llvm-project/pull/190685
More information about the llvm-commits
mailing list