mirror of
https://github.com/rui314/mold.git
synced 2024-12-26 01:44:29 +03:00
Improve i386 compatibility
This commit is contained in:
parent
d055ab3563
commit
0a8dcc1459
@ -47,7 +47,7 @@ void PltSection<I386>::copy_buf(Context<I386> &ctx) {
|
||||
0xe9, 0, 0, 0, 0, // jmp .PLT0@PC
|
||||
};
|
||||
memcpy(ent, data, sizeof(data));
|
||||
*(u32 *)(ent + 2) = sym->get_gotplt_addr(ctx) - sym->get_plt_addr(ctx);
|
||||
*(u32 *)(ent + 2) = sym->get_gotplt_addr(ctx) - ctx.got->shdr.sh_addr;
|
||||
} else {
|
||||
static const u8 data[] = {
|
||||
0xff, 0x25, 0, 0, 0, 0, // jmp *foo@GOT
|
||||
|
@ -934,7 +934,7 @@ void DynsymSection<E>::copy_buf(Context<E> &ctx) {
|
||||
} else if (sym.file->is_dso || sym.esym().is_undef()) {
|
||||
esym.st_shndx = SHN_UNDEF;
|
||||
esym.st_size = 0;
|
||||
if (!ctx.arg.shared && sym.has_plt(ctx) && !sym.has_got(ctx)) {
|
||||
if (!ctx.arg.pic && sym.has_plt(ctx) && !sym.has_got(ctx)) {
|
||||
// Emit an address for a canonical PLT
|
||||
esym.st_value = sym.get_plt_addr(ctx);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user