diff options
author | H. Peter Anvin <hpa@zytor.com> | 2002-04-30 21:04:18 +0000 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2002-04-30 21:04:18 +0000 |
commit | 090a2185739075cbfe4d98437343670ae1a74962 (patch) | |
tree | 36575b9e44ccc0f456752f98e7c6395281bfe066 /outelf.c | |
parent | caa82a1e66f6b9517ba2199cdc4297bd7be8eaa2 (diff) | |
download | nasm-090a2185739075cbfe4d98437343670ae1a74962.tar.gz nasm-090a2185739075cbfe4d98437343670ae1a74962.tar.bz2 nasm-090a2185739075cbfe4d98437343670ae1a74962.zip |
NASM 0.98.17
Diffstat (limited to 'outelf.c')
-rw-r--r-- | outelf.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -554,7 +554,7 @@ static void elf_add_reloc (struct Section *sect, long segment, r->symbol = 0; for (i=0; i<nsects; i++) if (segment == sects[i]->index) - r->symbol = i+3; + r->symbol = i+2; if (!r->symbol) r->symbol = GLOBAL_TEMP_BASE + raa_read(bsym, segment); } @@ -928,13 +928,13 @@ static struct SAA *elf_build_symtab (long *len, long *local) * Now some standard symbols defining the segments, for relocation * purposes. */ - for (i = 1; i <= nsects+1; i++) { + for (i = 1; i <= nsects; i++) { p = entry; WRITELONG (p, 0); /* no symbol name */ WRITELONG (p, 0); /* offset zero */ WRITELONG (p, 0); /* size zero */ WRITESHORT (p, 3); /* local section-type thing */ - WRITESHORT (p, (i==1 ? SHN_ABS : i-1)); /* the section id */ + WRITESHORT (p, i); /* the section id */ saa_wbytes (s, entry, 16L); *len += 16; (*local)++; @@ -992,7 +992,7 @@ static struct SAA *elf_build_reltab (long *len, struct Reloc *r) { long sym = r->symbol; if (sym >= GLOBAL_TEMP_BASE) - sym += -GLOBAL_TEMP_BASE + (nsects+3) + nlocals; + sym += -GLOBAL_TEMP_BASE + (nsects+2) + nlocals; p = entry; WRITELONG (p, r->address); |