aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cmd/link/internal/ld/elf.go12
1 files changed, 1 insertions, 11 deletions
diff --git a/src/cmd/link/internal/ld/elf.go b/src/cmd/link/internal/ld/elf.go
index 5eeb4a9993..842570d5ef 100644
--- a/src/cmd/link/internal/ld/elf.go
+++ b/src/cmd/link/internal/ld/elf.go
@@ -2135,25 +2135,15 @@ func asmbElf(ctxt *Link) {
}
}
- if ctxt.HeadType == objabi.Hlinux {
+ if ctxt.HeadType == objabi.Hlinux || ctxt.HeadType == objabi.Hfreebsd {
ph := newElfPhdr()
ph.Type = elf.PT_GNU_STACK
ph.Flags = elf.PF_W + elf.PF_R
ph.Align = uint64(ctxt.Arch.RegSize)
-
- ph = newElfPhdr()
- ph.Type = elf.PT_PAX_FLAGS
- ph.Flags = 0x2a00 // mprotect, randexec, emutramp disabled
- ph.Align = uint64(ctxt.Arch.RegSize)
} else if ctxt.HeadType == objabi.Hsolaris {
ph := newElfPhdr()
ph.Type = elf.PT_SUNWSTACK
ph.Flags = elf.PF_W + elf.PF_R
- } else if ctxt.HeadType == objabi.Hfreebsd {
- ph := newElfPhdr()
- ph.Type = elf.PT_GNU_STACK
- ph.Flags = elf.PF_W + elf.PF_R
- ph.Align = uint64(ctxt.Arch.RegSize)
}
elfobj: