Skip to content
This repository has been archived by the owner on Jul 1, 2023. It is now read-only.

Commit

Permalink
[BOLT] Handle R_X86_64_64 in flushPendingRelocations
Browse files Browse the repository at this point in the history
Summary:
Handle R_X86_64_64 the same way as R_X86_64_32;
`getSizeForType` takes care of the size:

```x86_64 ABI relocation types
Name        Value Field  Calculation
R_X86_64_64 1     word64 S + A
R_X86_64_32 10    word32 S + A
```
  • Loading branch information
aaupov committed Jun 25, 2021
1 parent c816a19 commit 88f11f4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions bolt/src/BinarySection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,9 @@ void BinarySection::flushPendingRelocations(raw_pwrite_stream &OS,
Value += Resolver(Reloc.Symbol);
switch(Reloc.Type) {
default:
llvm_unreachable(
"only R_X86_64_32 relocations are supported at the moment");
LLVM_DEBUG(dbgs() << Reloc.Type << '\n';);
llvm_unreachable("unhandled relocation type");
case ELF::R_X86_64_64:
case ELF::R_X86_64_32: {
OS.pwrite(reinterpret_cast<const char*>(&Value),
Relocation::getSizeForType(Reloc.Type),
Expand Down

0 comments on commit 88f11f4

Please sign in to comment.