From a3f6c3b0b923eeebb3d37697006b1bb80140cfad Mon Sep 17 00:00:00 2001 From: lemon Date: Fri, 10 Oct 2025 22:41:22 +0200 Subject: elf: use SHN_ABS for file symbol --- elf.c | 4 ++-- 1 file 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 -- cgit v1.2.3