mirror of
https://github.com/rui314/mold.git
synced 2024-11-10 10:57:55 +03:00
temporary
This commit is contained in:
parent
09c8d598c9
commit
2b974da232
@ -176,10 +176,11 @@ class InputSection : public InputChunk {
|
||||
public:
|
||||
InputSection(ObjectFile *file, const ELF64LE::Shdr *hdr, StringRef name);
|
||||
void copy_to(uint8_t *buf) override;
|
||||
void relocate(uint8_t *buf) override {}
|
||||
void relocate(uint8_t *buf) override;
|
||||
uint64_t get_size() const;
|
||||
|
||||
ObjectFile *file;
|
||||
ArrayRef<ELF64LE::Rela> rels;
|
||||
OutputSection *output_section;
|
||||
StringRef output_section_name;
|
||||
int64_t offset = -1;
|
||||
|
@ -76,6 +76,20 @@ void ObjectFile::initialize_sections() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < elf_sections.size(); i++) {
|
||||
const ELF64LE::Shdr &shdr = elf_sections[i];
|
||||
if (shdr.sh_type != SHT_RELA)
|
||||
continue;
|
||||
|
||||
if (shdr.sh_info >= sections.size())
|
||||
error(toString(this) + ": invalid relocated section index: " +
|
||||
Twine(shdr.sh_info));
|
||||
|
||||
InputSection *target = sections[shdr.sh_info];
|
||||
if (target)
|
||||
target->rels = CHECK(obj.relas(shdr), this);
|
||||
}
|
||||
}
|
||||
|
||||
void ObjectFile::initialize_symbols() {
|
||||
|
@ -45,6 +45,11 @@ void InputSection::copy_to(uint8_t *buf) {
|
||||
memcpy(buf + offset, &data[0], data.size());
|
||||
}
|
||||
|
||||
void InputSection::relocate(uint8_t *buf) {
|
||||
if (hdr->sh_type == SHT_NOBITS || hdr->sh_size == 0)
|
||||
return;
|
||||
}
|
||||
|
||||
std::string toString(InputSection *isec) {
|
||||
return (toString(isec->file) + ":(" + isec->name + ")").str();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user