mirror of
https://github.com/rui314/mold.git
synced 2024-12-27 10:23:41 +03:00
temporary
This commit is contained in:
parent
2306bf0f92
commit
a6959d81e7
13
mold.h
13
mold.h
@ -952,17 +952,20 @@ struct ComdatGroup {
|
|||||||
class InputFile {
|
class InputFile {
|
||||||
public:
|
public:
|
||||||
InputFile(MemoryMappedFile mb, bool is_dso)
|
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();
|
elf_sections = obj.get_sections();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MemoryMappedFile mb;
|
||||||
|
ElfFile obj;
|
||||||
|
ElfEhdr &ehdr;
|
||||||
|
std::span<ElfShdr> elf_sections;
|
||||||
|
std::vector<Symbol *> symbols;
|
||||||
|
|
||||||
std::string name;
|
std::string name;
|
||||||
bool is_dso;
|
bool is_dso;
|
||||||
u32 priority;
|
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::atomic_bool is_alive = ATOMIC_VAR_INIT(false);
|
||||||
|
|
||||||
std::string_view get_section_name(const ElfShdr &shdr) const {
|
std::string_view get_section_name(const ElfShdr &shdr) const {
|
||||||
|
@ -69,7 +69,8 @@ void ObjectFile::initialize_sections() {
|
|||||||
static Counter counter("regular_sections");
|
static Counter counter("regular_sections");
|
||||||
counter.inc();
|
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);
|
this->sections[i] = new InputSection(this, shdr, name);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user