mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd: enable -buildmode=pie on aix/ppc64
Change-Id: I939518462c931ba9feb125b2f299ef0706b124ce Reviewed-on: https://go-review.googlesource.com/c/go/+/168879 Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
parent
08692bed1e
commit
cf952e9e62
4 changed files with 6 additions and 4 deletions
|
|
@ -179,7 +179,7 @@ func (ctxt *Link) CanUsePlugins() bool {
|
|||
func (ctxt *Link) UseRelro() bool {
|
||||
switch ctxt.BuildMode {
|
||||
case BuildModeCArchive, BuildModeCShared, BuildModeShared, BuildModePIE, BuildModePlugin:
|
||||
return ctxt.IsELF
|
||||
return ctxt.IsELF || ctxt.HeadType == objabi.Haix
|
||||
default:
|
||||
return ctxt.linkShared || (ctxt.HeadType == objabi.Haix && ctxt.LinkMode == LinkExternal)
|
||||
}
|
||||
|
|
@ -1173,7 +1173,7 @@ func (ctxt *Link) hostlink() {
|
|||
}
|
||||
case BuildModePIE:
|
||||
// ELF.
|
||||
if ctxt.HeadType != objabi.Hdarwin {
|
||||
if ctxt.HeadType != objabi.Hdarwin && ctxt.HeadType != objabi.Haix {
|
||||
if ctxt.UseRelro() {
|
||||
argv = append(argv, "-Wl,-z,relro")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue