Commit 1c0c2528 authored by Russ Cox's avatar Russ Cox

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
https://golang.org/cl/954041
parent 76cbbc8a
......@@ -713,11 +713,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);
......
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment