cmd/ld: make hostobj work on newer openbsd

Make hostobj work on OpenBSD 5.3/5.4/-current - these have PIE
enabled by default and linking fails since the Go linker generates
objects that are neither PIC nor PIE.

Fixes #5067

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/7572049
This commit is contained in:
Joel Sing 2013-12-20 03:58:27 +11:00
parent efd1d05023
commit 0eaabf6452
1 changed files with 2 additions and 0 deletions

View File

@ -574,6 +574,8 @@ hostlink(void)
}
if(HEADTYPE == Hdarwin)
argv[argc++] = "-Wl,-no_pie,-pagezero_size,4000000";
if(HEADTYPE == Hopenbsd)
argv[argc++] = "-Wl,-nopie";
if(iself && AssumeGoldLinker)
argv[argc++] = "-Wl,--rosegment";