aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2025-10-10 22:41:22 +0200
committerlemon <lsof@mailbox.org>2025-10-10 22:41:22 +0200
commita3f6c3b0b923eeebb3d37697006b1bb80140cfad (patch)
treebf69ac015929b236978320a4d4e272f59c0f00cd
parent518ecb2a5d57f6d3282a10a988de61c3c9055799 (diff)
elf: use SHN_ABS for file symbol
-rw-r--r--elf.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/elf.c b/elf.c
index 7620961..f0d27b9 100644
--- a/elf.c
+++ b/elf.c
@@ -55,7 +55,7 @@ elfinit(void)
hdr.h32.shentsize = sizeof(struct elf32shdr);
}
vpush(&symtab, ((struct sym) { 0 }));
- vpush(&symtab, ((struct sym) { .type = STT_FILE }));
+ vpush(&symtab, ((struct sym) { .type = STT_FILE, .shndx = SHN_ABS }));
}
uint
@@ -320,7 +320,7 @@ putreloc(struct wbuf *out, const struct reloc *rel, bool userela)
/* ensure .symtab entries are ordered like this:
* (0. zero entry: NOTYPE LOCAL UND)
- * (1. file: FILE LOCAL UND "...")
+ * (1. file: FILE LOCAL ABS "...")
* 2. locals
* 3. defined globals
* 4. undefined globals