mirror of
https://github.com/golang/go
synced 2024-11-02 11:50:30 +00:00
cmd/link: mark stacks as non-executable on freebsd
Fixes #48112 Change-Id: I673a5fe61171e5ba3d8ce58daac79391fb4758f9 Reviewed-on: https://go-review.googlesource.com/c/go/+/346872 Trust: Keith Randall <khr@golang.org> Run-TryBot: Keith Randall <khr@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> TryBot-Result: Go Bot <gobot@golang.org>
This commit is contained in:
parent
d8b156773c
commit
782aa42255
1 changed files with 5 additions and 0 deletions
|
@ -2025,6 +2025,11 @@ func asmbElf(ctxt *Link) {
|
|||
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:
|
||||
|
|
Loading…
Reference in a new issue