aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/ld/lib.c
diff options
context:
space:
mode:
authorJoel Sing <jsing@google.com>2013-12-20 03:58:27 +1100
committerJoel Sing <jsing@google.com>2013-12-20 03:58:27 +1100
commit0eaabf6452149ecbcc1caf40e22ae16cf73c768e (patch)
tree8b1b4ed061f8c385b2829b73d4f115292001ff86 /src/cmd/ld/lib.c
parentefd1d050230606b4383f5ddb6ea3df7853fc4ce7 (diff)
downloadgo-0eaabf6452149ecbcc1caf40e22ae16cf73c768e.tar.xz
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
Diffstat (limited to 'src/cmd/ld/lib.c')
-rw-r--r--src/cmd/ld/lib.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/cmd/ld/lib.c b/src/cmd/ld/lib.c
index 138a91787d..18c27876ee 100644
--- a/src/cmd/ld/lib.c
+++ b/src/cmd/ld/lib.c
@@ -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";