1
1
mirror of https://github.com/rui314/mold.git synced 2024-12-26 01:44:29 +03:00

temporary

This commit is contained in:
Rui Ueyama 2020-12-12 12:41:09 +09:00
parent 2306bf0f92
commit a6959d81e7
2 changed files with 10 additions and 6 deletions

13
mold.h
View File

@ -952,17 +952,20 @@ struct ComdatGroup {
class InputFile {
public:
InputFile(MemoryMappedFile mb, bool is_dso)
: mb(mb), name(mb.name), is_dso(is_dso), obj(mb) {
: mb(mb), name(mb.name), is_dso(is_dso), obj(mb),
ehdr(*(ElfEhdr *)mb.data) {
elf_sections = obj.get_sections();
}
MemoryMappedFile mb;
ElfFile obj;
ElfEhdr &ehdr;
std::span<ElfShdr> elf_sections;
std::vector<Symbol *> symbols;
std::string name;
bool is_dso;
u32 priority;
MemoryMappedFile mb;
ElfFile obj;
std::span<ElfShdr> elf_sections;
std::vector<Symbol *> symbols;
std::atomic_bool is_alive = ATOMIC_VAR_INIT(false);
std::string_view get_section_name(const ElfShdr &shdr) const {

View File

@ -69,7 +69,8 @@ void ObjectFile::initialize_sections() {
static Counter counter("regular_sections");
counter.inc();
std::string_view name = get_section_name(shdr);
std::string_view shstrtab = get_string(ehdr.e_shstrndx);
std::string_view name = shstrtab.data() + shdr.sh_name;
this->sections[i] = new InputSection(this, shdr, name);
break;
}