mirror of
https://github.com/rui314/mold.git
synced 2024-12-28 02:44:48 +03:00
temporary
This commit is contained in:
parent
05f17b9a48
commit
8f27c88db3
@ -139,7 +139,25 @@ void InputSection::relocate(u8 *buf) {
|
||||
<< " P=" << Twine::utohexstr(P)
|
||||
<< "\n";
|
||||
#endif
|
||||
*(u32 *)loc = (sym ? sym->gottp_offset : 0) + GOT + A - P;
|
||||
if (loc[-3] == 0x48 && loc[-2] == 0x8b) {
|
||||
loc[-3] = 0x48;
|
||||
loc[-2] = 0xc7;
|
||||
loc[-1] = 0xc0 | (loc[-1] >> 3);
|
||||
*(u32 *)loc = S - out::tls_end;
|
||||
break;
|
||||
}
|
||||
|
||||
if (loc[-3] == 0x4c && loc[-2] == 0x8b) {
|
||||
loc[-3] = 0x49;
|
||||
loc[-2] = 0xc7;
|
||||
loc[-1] = 0xc0 | (loc[-1] >> 3);
|
||||
*(u32 *)loc = S - out::tls_end;
|
||||
break;
|
||||
}
|
||||
|
||||
llvm::errs() << format("unsupported GOTTPOFF: 0x%02x 0x%02x 0x%02x\n",
|
||||
loc[-3], loc[-2], loc[-1]);
|
||||
error(toString(this));
|
||||
break;
|
||||
case R_X86_64_TPOFF32:
|
||||
*(u32 *)loc = S - out::tls_end;
|
||||
|
4
main.cc
4
main.cc
@ -338,9 +338,13 @@ static u64 set_osec_offsets(ArrayRef<OutputChunk *> output_chunks) {
|
||||
if (!chunk->is_bss())
|
||||
fileoff += chunk->get_size();
|
||||
|
||||
#if 0
|
||||
bool is_tbss = chunk->is_bss() && (chunk->shdr.sh_flags & SHF_TLS);
|
||||
if (!is_tbss)
|
||||
vaddr += chunk->get_size();
|
||||
#else
|
||||
vaddr += chunk->get_size();
|
||||
#endif
|
||||
}
|
||||
return fileoff;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user