1
0
mirror of https://github.com/golang/go synced 2024-09-23 17:20:13 -06:00

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
This commit is contained in:
Russ Cox 2010-04-20 20:39:55 -07:00
parent 76cbbc8a95
commit 1c0c252880
2 changed files with 10 additions and 10 deletions

View File

@ -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);

View File

@ -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);