Skip to content

Commit 39c07ce

Browse files
cmd/link: set ELF CPIC bit in mips64 objects
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 <[email protected]> Reviewed-by: Brad Fitzpatrick <[email protected]> TryBot-Result: Gobot Gobot <[email protected]>
1 parent 98b3e3a commit 39c07ce

File tree

1 file changed

+1
-1
lines changed
  • src/cmd/link/internal/ld

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -936,7 +936,7 @@ func Elfinit(ctxt *Link) {
936936
fallthrough
937937
case sys.AMD64, sys.ARM64, sys.MIPS64:
938938
if SysArch.Family == sys.MIPS64 {
939-
ehdr.flags = 0x20000000 /* MIPS 3 */
939+
ehdr.flags = 0x20000004 /* MIPS 3 CPIC */
940940
}
941941
elf64 = true
942942

0 commit comments

Comments
 (0)