diff --git a/include/llvm/MC/MCAssembler.h b/include/llvm/MC/MCAssembler.h index 0fb3a8ce2d0..16c527ffc16 100644 --- a/include/llvm/MC/MCAssembler.h +++ b/include/llvm/MC/MCAssembler.h @@ -476,8 +476,6 @@ public: unsigned getLayoutOrder() const { return LayoutOrder; } void setLayoutOrder(unsigned Value) { LayoutOrder = Value; } - uint64_t getAddress() const { return Address; } - /// @name Fragment Access /// @{ diff --git a/lib/MC/ELFObjectWriter.cpp b/lib/MC/ELFObjectWriter.cpp index 1fc844cc4a2..bd6c5f85499 100644 --- a/lib/MC/ELFObjectWriter.cpp +++ b/lib/MC/ELFObjectWriter.cpp @@ -1285,7 +1285,7 @@ void ELFObjectWriter::WriteSection(MCAssembler &Asm, } static bool IsELFMetaDataSection(const MCSectionData &SD) { - return SD.getAddress() == ~UINT64_C(0) && + return SD.getOrdinal() == ~UINT32_C(0) && !SD.getSection().isVirtualSection(); } diff --git a/lib/MC/MCAssembler.cpp b/lib/MC/MCAssembler.cpp index c4e775e2c94..ac0f31f79eb 100644 --- a/lib/MC/MCAssembler.cpp +++ b/lib/MC/MCAssembler.cpp @@ -218,6 +218,7 @@ MCSectionData::MCSectionData() : Section(0) {} MCSectionData::MCSectionData(const MCSection &_Section, MCAssembler *A) : Section(&_Section), + Ordinal(~UINT32_C(0)), Alignment(1), Address(~UINT64_C(0)), HasInstructions(false)