projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[X86] Add support for tbyte memory operand size for Intel-syntax x86 assembly
[oota-llvm.git]
/
include
/
llvm
/
Object
/
RelocVisitor.h
diff --git
a/include/llvm/Object/RelocVisitor.h
b/include/llvm/Object/RelocVisitor.h
index cd1ba639057cf07947a32ca2a1e56089cbed943a..d5e4258cb0a7629631ea58a2af51ecaf7e806aa9 100644
(file)
--- a/
include/llvm/Object/RelocVisitor.h
+++ b/
include/llvm/Object/RelocVisitor.h
@@
-100,9
+100,9
@@
private:
case Triple::mips64:
switch (RelocType) {
case llvm::ELF::R_MIPS_32:
case Triple::mips64:
switch (RelocType) {
case llvm::ELF::R_MIPS_32:
- return visitELF_MIPS_32(R, Value);
+ return visitELF_MIPS
64
_32(R, Value);
case llvm::ELF::R_MIPS_64:
case llvm::ELF::R_MIPS_64:
- return visitELF_MIPS_64(R, Value);
+ return visitELF_MIPS
64
_64(R, Value);
default:
HasError = true;
return RelocToApply();
default:
HasError = true;
return RelocToApply();
@@
-240,16
+240,14
@@
private:
}
int64_t getELFAddend(RelocationRef R) {
}
int64_t getELFAddend(RelocationRef R) {
- const auto *Obj = cast<ELFObjectFileBase>(R.getObjectFile());
- DataRefImpl DRI = R.getRawDataRefImpl();
- ErrorOr<int64_t> AddendOrErr = Obj->getRelocationAddend(DRI);
+ ErrorOr<int64_t> AddendOrErr = ELFRelocationRef(R).getAddend();
if (std::error_code EC = AddendOrErr.getError())
report_fatal_error(EC.message());
return *AddendOrErr;
}
uint8_t getLengthMachO64(RelocationRef R) {
if (std::error_code EC = AddendOrErr.getError())
report_fatal_error(EC.message());
return *AddendOrErr;
}
uint8_t getLengthMachO64(RelocationRef R) {
- const MachOObjectFile *Obj = cast<MachOObjectFile>(R.getObject
File
());
+ const MachOObjectFile *Obj = cast<MachOObjectFile>(R.getObject());
return Obj->getRelocationLength(R.getRawDataRefImpl());
}
return Obj->getRelocationLength(R.getRawDataRefImpl());
}
@@
-267,8
+265,7
@@
private:
}
RelocToApply visitELF_386_PC32(RelocationRef R, uint64_t Value) {
}
RelocToApply visitELF_386_PC32(RelocationRef R, uint64_t Value) {
- uint64_t Address;
- R.getOffset(Address);
+ uint64_t Address = R.getOffset();
return RelocToApply(Value - Address, 4);
}
return RelocToApply(Value - Address, 4);
}
@@
-282,8
+279,7
@@
private:
}
RelocToApply visitELF_X86_64_PC32(RelocationRef R, uint64_t Value) {
int64_t Addend = getELFAddend(R);
}
RelocToApply visitELF_X86_64_PC32(RelocationRef R, uint64_t Value) {
int64_t Addend = getELFAddend(R);
- uint64_t Address;
- R.getOffset(Address);
+ uint64_t Address = R.getOffset();
return RelocToApply(Value + Addend - Address, 4);
}
RelocToApply visitELF_X86_64_32(RelocationRef R, uint64_t Value) {
return RelocToApply(Value + Addend - Address, 4);
}
RelocToApply visitELF_X86_64_32(RelocationRef R, uint64_t Value) {
@@
-317,11
+313,18
@@
private:
/// MIPS ELF
RelocToApply visitELF_MIPS_32(RelocationRef R, uint64_t Value) {
/// MIPS ELF
RelocToApply visitELF_MIPS_32(RelocationRef R, uint64_t Value) {
- uint32_t Res = (Value)&0xFFFFFFFF;
+ uint32_t Res = Value & 0xFFFFFFFF;
+ return RelocToApply(Res, 4);
+ }
+
+ /// MIPS64 ELF
+ RelocToApply visitELF_MIPS64_32(RelocationRef R, uint64_t Value) {
+ int64_t Addend = getELFAddend(R);
+ uint32_t Res = (Value + Addend) & 0xFFFFFFFF;
return RelocToApply(Res, 4);
}
return RelocToApply(Res, 4);
}
- RelocToApply visitELF_MIPS_64(RelocationRef R, uint64_t Value) {
+ RelocToApply visitELF_MIPS
64
_64(RelocationRef R, uint64_t Value) {
int64_t Addend = getELFAddend(R);
uint64_t Res = (Value + Addend);
return RelocToApply(Res, 8);
int64_t Addend = getELFAddend(R);
uint64_t Res = (Value + Addend);
return RelocToApply(Res, 8);