mirror of
https://github.com/rui314/mold.git
synced 2024-09-22 10:27:48 +03:00
temporary
This commit is contained in:
parent
53bae89117
commit
fecd09d055
@ -68,7 +68,7 @@ void InputSection::relocate(u8 *buf) {
|
||||
Symbol *sym = file->get_symbol(sym_idx);
|
||||
u8 *loc = buf + output_section->shdr.sh_offset + offset + rel.r_offset;
|
||||
|
||||
u64 G = sym ? sym->got_addr : 0;
|
||||
u64 G = sym ? sym->got_offset : 0;
|
||||
u64 GOT = out::got->shdr.sh_addr;
|
||||
u64 S = sym ? sym->addr : file->get_symbol_addr(sym_idx);
|
||||
i64 A = rel.r_addend;
|
||||
@ -113,7 +113,7 @@ void InputSection::relocate(u8 *buf) {
|
||||
case R_X86_64_DTPOFF32:
|
||||
break;
|
||||
case R_X86_64_GOTTPOFF:
|
||||
*(u32 *)loc = (sym ? sym->gottp_addr : 0) + GOT + A - P;
|
||||
*(u32 *)loc = (sym ? sym->gottp_offset : 0) + GOT + A - P;
|
||||
break;
|
||||
case R_X86_64_TPOFF32:
|
||||
*(u32 *)loc = S - out::tls_end;
|
||||
|
4
main.cc
4
main.cc
@ -532,11 +532,11 @@ int main(int argc, char **argv) {
|
||||
|
||||
if (sym->needs_got) {
|
||||
out::got->symbols.push_back({GotSection::REGULAR, sym});
|
||||
sym->got_addr = offset;
|
||||
sym->got_offset = offset;
|
||||
offset += 8;
|
||||
} else if (sym->needs_gottp) {
|
||||
out::got->symbols.push_back({GotSection::TP, sym});
|
||||
sym->gottp_addr = offset;
|
||||
sym->gottp_offset = offset;
|
||||
offset += 8;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user