mirror of
https://github.com/rui314/mold.git
synced 2024-11-11 16:58:12 +03:00
Revert "Separate relocate() from copy_to()"
This reverts commit 8986a6ad88
.
This commit is contained in:
parent
8986a6ad88
commit
20fc2b427c
@ -21,9 +21,7 @@ void InputSection::copy_to(u8 *buf) {
|
||||
|
||||
ArrayRef<u8> data = check(file->obj.getSectionContents(shdr));
|
||||
memcpy(buf + output_section->shdr.sh_offset + offset, &data[0], data.size());
|
||||
}
|
||||
|
||||
void InputSection::relocate(u8 *buf) {
|
||||
for (int i = 0; i < rels.size(); i++) {
|
||||
const ELF64LE::Rela &rel = rels[i];
|
||||
StringPieceRef &ref = rel_pieces[i];
|
||||
|
5
main.cc
5
main.cc
@ -957,11 +957,6 @@ int main(int argc, char **argv) {
|
||||
for_each(output_chunks, [&](OutputChunk *chunk) { chunk->copy_to(buf); });
|
||||
}
|
||||
|
||||
{
|
||||
MyTimer t("relocate");
|
||||
for_each(output_chunks, [&](OutputChunk *chunk) { chunk->relocate(buf); });
|
||||
}
|
||||
|
||||
// Fill .plt, .got, got.plt and .rela.plt sections
|
||||
{
|
||||
MyTimer t("write_got");
|
||||
|
7
mold.h
7
mold.h
@ -230,7 +230,6 @@ public:
|
||||
InputSection(ObjectFile *file, const ELF64LE::Shdr &shdr, StringRef name);
|
||||
|
||||
void copy_to(u8 *buf);
|
||||
void relocate(u8 *buf);
|
||||
void scan_relocations();
|
||||
|
||||
ObjectFile *file;
|
||||
@ -264,7 +263,6 @@ public:
|
||||
OutputChunk() { shdr.sh_addralign = 1; }
|
||||
|
||||
virtual void copy_to(u8 *buf) {}
|
||||
virtual void relocate(u8 *buf) {}
|
||||
|
||||
StringRef name;
|
||||
int shndx = 0;
|
||||
@ -340,11 +338,6 @@ public:
|
||||
for_each(sections, [&](InputSection *isec) { isec->copy_to(buf); });
|
||||
}
|
||||
|
||||
void relocate(u8 *buf) override {
|
||||
if (shdr.sh_type != llvm::ELF::SHT_NOBITS)
|
||||
for_each(sections, [&](InputSection *isec) { isec->relocate(buf); });
|
||||
}
|
||||
|
||||
bool empty() const {
|
||||
if (!sections.empty())
|
||||
for (InputSection *isec : sections)
|
||||
|
Loading…
Reference in New Issue
Block a user