]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/ld: make hostobj work on newer openbsd
authorJoel Sing <jsing@google.com>
Thu, 19 Dec 2013 16:58:27 +0000 (03:58 +1100)
committerJoel Sing <jsing@google.com>
Thu, 19 Dec 2013 16:58:27 +0000 (03:58 +1100)
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

src/cmd/ld/lib.c

index 138a91787d60fb16774c0e4dcab85a25a434d2ee..18c27876eef20594877eba1ad57ec4bfb99a78c9 100644 (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";