w6l: purge dead elf branches; pin rx extent

This commit is contained in:
2026-08-09 04:37:33 +09:00
parent e720d4802f
commit ac8ddee6c1
8 changed files with 33 additions and 29 deletions

View File

@@ -376,7 +376,6 @@ l_emit_dyn_elf(Lnk *l, FILE *f, u64 base, u64 entry)
const u64 gotplt_va = base + gotplt_off;
const u64 dynamic_va = base + dynamic_off;
const u64 data_va = base + data_off;
(void)dynstr_va; (void)hash_va; (void)plt_va;
/* Now that the dyn layout pins text_va/data_va, apply
* relocations. main.c defers this; the static path runs it from
@@ -587,6 +586,8 @@ l_emit_dyn_elf(Lnk *l, FILE *f, u64 base, u64 entry)
ph[0].p_vaddr = base;
ph[0].p_paddr = base;
ph[0].p_filesz = rx_end;
/* The loader page-rounds mappings; gotplt_off independently starts
* the next page, so padding is not part of the R+X extent. */
ph[0].p_memsz = rx_end;
ph[0].p_align = page;