From 35c183cd73760f82f534b657a8a87c520abd4b28 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Tue, 20 Apr 2010 20:39:55 -0700 Subject: 6l, 8l: include ELF header in PT_LOAD mapping for text segment Due to page boundary rounding, the header would have been loaded as part of the text segment already, but this change placates the "paxctl" tool on so-called hardened Linux distributions (as if normal distributions weren't already hard enough to use). R=r CC=golang-dev http://codereview.appspot.com/954041 --- src/cmd/8l/asm.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/cmd/8l/asm.c') diff --git a/src/cmd/8l/asm.c b/src/cmd/8l/asm.c index eddf6617b..4e8c0560d 100644 --- a/src/cmd/8l/asm.c +++ b/src/cmd/8l/asm.c @@ -829,11 +829,11 @@ asmb(void) ph = newElfPhdr(); ph->type = PT_LOAD; ph->flags = PF_X+PF_R; - ph->vaddr = va; - ph->paddr = va; - ph->off = fo; - ph->filesz = w; - ph->memsz = w; + ph->vaddr = va - fo; + ph->paddr = va - fo; + ph->off = 0; + ph->filesz = w + fo; + ph->memsz = w + fo; ph->align = INITRND; fo = rnd(fo+w, INITRND); -- cgit v1.2.3