[lld] [lld][ARM] Fix assertion when mixing ARM and Thumb objects (PR #101985)
Peter Smith via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 5 09:29:25 PDT 2024
================
@@ -1886,6 +1887,14 @@ static void setConfigs(opt::InputArgList &args) {
}
}
+// Initialise config options which depend on information previously parsed from
+// input files, such as Arm build attributes.
+static void setConfigsPostParse() {
----------------
smithp35 wrote:
Given that `config->armThumbPLTs` is only used within Arch/ARM.cpp and it is made up of only two booleans we could remove `config->armThumbPLTs` , this function and in Arch/ARM.cpp replace config->armThumbPLTs` with a function call to
```
static bool hasThumbPLT() {
return config->armHasThumb2ISA && !config->armHasArmISA;
}
```
The other bit of prior art we have in this area is the decision to write PAC/BTI PLT sequences. For that we had to delay until all the input objects had been written to. That ended up being done in a target specific `getAArch64TargetInfo()` but there is also `getARMTargetInfo()` that could be used.
https://github.com/llvm/llvm-project/pull/101985
More information about the llvm-commits
mailing list