]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/link: external linking can fail on Solaris 11.2+
authorShawn Walker-Salas <shawn.walker@oracle.com>
Thu, 7 Apr 2016 22:26:57 +0000 (15:26 -0700)
committerBrad Fitzpatrick <bradfitz@golang.org>
Mon, 11 Apr 2016 18:03:02 +0000 (18:03 +0000)
Workaround external linking issues encountered on Solaris 11.2+ due to
the go.o object file being created with a NULL STT_FILE symtab entry by
using a placeholder name.

Fixes #14957

Change-Id: I89c501b4c548469f3c878151947d35588057982b
Reviewed-on: https://go-review.googlesource.com/21636
Reviewed-by: David Crawshaw <crawshaw@golang.org>
src/cmd/link/internal/ld/symtab.go

index c7c273350781fa1785d49fd4e69f2b878bf2276b..ae0b17c259c816c0f7beb024114c5234d410b469 100644 (file)
@@ -198,7 +198,9 @@ func Asmelfsym() {
 
        // Some linkers will add a FILE sym if one is not present.
        // Avoid having the working directory inserted into the symbol table.
-       putelfsyment(0, 0, 0, STB_LOCAL<<4|STT_FILE, SHN_ABS, 0)
+       // It is added with a name to avoid problems with external linking
+       // encountered on some versions of Solaris. See issue #14957.
+       putelfsyment(putelfstr("go.go"), 0, 0, STB_LOCAL<<4|STT_FILE, SHN_ABS, 0)
        numelfsym++
 
        elfbind = STB_LOCAL