1
1
mirror of https://github.com/rui314/mold.git synced 2024-09-22 18:40:59 +03:00

temporary

This commit is contained in:
Rui Ueyama 2020-11-13 19:47:57 +09:00
parent 26fdb98827
commit c7769d3766
3 changed files with 5 additions and 15 deletions

View File

@ -131,12 +131,8 @@ void InputSection::scan_relocations() {
sym->file->dynstr_size += sym->name.size() + 1;
}
if (sym->type == STT_GNU_IFUNC && set_flag(sym, Symbol::NEEDS_IFUNC) &&
set_flag(sym, Symbol::NEEDS_PLT)) {
if (sym->type == STT_GNU_IFUNC && set_flag(sym, Symbol::NEEDS_PLT))
sym->file->num_plt++;
sym->file->num_gotplt++;
sym->file->num_relplt++;
}
switch (rel.getType(false)) {
case R_X86_64_GOT32:
@ -158,11 +154,8 @@ void InputSection::scan_relocations() {
case R_X86_64_PLT32:
if (config.is_static)
break;
if (set_flag(sym, Symbol::NEEDS_PLT)) {
if (set_flag(sym, Symbol::NEEDS_PLT))
sym->file->num_plt++;
sym->file->num_gotplt++;
sym->file->num_relplt++;
}
break;
}
}

View File

@ -340,13 +340,13 @@ static void scan_rels(ArrayRef<ObjectFile *> files) {
out::got->shdr.sh_size += file->num_got * GOT_SIZE;
file->gotplt_offset = out::gotplt->shdr.sh_size;
out::gotplt->shdr.sh_size += file->num_gotplt * GOT_SIZE;
out::gotplt->shdr.sh_size += file->num_plt * GOT_SIZE;
file->plt_offset = out::plt->shdr.sh_size;
out::plt->shdr.sh_size += file->num_plt * PLT_SIZE;
file->relplt_offset = out::relplt->shdr.sh_size;
out::relplt->shdr.sh_size += file->num_relplt * sizeof(ELF64LE::Rela);
out::relplt->shdr.sh_size += file->num_plt * sizeof(ELF64LE::Rela);
if (out::dynsym) {
file->dynsym_offset = out::dynsym->shdr.sh_size;

5
mold.h
View File

@ -216,7 +216,6 @@ public:
NEEDS_GOTTP = 1 << 1,
NEEDS_PLT = 1 << 2,
NEEDS_DYNSYM = 1 << 3,
NEEDS_IFUNC = 1 << 4,
};
std::atomic_uint8_t flags = ATOMIC_VAR_INIT(0);
@ -589,10 +588,8 @@ public:
u64 global_symtab_size = 0;
u64 global_strtab_size = 0;
std::atomic_uint32_t num_plt = ATOMIC_VAR_INIT(0);
std::atomic_uint32_t num_got = ATOMIC_VAR_INIT(0);
std::atomic_uint32_t num_gotplt = ATOMIC_VAR_INIT(0);
std::atomic_uint32_t num_relplt = ATOMIC_VAR_INIT(0);
std::atomic_uint32_t num_plt = ATOMIC_VAR_INIT(0);
std::atomic_uint32_t num_dynsym = ATOMIC_VAR_INIT(0);
std::atomic_uint32_t dynstr_size = ATOMIC_VAR_INIT(0);