]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/link: set ELF CPIC bit in mips64 objects
authorIan Lance Taylor <iant@golang.org>
Thu, 4 May 2017 20:13:24 +0000 (16:13 -0400)
committerIan Lance Taylor <iant@golang.org>
Thu, 4 May 2017 20:35:56 +0000 (20:35 +0000)
We already set it for mips32 objects. The native ELF linker warns when
linking PIC objects with non-PIC objects. Our objects are PIC, but we
were not marking them as such.

Fixes #20243.

Change-Id: Ifab131200b263e4c72cf81f7b131a65ac02a13a9
Reviewed-on: https://go-review.googlesource.com/42710
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/cmd/link/internal/ld/elf.go

index 66375b05aeeba33b08cdbe72be81fa9f4bf1f6d2..0fc947fec29eea724f5996ceed79a074f7b6af14 100644 (file)
@@ -936,7 +936,7 @@ func Elfinit(ctxt *Link) {
                fallthrough
        case sys.AMD64, sys.ARM64, sys.MIPS64:
                if SysArch.Family == sys.MIPS64 {
-                       ehdr.flags = 0x20000000 /* MIPS 3 */
+                       ehdr.flags = 0x20000004 /* MIPS 3 CPIC */
                }
                elf64 = true