mirror of
https://github.com/netwide-assembler/nasm.git
synced 2025-04-12 18:40:23 +08:00
Adjust symbol number for global symbols
Reloc entries were pointing to wrong target section
This commit is contained in:
parent
82e94990ad
commit
aed5cfea58
@ -1414,7 +1414,11 @@ static struct SAA *elf_build_reltab(int32_t *len, struct Reloc *r)
|
||||
int32_t sym = r->symbol;
|
||||
|
||||
if (sym >= GLOBAL_TEMP_BASE)
|
||||
sym += -GLOBAL_TEMP_BASE + (nsects + 2) + nlocals;
|
||||
{
|
||||
if (of_elf32.current_dfmt == &df_dwarf)
|
||||
sym += -GLOBAL_TEMP_BASE + (nsects + 5) + nlocals;
|
||||
else sym += -GLOBAL_TEMP_BASE + (nsects + 2) + nlocals;
|
||||
}
|
||||
|
||||
p = entry;
|
||||
WRITELONG(p, r->address);
|
||||
|
Loading…
x
Reference in New Issue
Block a user