1
1
mirror of https://github.com/rui314/mold.git synced 2024-12-28 19:04:27 +03:00

temporary

This commit is contained in:
Rui Ueyama 2020-11-21 09:43:38 +09:00
parent 9bea6fcf80
commit 437d2b3838

View File

@ -115,10 +115,8 @@ void InputSection::scan_relocations() {
return; return;
for (const ELF64LE::Rela &rel : rels) { for (const ELF64LE::Rela &rel : rels) {
Symbol *sym = file->symbols[rel.getSymbol(false)]; Symbol &sym = *file->symbols[rel.getSymbol(false)];
if (!sym->file) assert(sym.file);
continue;
assert(sym->file);
switch (rel.getType(false)) { switch (rel.getType(false)) {
case R_X86_64_NONE: case R_X86_64_NONE:
@ -139,20 +137,20 @@ void InputSection::scan_relocations() {
case R_X86_64_GOTPCREL: case R_X86_64_GOTPCREL:
case R_X86_64_GOTPCRELX: case R_X86_64_GOTPCRELX:
case R_X86_64_REX_GOTPCRELX: case R_X86_64_REX_GOTPCRELX:
sym->flags |= Symbol::NEEDS_GOT; sym.flags |= Symbol::NEEDS_GOT;
break; break;
case R_X86_64_PLT32: case R_X86_64_PLT32:
if (sym->is_imported || sym->type == STT_GNU_IFUNC) if (sym.is_imported || sym.type == STT_GNU_IFUNC)
sym->flags |= Symbol::NEEDS_PLT; sym.flags |= Symbol::NEEDS_PLT;
break; break;
case R_X86_64_TLSGD: case R_X86_64_TLSGD:
sym->flags |= Symbol::NEEDS_TLSGD; sym.flags |= Symbol::NEEDS_TLSGD;
break; break;
case R_X86_64_TLSLD: case R_X86_64_TLSLD:
sym->flags |= Symbol::NEEDS_TLSLD; sym.flags |= Symbol::NEEDS_TLSLD;
break; break;
case R_X86_64_GOTTPOFF: case R_X86_64_GOTTPOFF:
sym->flags |= Symbol::NEEDS_GOTTPOFF; sym.flags |= Symbol::NEEDS_GOTTPOFF;
break; break;
default: default:
error(toString(this) + ": unknown relocation: " + error(toString(this) + ": unknown relocation: " +