[lld] [LLD][ELF][AArch64] Add BTI Aware long branch thunks (PR #108989)

Peter Smith via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 26 08:23:27 PDT 2024


================
@@ -578,6 +622,48 @@ void AArch64ADRPThunk::addSymbols(ThunkSection &isec) {
   addSymbol("$x", STT_NOTYPE, 0, isec);
 }
 
+void AArch64BTILandingPadThunk::addSymbols(ThunkSection &isec) {
+  addSymbol(saver().save("__AArch64BTIThunk_" + destination.getName()),
+            STT_FUNC, 0, isec);
+  addSymbol("$x", STT_NOTYPE, 0, isec);
+}
+
+InputSection *AArch64BTILandingPadThunk::getTargetInputSection() const {
----------------
smithp35 wrote:

It is called in `mergeCmp()` but I've removed it anyway as it is not a strict requirement that the landing pads are before the target section, they just need to be within direct branch range. 

https://github.com/llvm/llvm-project/pull/108989


More information about the llvm-commits mailing list