Skip to content

Commit 5ae9faa

Browse files
authored
[Object][x86-64] Add support for R_X86_64_GLOB_DAT relocations. (#103029)
Add support for `R_X86_64_GLOB_DAT` relocations to the relocation resolver. rdar://133510292
1 parent ff12c00 commit 5ae9faa

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

llvm/lib/Object/RelocationResolver.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ static bool supportsX86_64(uint64_t Type) {
4747
case ELF::R_X86_64_PC64:
4848
case ELF::R_X86_64_32:
4949
case ELF::R_X86_64_32S:
50+
case ELF::R_X86_64_GLOB_DAT:
5051
return true;
5152
default:
5253
return false;
@@ -68,6 +69,8 @@ static uint64_t resolveX86_64(uint64_t Type, uint64_t Offset, uint64_t S,
6869
case ELF::R_X86_64_32:
6970
case ELF::R_X86_64_32S:
7071
return (S + Addend) & 0xFFFFFFFF;
72+
case ELF::R_X86_64_GLOB_DAT:
73+
return S;
7174
default:
7275
llvm_unreachable("Invalid relocation type");
7376
}

0 commit comments

Comments
 (0)