forked from OSchip/llvm-project
Fix the type of the Discared section.
It is constructed with a kind of Regular and will dyn_cast to InputSection, but is declared to be an InputSectionBase. llvm-svn: 320539
This commit is contained in:
parent
ecb48e523e
commit
b01cd86458
|
@ -323,7 +323,7 @@ std::string InputSectionBase::getObjMsg(uint64_t Off) {
|
|||
.str();
|
||||
}
|
||||
|
||||
InputSectionBase InputSectionBase::Discarded;
|
||||
InputSection InputSection::Discarded(0, 0, 0, ArrayRef<uint8_t>(), "");
|
||||
|
||||
InputSection::InputSection(uint64_t Flags, uint32_t Type, uint32_t Alignment,
|
||||
ArrayRef<uint8_t> Data, StringRef Name, Kind K)
|
||||
|
|
|
@ -85,12 +85,6 @@ protected:
|
|||
// This corresponds to a section of an input file.
|
||||
class InputSectionBase : public SectionBase {
|
||||
public:
|
||||
InputSectionBase()
|
||||
: SectionBase(Regular, "", /*Flags*/ 0, /*Entsize*/ 0, /*Alignment*/ 0,
|
||||
/*Type*/ 0,
|
||||
/*Info*/ 0, /*Link*/ 0),
|
||||
NumRelocations(0), AreRelocsRela(false), Repl(this) {}
|
||||
|
||||
template <class ELFT>
|
||||
InputSectionBase(ObjFile<ELFT> *File, const typename ELFT::Shdr *Header,
|
||||
StringRef Name, Kind SectionKind);
|
||||
|
@ -114,8 +108,6 @@ public:
|
|||
ArrayRef<uint8_t> Data;
|
||||
uint64_t getOffsetInFile() const;
|
||||
|
||||
static InputSectionBase Discarded;
|
||||
|
||||
// True if this section has already been placed to a linker script
|
||||
// output section. This is needed because, in a linker script, you
|
||||
// can refer to the same section more than once. For example, in
|
||||
|
@ -337,6 +329,8 @@ public:
|
|||
// Called by ICF to merge two input sections.
|
||||
void replace(InputSection *Other);
|
||||
|
||||
static InputSection Discarded;
|
||||
|
||||
private:
|
||||
template <class ELFT, class RelTy>
|
||||
void copyRelocations(uint8_t *Buf, llvm::ArrayRef<RelTy> Rels);
|
||||
|
|
Loading…
Reference in New Issue