[PATCH] D122294: [BOLT] Added R_AARCH64_PREL64 relocation
Alexey Moksyakov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 23 00:22:55 PDT 2022
yavtuk created this revision.
yavtuk added a reviewer: yota9.
Herald added subscribers: ayermolo, kristof.beyls.
Herald added a reviewer: rafauler.
Herald added a reviewer: Amir.
Herald added a reviewer: maksfb.
Herald added a project: All.
yavtuk requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D122294
Files:
bolt/include/bolt/Core/BinaryFunction.h
bolt/lib/Core/Relocation.cpp
Index: bolt/lib/Core/Relocation.cpp
===================================================================
--- bolt/lib/Core/Relocation.cpp
+++ bolt/lib/Core/Relocation.cpp
@@ -75,6 +75,7 @@
case ELF::R_AARCH64_TLSDESC_CALL:
case ELF::R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21:
case ELF::R_AARCH64_PREL32:
+ case ELF::R_AARCH64_PREL64:
case ELF::R_AARCH64_ABS16:
case ELF::R_AARCH64_ABS32:
case ELF::R_AARCH64_ABS64:
@@ -157,6 +158,7 @@
case ELF::R_AARCH64_ABS32:
return 4;
case ELF::R_AARCH64_ABS64:
+ case ELF::R_AARCH64_PREL64:
return 8;
}
}
@@ -246,6 +248,7 @@
case ELF::R_AARCH64_ABS32:
break;
case ELF::R_AARCH64_PREL32:
+ case ELF::R_AARCH64_PREL64:
Value -= PC;
break;
}
@@ -271,6 +274,8 @@
return Contents;
case ELF::R_AARCH64_PREL32:
return static_cast<int64_t>(PC) + SignExtend64<32>(Contents & 0xffffffff);
+ case ELF::R_AARCH64_PREL64:
+ return static_cast<int64_t>(PC) + Contents;
case ELF::R_AARCH64_TLSDESC_CALL:
case ELF::R_AARCH64_JUMP26:
case ELF::R_AARCH64_CALL26:
@@ -493,6 +498,7 @@
case ELF::R_AARCH64_TLSDESC_ADR_PREL21:
case ELF::R_AARCH64_TLSDESC_ADR_PAGE21:
case ELF::R_AARCH64_PREL32:
+ case ELF::R_AARCH64_PREL64:
return true;
}
}
Index: bolt/include/bolt/Core/BinaryFunction.h
===================================================================
--- bolt/include/bolt/Core/BinaryFunction.h
+++ bolt/include/bolt/Core/BinaryFunction.h
@@ -1276,6 +1276,7 @@
case ELF::R_AARCH64_MOVW_UABS_G2:
case ELF::R_AARCH64_MOVW_UABS_G2_NC:
case ELF::R_AARCH64_MOVW_UABS_G3:
+ case ELF::R_AARCH64_PREL64:
Rels[Offset] = Relocation{Offset, Symbol, RelType, Addend, Value};
return;
case ELF::R_AARCH64_CALL26:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D122294.417516.patch
Type: text/x-patch
Size: 1761 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220323/e9a4d2bb/attachment.bin>
More information about the llvm-commits
mailing list