diff --git a/bolt/include/bolt/Core/BinaryFunction.h b/bolt/include/bolt/Core/BinaryFunction.h --- a/bolt/include/bolt/Core/BinaryFunction.h +++ b/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: diff --git a/bolt/lib/Core/Relocation.cpp b/bolt/lib/Core/Relocation.cpp --- a/bolt/lib/Core/Relocation.cpp +++ b/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(PC) + SignExtend64<32>(Contents & 0xffffffff); + case ELF::R_AARCH64_PREL64: + return static_cast(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; } }