mirror of
https://github.com/intel/llvm.git
synced 2026-01-26 12:26:52 +08:00
Replace uintX_t with uint64_t.
We generally want to use uint64_t instead of uintX_t if the 64-bit type works for both 32-bit and 64-bit because it is simpler than the variable-size type. llvm-svn: 300293
This commit is contained in:
@@ -551,7 +551,6 @@ getRelocTargetVA(uint32_t Type, int64_t A, typename ELFT::uint P,
|
||||
// function as a performance optimization.
|
||||
template <class ELFT, class RelTy>
|
||||
void InputSection::relocateNonAlloc(uint8_t *Buf, ArrayRef<RelTy> Rels) {
|
||||
typedef typename ELFT::uint uintX_t;
|
||||
for (const RelTy &Rel : Rels) {
|
||||
uint32_t Type = Rel.getType(Config->IsMips64EL);
|
||||
uint64_t Offset = getOffset(Rel.r_offset);
|
||||
@@ -569,10 +568,10 @@ void InputSection::relocateNonAlloc(uint8_t *Buf, ArrayRef<RelTy> Rels) {
|
||||
return;
|
||||
}
|
||||
|
||||
uintX_t AddrLoc = this->OutSec->Addr + Offset;
|
||||
uint64_t AddrLoc = this->OutSec->Addr + Offset;
|
||||
uint64_t SymVA = 0;
|
||||
if (!Sym.isTls() || Out::TlsPhdr)
|
||||
SymVA = SignExtend64<sizeof(uintX_t) * 8>(
|
||||
SymVA = SignExtend64<sizeof(typename ELFT::uint) * 8>(
|
||||
getRelocTargetVA<ELFT>(Type, Addend, AddrLoc, Sym, R_ABS));
|
||||
Target->relocateOne(BufLoc, Type, SymVA);
|
||||
}
|
||||
@@ -596,14 +595,13 @@ void InputSectionBase::relocate(uint8_t *Buf, uint8_t *BufEnd) {
|
||||
return;
|
||||
}
|
||||
|
||||
typedef typename ELFT::uint uintX_t;
|
||||
const unsigned Bits = sizeof(uintX_t) * 8;
|
||||
const unsigned Bits = sizeof(typename ELFT::uint) * 8;
|
||||
for (const Relocation &Rel : Relocations) {
|
||||
uint64_t Offset = getOffset(Rel.Offset);
|
||||
uint8_t *BufLoc = Buf + Offset;
|
||||
uint32_t Type = Rel.Type;
|
||||
|
||||
uintX_t AddrLoc = getOutputSection()->Addr + Offset;
|
||||
uint64_t AddrLoc = getOutputSection()->Addr + Offset;
|
||||
RelExpr Expr = Rel.Expr;
|
||||
uint64_t TargetVA = SignExtend64<Bits>(
|
||||
getRelocTargetVA<ELFT>(Type, Rel.Addend, AddrLoc, *Rel.Sym, Expr));
|
||||
|
||||
Reference in New Issue
Block a user