diff --git a/lld/ELF/InputSection.cpp b/lld/ELF/InputSection.cpp index 60b421c0c6a0..c9d70ac6215d 100644 --- a/lld/ELF/InputSection.cpp +++ b/lld/ELF/InputSection.cpp @@ -101,7 +101,6 @@ uint64_t InputSectionBase::getOffset() const { template uint64_t InputSectionBase::getOffset(uint64_t Offset) const { - typedef typename ELFT::uint uintX_t; switch (kind()) { case Regular: return cast(this)->OutSecOff + Offset; @@ -109,7 +108,7 @@ uint64_t InputSectionBase::getOffset(uint64_t Offset) const { // For synthetic sections we treat offset -1 as the end of the section. // The same approach is used for synthetic symbols (DefinedSynthetic). return cast(this)->OutSecOff + - (Offset == uintX_t(-1) ? getSize() : Offset); + (Offset == uint64_t(-1) ? getSize() : Offset); case EHFrame: // The file crtbeginT.o has relocations pointing to the start of an empty // .eh_frame that is known to be the first in the link. It does that to diff --git a/lld/ELF/Symbols.cpp b/lld/ELF/Symbols.cpp index 217e5ff1682e..390fa684c3f6 100644 --- a/lld/ELF/Symbols.cpp +++ b/lld/ELF/Symbols.cpp @@ -42,15 +42,13 @@ DefinedRegular *ElfSym::MipsGp; template static typename ELFT::uint getSymVA(const SymbolBody &Body, int64_t &Addend) { - typedef typename ELFT::uint uintX_t; - switch (Body.kind()) { case SymbolBody::DefinedSyntheticKind: { auto &D = cast(Body); const OutputSection *Sec = D.Section; if (!Sec) return D.Value; - if (D.Value == uintX_t(-1)) + if (D.Value == uint64_t(-1)) return Sec->Addr + Sec->Size; return Sec->Addr + D.Value; } @@ -99,7 +97,7 @@ static typename ELFT::uint getSymVA(const SymbolBody &Body, int64_t &Addend) { // If you understand the data structures involved with this next // line (and how they get built), then you have a pretty good // understanding of the linker. - uintX_t VA = (OutSec ? OutSec->Addr : 0) + IS->getOffset(Offset); + uint64_t VA = (OutSec ? OutSec->Addr : 0) + IS->getOffset(Offset); if (D.isTls() && !Config->Relocatable) { if (!Out::TlsPhdr) diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp index 6e6f39de39a6..a548ca5cf605 100644 --- a/lld/ELF/Writer.cpp +++ b/lld/ELF/Writer.cpp @@ -734,9 +734,9 @@ void PhdrEntry::add(OutputSection *Sec) { } template -static DefinedSynthetic * -addOptionalSynthetic(StringRef Name, OutputSection *Sec, - typename ELFT::uint Val, uint8_t StOther = STV_HIDDEN) { +static DefinedSynthetic *addOptionalSynthetic(StringRef Name, + OutputSection *Sec, uint64_t Val, + uint8_t StOther = STV_HIDDEN) { if (SymbolBody *S = Symtab::X->find(Name)) if (!S->isInCurrentDSO()) return cast( @@ -756,7 +756,7 @@ static Symbol *addRegular(StringRef Name, InputSectionBase *Sec, template static Symbol *addOptionalRegular(StringRef Name, InputSectionBase *IS, - typename ELFT::uint Value) { + uint64_t Value) { SymbolBody *S = Symtab::X->find(Name); if (!S) return nullptr;