1
1
mirror of https://github.com/rui314/mold.git synced 2024-09-23 02:49:12 +03:00
mold/input_sections.cc
2020-10-20 15:04:18 +09:00

16 lines
390 B
C++

#include "chibild.h"
InputSection::InputSection(ObjectFile *file, const ELF64LE::Shdr *hdr, StringRef name)
: file(file), hdr(hdr) {
this->name = name;
}
uint64_t InputSection::get_size() const {
return hdr->sh_size;
}
void InputSection::copy_to(uint8_t *buf) {
ArrayRef<uint8_t> data = check(file->obj.getSectionContents(*hdr));
memcpy(buf + offset, &data[0], data.size());
}