summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lld/ELF/InputFiles.cpp12
-rw-r--r--lld/ELF/InputSection.cpp9
-rw-r--r--lld/ELF/InputSection.h2
-rw-r--r--lld/ELF/SyntheticSections.cpp4
-rw-r--r--lld/ELF/SyntheticSections.h2
5 files changed, 14 insertions, 15 deletions
diff --git a/lld/ELF/InputFiles.cpp b/lld/ELF/InputFiles.cpp
index 3f7289f410c..ea228bd6cb0 100644
--- a/lld/ELF/InputFiles.cpp
+++ b/lld/ELF/InputFiles.cpp
@@ -454,11 +454,9 @@ InputSectionBase *ObjFile<ELFT>::getRelocTarget(const Elf_Shdr &Sec) {
// Create a regular InputSection class that has the same contents
// as a given section.
-InputSectionBase *toRegularSection(MergeInputSection *Sec) {
- auto *Ret = make<InputSection>(Sec->Flags, Sec->Type, Sec->Alignment,
- Sec->Data, Sec->Name);
- Ret->File = Sec->File;
- return Ret;
+static InputSection *toRegularSection(MergeInputSection *Sec) {
+ return make<InputSection>(Sec->File, Sec->Flags, Sec->Type, Sec->Alignment,
+ Sec->Data, Sec->Name);
}
template <class ELFT>
@@ -983,8 +981,8 @@ static ELFKind getELFKind(MemoryBufferRef MB) {
template <class ELFT> void BinaryFile::parse() {
ArrayRef<uint8_t> Data = toArrayRef(MB.getBuffer());
- auto *Section =
- make<InputSection>(SHF_ALLOC | SHF_WRITE, SHT_PROGBITS, 8, Data, ".data");
+ auto *Section = make<InputSection>(nullptr, SHF_ALLOC | SHF_WRITE,
+ SHT_PROGBITS, 8, Data, ".data");
Sections.push_back(Section);
// For each input file foo that is embedded to a result as a binary
diff --git a/lld/ELF/InputSection.cpp b/lld/ELF/InputSection.cpp
index 078bdb678f0..245dbdd62a5 100644
--- a/lld/ELF/InputSection.cpp
+++ b/lld/ELF/InputSection.cpp
@@ -329,11 +329,12 @@ std::string InputSectionBase::getObjMsg(uint64_t Off) {
.str();
}
-InputSection InputSection::Discarded(0, 0, 0, ArrayRef<uint8_t>(), "");
+InputSection InputSection::Discarded(nullptr, 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)
- : InputSectionBase(nullptr, Flags, Type,
+InputSection::InputSection(InputFile *F, uint64_t Flags, uint32_t Type,
+ uint32_t Alignment, ArrayRef<uint8_t> Data,
+ StringRef Name, Kind K)
+ : InputSectionBase(F, Flags, Type,
/*Entsize*/ 0, /*Link*/ 0, /*Info*/ 0, Alignment, Data,
Name, K) {}
diff --git a/lld/ELF/InputSection.h b/lld/ELF/InputSection.h
index 22829a991ae..bef45fa8405 100644
--- a/lld/ELF/InputSection.h
+++ b/lld/ELF/InputSection.h
@@ -301,7 +301,7 @@ public:
// .eh_frame. It also includes the synthetic sections themselves.
class InputSection : public InputSectionBase {
public:
- InputSection(uint64_t Flags, uint32_t Type, uint32_t Alignment,
+ InputSection(InputFile *F, uint64_t Flags, uint32_t Type, uint32_t Alignment,
ArrayRef<uint8_t> Data, StringRef Name, Kind K = Regular);
template <class ELFT>
InputSection(ObjFile<ELFT> &F, const typename ELFT::Shdr &Header,
diff --git a/lld/ELF/SyntheticSections.cpp b/lld/ELF/SyntheticSections.cpp
index 5538254a145..a5e291b79a4 100644
--- a/lld/ELF/SyntheticSections.cpp
+++ b/lld/ELF/SyntheticSections.cpp
@@ -260,8 +260,8 @@ InputSection *elf::createInterpSection() {
StringRef S = Saver.save(Config->DynamicLinker);
ArrayRef<uint8_t> Contents = {(const uint8_t *)S.data(), S.size() + 1};
- auto *Sec =
- make<InputSection>(SHF_ALLOC, SHT_PROGBITS, 1, Contents, ".interp");
+ auto *Sec = make<InputSection>(nullptr, SHF_ALLOC, SHT_PROGBITS, 1, Contents,
+ ".interp");
Sec->Live = true;
return Sec;
}
diff --git a/lld/ELF/SyntheticSections.h b/lld/ELF/SyntheticSections.h
index ea7a2ca6e7b..a990590513b 100644
--- a/lld/ELF/SyntheticSections.h
+++ b/lld/ELF/SyntheticSections.h
@@ -36,7 +36,7 @@ class SyntheticSection : public InputSection {
public:
SyntheticSection(uint64_t Flags, uint32_t Type, uint32_t Alignment,
StringRef Name)
- : InputSection(Flags, Type, Alignment, {}, Name,
+ : InputSection(nullptr, Flags, Type, Alignment, {}, Name,
InputSectionBase::Synthetic) {
this->Live = true;
}
OpenPOWER on IntegriCloud