1
1
mirror of https://github.com/rui314/mold.git synced 2024-09-20 01:18:53 +03:00
mold/output_sections.cc
2020-10-20 15:04:18 +09:00

18 lines
410 B
C++

#include "chibild.h"
OutputSection::OutputSection(StringRef name) : name(name) {}
uint64_t OutputSection::get_on_file_size() const {
assert(on_file_size >= 0);
return on_file_size;
}
void OutputSection::set_file_offset(uint64_t off) {
uint64_t orig = off;
for (InputSection *sec : sections) {
sec->output_file_offset = off;
off += sec->get_on_file_size();
}
on_file_size = off - orig;
}