[llvm] [Object][x86-64] Add support for `R_X86_64_GLOB_DAT` relocations. (PR #103029)
Alastair Houghton via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 13 02:20:14 PDT 2024
https://github.com/al45tair created https://github.com/llvm/llvm-project/pull/103029
Add support for `R_X86_64_GLOB_DAT` relocations to the relocation resolver.
rdar://133510292
>From 4a84199b3c262e3643cfcfc0cdf9a41c902a9b23 Mon Sep 17 00:00:00 2001
From: Alastair Houghton <ahoughton at apple.com>
Date: Tue, 13 Aug 2024 10:11:16 +0100
Subject: [PATCH] [Object][x86-64] Add support for `R_X86_64_GLOB_DAT`
relocations.
Add support for `R_X86_64_GLOB_DAT` relocations to the relocation
resolver.
rdar://133510292
---
llvm/lib/Object/RelocationResolver.cpp | 3 +++
1 file changed, 3 insertions(+)
diff --git a/llvm/lib/Object/RelocationResolver.cpp b/llvm/lib/Object/RelocationResolver.cpp
index d9bb8f175ef83a..7f90834c3d2199 100644
--- a/llvm/lib/Object/RelocationResolver.cpp
+++ b/llvm/lib/Object/RelocationResolver.cpp
@@ -47,6 +47,7 @@ static bool supportsX86_64(uint64_t Type) {
case ELF::R_X86_64_PC64:
case ELF::R_X86_64_32:
case ELF::R_X86_64_32S:
+ case ELF::R_X86_64_GLOB_DAT:
return true;
default:
return false;
@@ -68,6 +69,8 @@ static uint64_t resolveX86_64(uint64_t Type, uint64_t Offset, uint64_t S,
case ELF::R_X86_64_32:
case ELF::R_X86_64_32S:
return (S + Addend) & 0xFFFFFFFF;
+ case ELF::R_X86_64_GLOB_DAT:
+ return S;
default:
llvm_unreachable("Invalid relocation type");
}
More information about the llvm-commits
mailing list