1
1
mirror of https://github.com/rui314/mold.git synced 2024-12-29 11:24:36 +03:00

temporary

This commit is contained in:
Rui Ueyama 2020-11-03 20:11:58 +09:00
parent 9e9ddf5a01
commit 445f33203c

23
mold.h
View File

@ -240,8 +240,6 @@ public:
bool is_bss() const { return shdr.sh_type == llvm::ELF::SHT_NOBITS; } bool is_bss() const { return shdr.sh_type == llvm::ELF::SHT_NOBITS; }
virtual u64 get_size() const = 0;
StringRef name; StringRef name;
int shndx = 0; int shndx = 0;
bool starts_new_ptload = false; bool starts_new_ptload = false;
@ -258,8 +256,6 @@ public:
} }
void relocate(u8 *buf) override; void relocate(u8 *buf) override;
u64 get_size() const override { return shdr.sh_size; }
}; };
// Section header // Section header
@ -273,8 +269,6 @@ public:
*p++ = *ent; *p++ = *ent;
} }
u64 get_size() const override { return shdr.sh_size; }
void set_entries(std::vector<ELF64LE::Shdr *> vec) { void set_entries(std::vector<ELF64LE::Shdr *> vec) {
shdr.sh_size = vec.size() * sizeof(ELF64LE::Shdr); shdr.sh_size = vec.size() * sizeof(ELF64LE::Shdr);
entries = std::move(vec); entries = std::move(vec);
@ -289,8 +283,6 @@ public:
OutputPhdr() { shdr.sh_flags = llvm::ELF::SHF_ALLOC; } OutputPhdr() { shdr.sh_flags = llvm::ELF::SHF_ALLOC; }
void relocate(u8 *buf) override; void relocate(u8 *buf) override;
u64 get_size() const override { return shdr.sh_size; }
void construct(std::vector<OutputChunk *> &sections); void construct(std::vector<OutputChunk *> &sections);
private: private:
@ -325,8 +317,6 @@ public:
for_each(sections, [&](InputSection *isec) { isec->relocate(buf); }); for_each(sections, [&](InputSection *isec) { isec->relocate(buf); });
} }
u64 get_size() const override { return shdr.sh_size; }
bool empty() const { bool empty() const {
if (!sections.empty()) if (!sections.empty())
for (InputSection *isec : sections) for (InputSection *isec : sections)
@ -353,8 +343,6 @@ public:
memcpy(buf + shdr.sh_offset, path, sizeof(path)); memcpy(buf + shdr.sh_offset, path, sizeof(path));
} }
u64 get_size() const override { return shdr.sh_size; }
private: private:
static constexpr char path[] = "/lib64/ld-linux-x86-64.so.2"; static constexpr char path[] = "/lib64/ld-linux-x86-64.so.2";
}; };
@ -373,8 +361,6 @@ public:
void relocate(u8 *buf) override; void relocate(u8 *buf) override;
u64 get_size() const override { return shdr.sh_size; }
std::vector<std::pair<Kind, Symbol *>> symbols; std::vector<std::pair<Kind, Symbol *>> symbols;
}; };
@ -389,8 +375,6 @@ public:
void relocate(u8 *buf) override; void relocate(u8 *buf) override;
u64 get_size() const override { return shdr.sh_size; }
std::vector<Symbol *> symbols; std::vector<Symbol *> symbols;
}; };
@ -405,8 +389,6 @@ public:
} }
void relocate(u8 *buf) override; void relocate(u8 *buf) override;
u64 get_size() const override { return shdr.sh_size; }
}; };
class ShstrtabSection : public OutputChunk { class ShstrtabSection : public OutputChunk {
@ -431,8 +413,6 @@ public:
memcpy(buf + shdr.sh_offset, &contents[0], contents.size()); memcpy(buf + shdr.sh_offset, &contents[0], contents.size());
} }
u64 get_size() const override { return shdr.sh_size; }
private: private:
std::string contents; std::string contents;
}; };
@ -447,8 +427,6 @@ public:
shdr.sh_addralign = 8; shdr.sh_addralign = 8;
} }
u64 get_size() const override { return shdr.sh_size; }
private: private:
std::vector<ELF64LE::Sym> contents; std::vector<ELF64LE::Sym> contents;
}; };
@ -461,7 +439,6 @@ public:
shdr.sh_type = llvm::ELF::SHT_STRTAB; shdr.sh_type = llvm::ELF::SHT_STRTAB;
shdr.sh_size = 1; shdr.sh_size = 1;
} }
u64 get_size() const override { return shdr.sh_size; }
}; };
namespace out { namespace out {