1
1
mirror of https://github.com/rui314/mold.git synced 2024-11-11 05:46:58 +03:00

temporary

This commit is contained in:
Rui Ueyama 2021-01-11 14:47:06 +09:00
parent a0512c2ed4
commit ffbe2265d5
4 changed files with 11 additions and 11 deletions

View File

@ -298,7 +298,7 @@ void InputSection::scan_relocations() {
case R_X86_64_PC64:
rel_types[i] = R_PC;
if (sym.is_imported) {
if (sym.type == STT_OBJECT)
if (sym.st_type == STT_OBJECT)
sym.flags |= NEEDS_COPYREL;
else
sym.flags |= NEEDS_PLT;
@ -319,7 +319,7 @@ void InputSection::scan_relocations() {
sym.flags |= NEEDS_GOT;
break;
case R_X86_64_PLT32:
if (sym.is_imported || sym.type == STT_GNU_IFUNC) {
if (sym.is_imported || sym.st_type == STT_GNU_IFUNC) {
rel_types[i] = R_PLT;
sym.flags |= NEEDS_PLT;
} else {

6
mold.h
View File

@ -242,6 +242,9 @@ public:
u16 shndx = 0;
u16 ver_idx = 0;
std::atomic_uint8_t flags = 0;
u8 st_type = STT_NOTYPE;
tbb::spin_mutex mu;
u8 is_placeholder : 1 = false;
@ -250,9 +253,6 @@ public:
u8 is_undef_weak : 1 = false;
u8 write_symtab : 1 = false;
u8 traced : 1 = false;
std::atomic_uint8_t flags = 0;
u8 type = STT_NOTYPE;
};
//

View File

@ -211,7 +211,7 @@ void ObjectFile::initialize_symbols() {
sym.name = symbol_strtab.data() + esym.st_name;
sym.file = this;
sym.type = esym.st_type;
sym.st_type = esym.st_type;
sym.value = esym.st_value;
sym.esym = &esym;
@ -396,7 +396,7 @@ void ObjectFile::maybe_override_symbol(Symbol &sym, int symidx) {
sym.piece_ref = sym_pieces[symidx - first_global];
sym.value = esym.st_value;
sym.ver_idx = 0;
sym.type = esym.st_type;
sym.st_type = esym.st_type;
sym.esym = &esym;
sym.is_placeholder = false;
sym.is_weak = (esym.st_bind == STB_WEAK);
@ -583,7 +583,7 @@ void ObjectFile::write_symtab() {
esym = elf_syms[i];
esym.st_name = strtab_off;
if (sym.type == STT_TLS)
if (sym.st_type == STT_TLS)
esym.st_value = sym.get_addr() - sym.input_section->output_section->shdr.sh_addr;
else
esym.st_value = sym.get_addr();
@ -790,7 +790,7 @@ void SharedFile::resolve_symbols() {
sym.piece_ref = {};
sym.value = esym.st_value;
sym.ver_idx = versyms[i];
sym.type = (esym.st_type == STT_GNU_IFUNC) ? STT_FUNC : esym.st_type;
sym.st_type = (esym.st_type == STT_GNU_IFUNC) ? STT_FUNC : esym.st_type;
sym.esym = &esym;
sym.is_placeholder = false;
sym.is_weak = (esym.st_bind == STB_WEAK);

View File

@ -558,7 +558,7 @@ void RelPltSection::copy_buf() {
rel.r_sym = sym->dynsym_idx;
rel.r_offset = sym->get_gotplt_addr();
if (sym->type == STT_GNU_IFUNC) {
if (sym->st_type == STT_GNU_IFUNC) {
rel.r_type = R_X86_64_IRELATIVE;
rel.r_addend = sym->get_addr();
} else {
@ -588,7 +588,7 @@ void DynsymSection::copy_buf() {
auto &esym = *(ElfSym *)(base + sym->dynsym_idx * sizeof(ElfSym));
memset(&esym, 0, sizeof(esym));
esym.st_name = sym->dynstr_offset;
esym.st_type = sym->type;
esym.st_type = sym->st_type;
esym.st_bind = sym->esym->st_bind;
esym.st_size = sym->esym->st_size;