From 8bca148a3e81631126b8d74e18c6cdb203313217 Mon Sep 17 00:00:00 2001
From: Rob Pike <r@golang.org>
Date: Tue, 12 Aug 2014 17:04:45 -0700
Subject: [PATCH] all: copy cmd/ld/textflag.h into pkg/GOOS_GOARCH The file is
 used by assembly code to define symbols like NOSPLIT. Having it hidden inside
 the cmd directory makes it hard to access outside the standard repository.
 Solution: As with a couple of other files used by cgo, copy the file into the
 pkg directory and add a -I argument to the assembler to access it. Thus one
 can write just         #include "textflag.h" in .s files.

The names in runtime are not updated because in the boot sequence the
file has not been copied yet when runtime is built. All other .s files
in the repository are updated.

Changes to doc/asm.html, src/cmd/dist/build.c, and src/cmd/go/build.go
are hand-made. The rest are just the renaming done by a global
substitution. (Yay sam).

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/128050043
---
 doc/asm.html                              | 2 +-
 src/cmd/dist/build.c                      | 5 ++++-
 src/cmd/go/build.go                       | 4 +++-
 src/cmd/link/testdata/autosection.s       | 2 +-
 src/cmd/link/testdata/layout.s            | 2 +-
 src/pkg/crypto/aes/asm_amd64.s            | 2 +-
 src/pkg/crypto/md5/md5block_386.s         | 2 +-
 src/pkg/crypto/md5/md5block_amd64.s       | 2 +-
 src/pkg/crypto/md5/md5block_amd64p32.s    | 2 +-
 src/pkg/crypto/md5/md5block_arm.s         | 2 +-
 src/pkg/crypto/rc4/rc4_386.s              | 2 +-
 src/pkg/crypto/rc4/rc4_amd64.s            | 2 +-
 src/pkg/crypto/rc4/rc4_amd64p32.s         | 2 +-
 src/pkg/crypto/rc4/rc4_arm.s              | 2 +-
 src/pkg/crypto/sha1/sha1block_386.s       | 2 +-
 src/pkg/crypto/sha1/sha1block_amd64.s     | 2 +-
 src/pkg/crypto/sha1/sha1block_amd64p32.s  | 2 +-
 src/pkg/crypto/sha1/sha1block_arm.s       | 2 +-
 src/pkg/crypto/sha256/sha256block_amd64.s | 2 +-
 src/pkg/crypto/sha512/sha512block_amd64.s | 2 +-
 src/pkg/hash/crc32/crc32_amd64.s          | 2 +-
 src/pkg/hash/crc32/crc32_amd64p32.s       | 2 +-
 src/pkg/math/abs_386.s                    | 2 +-
 src/pkg/math/abs_amd64.s                  | 2 +-
 src/pkg/math/abs_arm.s                    | 2 +-
 src/pkg/math/asin_386.s                   | 2 +-
 src/pkg/math/asin_amd64.s                 | 2 +-
 src/pkg/math/asin_arm.s                   | 2 +-
 src/pkg/math/atan2_386.s                  | 2 +-
 src/pkg/math/atan2_amd64.s                | 2 +-
 src/pkg/math/atan2_arm.s                  | 2 +-
 src/pkg/math/atan_386.s                   | 2 +-
 src/pkg/math/atan_amd64.s                 | 2 +-
 src/pkg/math/atan_arm.s                   | 2 +-
 src/pkg/math/big/arith_386.s              | 2 +-
 src/pkg/math/big/arith_amd64.s            | 2 +-
 src/pkg/math/big/arith_amd64p32.s         | 2 +-
 src/pkg/math/big/arith_arm.s              | 2 +-
 src/pkg/math/dim_386.s                    | 2 +-
 src/pkg/math/dim_amd64.s                  | 2 +-
 src/pkg/math/dim_arm.s                    | 2 +-
 src/pkg/math/exp2_386.s                   | 2 +-
 src/pkg/math/exp2_amd64.s                 | 2 +-
 src/pkg/math/exp2_arm.s                   | 2 +-
 src/pkg/math/exp_386.s                    | 2 +-
 src/pkg/math/exp_amd64.s                  | 2 +-
 src/pkg/math/exp_arm.s                    | 2 +-
 src/pkg/math/expm1_386.s                  | 2 +-
 src/pkg/math/expm1_amd64.s                | 2 +-
 src/pkg/math/expm1_arm.s                  | 2 +-
 src/pkg/math/floor_386.s                  | 2 +-
 src/pkg/math/floor_amd64.s                | 2 +-
 src/pkg/math/floor_arm.s                  | 2 +-
 src/pkg/math/frexp_386.s                  | 2 +-
 src/pkg/math/frexp_amd64.s                | 2 +-
 src/pkg/math/frexp_arm.s                  | 2 +-
 src/pkg/math/hypot_386.s                  | 2 +-
 src/pkg/math/hypot_amd64.s                | 2 +-
 src/pkg/math/hypot_arm.s                  | 2 +-
 src/pkg/math/ldexp_386.s                  | 2 +-
 src/pkg/math/ldexp_amd64.s                | 2 +-
 src/pkg/math/ldexp_arm.s                  | 2 +-
 src/pkg/math/log10_386.s                  | 2 +-
 src/pkg/math/log10_amd64.s                | 2 +-
 src/pkg/math/log10_arm.s                  | 2 +-
 src/pkg/math/log1p_386.s                  | 2 +-
 src/pkg/math/log1p_amd64.s                | 2 +-
 src/pkg/math/log1p_arm.s                  | 2 +-
 src/pkg/math/log_386.s                    | 2 +-
 src/pkg/math/log_amd64.s                  | 2 +-
 src/pkg/math/log_arm.s                    | 2 +-
 src/pkg/math/mod_386.s                    | 2 +-
 src/pkg/math/mod_amd64.s                  | 2 +-
 src/pkg/math/mod_arm.s                    | 2 +-
 src/pkg/math/modf_386.s                   | 2 +-
 src/pkg/math/modf_amd64.s                 | 2 +-
 src/pkg/math/modf_arm.s                   | 2 +-
 src/pkg/math/remainder_386.s              | 2 +-
 src/pkg/math/remainder_amd64.s            | 2 +-
 src/pkg/math/remainder_arm.s              | 2 +-
 src/pkg/math/sin_386.s                    | 2 +-
 src/pkg/math/sin_amd64.s                  | 2 +-
 src/pkg/math/sin_arm.s                    | 2 +-
 src/pkg/math/sincos_386.s                 | 2 +-
 src/pkg/math/sincos_amd64.s               | 2 +-
 src/pkg/math/sincos_arm.s                 | 2 +-
 src/pkg/math/sqrt_386.s                   | 2 +-
 src/pkg/math/sqrt_amd64.s                 | 2 +-
 src/pkg/math/sqrt_arm.s                   | 2 +-
 src/pkg/math/tan_386.s                    | 2 +-
 src/pkg/math/tan_amd64.s                  | 2 +-
 src/pkg/math/tan_arm.s                    | 2 +-
 src/pkg/os/signal/sig.s                   | 2 +-
 src/pkg/reflect/asm_386.s                 | 2 +-
 src/pkg/reflect/asm_amd64.s               | 2 +-
 src/pkg/reflect/asm_amd64p32.s            | 2 +-
 src/pkg/reflect/asm_arm.s                 | 2 +-
 src/pkg/sync/atomic/asm_386.s             | 2 +-
 src/pkg/sync/atomic/asm_amd64.s           | 2 +-
 src/pkg/sync/atomic/asm_amd64p32.s        | 2 +-
 src/pkg/sync/atomic/asm_arm.s             | 2 +-
 src/pkg/sync/atomic/asm_freebsd_arm.s     | 2 +-
 src/pkg/sync/atomic/asm_linux_arm.s       | 2 +-
 src/pkg/sync/atomic/asm_nacl_arm.s        | 2 +-
 src/pkg/sync/atomic/asm_netbsd_arm.s      | 2 +-
 src/pkg/syscall/asm_darwin_386.s          | 2 +-
 src/pkg/syscall/asm_darwin_amd64.s        | 2 +-
 src/pkg/syscall/asm_dragonfly_386.s       | 2 +-
 src/pkg/syscall/asm_dragonfly_amd64.s     | 2 +-
 src/pkg/syscall/asm_freebsd_386.s         | 2 +-
 src/pkg/syscall/asm_freebsd_amd64.s       | 2 +-
 src/pkg/syscall/asm_freebsd_arm.s         | 2 +-
 src/pkg/syscall/asm_linux_386.s           | 2 +-
 src/pkg/syscall/asm_linux_amd64.s         | 2 +-
 src/pkg/syscall/asm_linux_arm.s           | 2 +-
 src/pkg/syscall/asm_nacl_386.s            | 2 +-
 src/pkg/syscall/asm_nacl_amd64p32.s       | 2 +-
 src/pkg/syscall/asm_nacl_arm.s            | 2 +-
 src/pkg/syscall/asm_netbsd_386.s          | 2 +-
 src/pkg/syscall/asm_netbsd_amd64.s        | 2 +-
 src/pkg/syscall/asm_netbsd_arm.s          | 2 +-
 src/pkg/syscall/asm_openbsd_386.s         | 2 +-
 src/pkg/syscall/asm_openbsd_amd64.s       | 2 +-
 src/pkg/syscall/asm_plan9_386.s           | 2 +-
 src/pkg/syscall/asm_plan9_amd64.s         | 2 +-
 src/pkg/syscall/time_nacl_386.s           | 2 +-
 src/pkg/syscall/time_nacl_amd64p32.s      | 2 +-
 src/pkg/syscall/time_nacl_arm.s           | 2 +-
 128 files changed, 133 insertions(+), 128 deletions(-)

diff --git a/doc/asm.html b/doc/asm.html
index f4ef1e62f2d..943347216ec 100644
--- a/doc/asm.html
+++ b/doc/asm.html
@@ -253,7 +253,7 @@ There may be one or two arguments to the directives.
 If there are two, the first is a bit mask of flags,
 which can be written as numeric expressions, added or or-ed together,
 or can be set symbolically for easier absorption by a human.
-Their values, defined in the file <code>src/cmd/ld/textflag.h</code>, are:
+Their values, defined in the standard <code>#include</code>  file <code>textflag.h</code>, are:
 </p>
 
 <ul>
diff --git a/src/cmd/dist/build.c b/src/cmd/dist/build.c
index a994367351c..2e857559b88 100644
--- a/src/cmd/dist/build.c
+++ b/src/cmd/dist/build.c
@@ -1115,12 +1115,15 @@ install(char *dir)
 
 nobuild:
 	// In package runtime, we install runtime.h and cgocall.h too,
-	// for use by cgo compilation.
+	// for use by cgo compilation. For assembler source, we also
+	// copy cmd/ld/textflag.h.
 	if(streq(dir, "pkg/runtime")) {
 		copy(bpathf(&b, "%s/pkg/%s_%s/cgocall.h", goroot, goos, goarch),
 			bpathf(&b1, "%s/src/pkg/runtime/cgocall.h", goroot), 0);
 		copy(bpathf(&b, "%s/pkg/%s_%s/runtime.h", goroot, goos, goarch),
 			bpathf(&b1, "%s/src/pkg/runtime/runtime.h", goroot), 0);
+		copy(bpathf(&b, "%s/pkg/%s_%s/textflag.h", goroot, goos, goarch),
+			bpathf(&b1, "%s/src/cmd/ld/textflag.h", goroot), 0);
 	}
 
 
diff --git a/src/cmd/go/build.go b/src/cmd/go/build.go
index 00df6b29153..591eb1620aa 100644
--- a/src/cmd/go/build.go
+++ b/src/cmd/go/build.go
@@ -1613,8 +1613,10 @@ func (gcToolchain) gc(b *builder, p *Package, archive, obj string, importArgs []
 }
 
 func (gcToolchain) asm(b *builder, p *Package, obj, ofile, sfile string) error {
+	// Add -I pkg/GOOS_GOARCH so #include "textflag.h" works in .s files.
+	inc := filepath.Join(goroot, "pkg", fmt.Sprintf("%s_%s", goos, goarch))
 	sfile = mkAbs(p.Dir, sfile)
-	return b.run(p.Dir, p.ImportPath, nil, tool(archChar+"a"), "-trimpath", b.work, "-I", obj, "-o", ofile, "-D", "GOOS_"+goos, "-D", "GOARCH_"+goarch, sfile)
+	return b.run(p.Dir, p.ImportPath, nil, tool(archChar+"a"), "-trimpath", b.work, "-I", obj, "-I", inc, "-o", ofile, "-D", "GOOS_"+goos, "-D", "GOARCH_"+goarch, sfile)
 }
 
 func (gcToolchain) pkgpath(basedir string, p *Package) string {
diff --git a/src/cmd/link/testdata/autosection.s b/src/cmd/link/testdata/autosection.s
index 8a579b70272..fd9e94da4e6 100644
--- a/src/cmd/link/testdata/autosection.s
+++ b/src/cmd/link/testdata/autosection.s
@@ -4,7 +4,7 @@
 
 // Test of section-named symbols.
 
-#include "../../ld/textflag.h"
+#include "textflag.h"
 
 TEXT start(SB),7,$0
 	MOVQ $autotab(SB),AX
diff --git a/src/cmd/link/testdata/layout.s b/src/cmd/link/testdata/layout.s
index 0d492c5af2b..c3e55ef49a9 100644
--- a/src/cmd/link/testdata/layout.s
+++ b/src/cmd/link/testdata/layout.s
@@ -5,7 +5,7 @@
 // Test of section assignment in layout.go.
 // Each symbol should end up in the section named by the symbol name prefix (up to the underscore).
 
-#include "../../ld/textflag.h"
+#include "textflag.h"
 
 TEXT text_start(SB),7,$0
 	MOVQ $rodata_sym(SB), AX
diff --git a/src/pkg/crypto/aes/asm_amd64.s b/src/pkg/crypto/aes/asm_amd64.s
index 5c22881e986..6a6e6ac4b9d 100644
--- a/src/pkg/crypto/aes/asm_amd64.s
+++ b/src/pkg/crypto/aes/asm_amd64.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 // func hasAsm() bool
 // returns whether AES-NI is supported
diff --git a/src/pkg/crypto/md5/md5block_386.s b/src/pkg/crypto/md5/md5block_386.s
index e5c27ac9aa5..8e426d148fa 100644
--- a/src/pkg/crypto/md5/md5block_386.s
+++ b/src/pkg/crypto/md5/md5block_386.s
@@ -6,7 +6,7 @@
 // #defines generating 8a assembly, and adjusted for 386,
 // by the Go Authors.
 
-#include "../../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 // MD5 optimized for AMD64.
 //
diff --git a/src/pkg/crypto/md5/md5block_amd64.s b/src/pkg/crypto/md5/md5block_amd64.s
index 178e49cd8ec..a3ae7d97b23 100644
--- a/src/pkg/crypto/md5/md5block_amd64.s
+++ b/src/pkg/crypto/md5/md5block_amd64.s
@@ -5,7 +5,7 @@
 // Translated from Perl generating GNU assembly into
 // #defines generating 6a assembly by the Go Authors.
 
-#include "../../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 // MD5 optimized for AMD64.
 //
diff --git a/src/pkg/crypto/md5/md5block_amd64p32.s b/src/pkg/crypto/md5/md5block_amd64p32.s
index a78a3f6100e..d918a67c514 100644
--- a/src/pkg/crypto/md5/md5block_amd64p32.s
+++ b/src/pkg/crypto/md5/md5block_amd64p32.s
@@ -9,7 +9,7 @@
 // replace BP with R11, reloaded before use at return.
 // replace R15 with R11.
 
-#include "../../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 // MD5 optimized for AMD64.
 //
diff --git a/src/pkg/crypto/md5/md5block_arm.s b/src/pkg/crypto/md5/md5block_arm.s
index e644bfcd613..3b26e549b95 100644
--- a/src/pkg/crypto/md5/md5block_arm.s
+++ b/src/pkg/crypto/md5/md5block_arm.s
@@ -4,7 +4,7 @@
 //
 // ARM version of md5block.go
 
-#include "../../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 // Register definitions
 table = 0	// Pointer to MD5 constants table
diff --git a/src/pkg/crypto/rc4/rc4_386.s b/src/pkg/crypto/rc4/rc4_386.s
index b04fc1fb83a..54221036bac 100644
--- a/src/pkg/crypto/rc4/rc4_386.s
+++ b/src/pkg/crypto/rc4/rc4_386.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 // func xorKeyStream(dst, src *byte, n int, state *[256]byte, i, j *uint8)
 TEXT ·xorKeyStream(SB),NOSPLIT,$0
diff --git a/src/pkg/crypto/rc4/rc4_amd64.s b/src/pkg/crypto/rc4/rc4_amd64.s
index e3234b6c7ee..57d941c8f3c 100644
--- a/src/pkg/crypto/rc4/rc4_amd64.s
+++ b/src/pkg/crypto/rc4/rc4_amd64.s
@@ -2,7 +2,7 @@
 //	http://www.zorinaq.com/papers/rc4-amd64.html
 //	http://www.zorinaq.com/papers/rc4-amd64.tar.bz2
 
-#include "../../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 // Local modifications:
 //
diff --git a/src/pkg/crypto/rc4/rc4_amd64p32.s b/src/pkg/crypto/rc4/rc4_amd64p32.s
index 27d8495071e..970b34e08ef 100644
--- a/src/pkg/crypto/rc4/rc4_amd64p32.s
+++ b/src/pkg/crypto/rc4/rc4_amd64p32.s
@@ -2,7 +2,7 @@
 //	http://www.zorinaq.com/papers/rc4-amd64.html
 //	http://www.zorinaq.com/papers/rc4-amd64.tar.bz2
 
-#include "../../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 // Local modifications:
 //
diff --git a/src/pkg/crypto/rc4/rc4_arm.s b/src/pkg/crypto/rc4/rc4_arm.s
index b9ac72301c0..51be3bf95b3 100644
--- a/src/pkg/crypto/rc4/rc4_arm.s
+++ b/src/pkg/crypto/rc4/rc4_arm.s
@@ -4,7 +4,7 @@
 
 // +build !nacl
 
-#include "../../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 // Registers
 dst = 0
diff --git a/src/pkg/crypto/sha1/sha1block_386.s b/src/pkg/crypto/sha1/sha1block_386.s
index 688851c31e4..a0adabc3c37 100644
--- a/src/pkg/crypto/sha1/sha1block_386.s
+++ b/src/pkg/crypto/sha1/sha1block_386.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 // SHA1 block routine. See sha1block.go for Go equivalent.
 //
diff --git a/src/pkg/crypto/sha1/sha1block_amd64.s b/src/pkg/crypto/sha1/sha1block_amd64.s
index 8ffb9d5d680..4319df63e16 100644
--- a/src/pkg/crypto/sha1/sha1block_amd64.s
+++ b/src/pkg/crypto/sha1/sha1block_amd64.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 // SHA1 block routine. See sha1block.go for Go equivalent.
 //
diff --git a/src/pkg/crypto/sha1/sha1block_amd64p32.s b/src/pkg/crypto/sha1/sha1block_amd64p32.s
index 3c589d94fe0..d93fbf1ed35 100644
--- a/src/pkg/crypto/sha1/sha1block_amd64p32.s
+++ b/src/pkg/crypto/sha1/sha1block_amd64p32.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 // SHA1 block routine. See sha1block.go for Go equivalent.
 //
diff --git a/src/pkg/crypto/sha1/sha1block_arm.s b/src/pkg/crypto/sha1/sha1block_arm.s
index 5917e8b24b1..f11f33dc33e 100644
--- a/src/pkg/crypto/sha1/sha1block_arm.s
+++ b/src/pkg/crypto/sha1/sha1block_arm.s
@@ -4,7 +4,7 @@
 //
 // ARM version of md5block.go
 
-#include "../../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 // SHA1 block routine. See sha1block.go for Go equivalent.
 //
diff --git a/src/pkg/crypto/sha256/sha256block_amd64.s b/src/pkg/crypto/sha256/sha256block_amd64.s
index 95aebbe7626..868eaed4896 100644
--- a/src/pkg/crypto/sha256/sha256block_amd64.s
+++ b/src/pkg/crypto/sha256/sha256block_amd64.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 // SHA256 block routine. See sha256block.go for Go equivalent.
 //
diff --git a/src/pkg/crypto/sha512/sha512block_amd64.s b/src/pkg/crypto/sha512/sha512block_amd64.s
index 344d8d2c3e9..2e10233de1d 100644
--- a/src/pkg/crypto/sha512/sha512block_amd64.s
+++ b/src/pkg/crypto/sha512/sha512block_amd64.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 // SHA512 block routine. See sha512block.go for Go equivalent.
 //
diff --git a/src/pkg/hash/crc32/crc32_amd64.s b/src/pkg/hash/crc32/crc32_amd64.s
index 95dc8bf41bc..30b0d0691c3 100644
--- a/src/pkg/hash/crc32/crc32_amd64.s
+++ b/src/pkg/hash/crc32/crc32_amd64.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 // func castagnoliSSE42(crc uint32, p []byte) uint32
 TEXT ·castagnoliSSE42(SB),NOSPLIT,$0
diff --git a/src/pkg/hash/crc32/crc32_amd64p32.s b/src/pkg/hash/crc32/crc32_amd64p32.s
index e34f2086777..b6770eba3e5 100644
--- a/src/pkg/hash/crc32/crc32_amd64p32.s
+++ b/src/pkg/hash/crc32/crc32_amd64p32.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 // func castagnoliSSE42(crc uint32, p []byte) uint32
 TEXT ·castagnoliSSE42(SB),NOSPLIT,$0
diff --git a/src/pkg/math/abs_386.s b/src/pkg/math/abs_386.s
index 3490cf66c77..f30a439c26b 100644
--- a/src/pkg/math/abs_386.s
+++ b/src/pkg/math/abs_386.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 // func Abs(x float64) float64
 TEXT ·Abs(SB),NOSPLIT,$0
diff --git a/src/pkg/math/abs_amd64.s b/src/pkg/math/abs_amd64.s
index 779c8f54840..0424eb5fad6 100644
--- a/src/pkg/math/abs_amd64.s
+++ b/src/pkg/math/abs_amd64.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 // func Abs(x float64) float64
 TEXT ·Abs(SB),NOSPLIT,$0
diff --git a/src/pkg/math/abs_arm.s b/src/pkg/math/abs_arm.s
index b5117ab39c2..bfa77eb491e 100644
--- a/src/pkg/math/abs_arm.s
+++ b/src/pkg/math/abs_arm.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 TEXT ·Abs(SB),NOSPLIT,$0
 	MOVW	x_lo+0(FP), R0
diff --git a/src/pkg/math/asin_386.s b/src/pkg/math/asin_386.s
index 2c1d2709488..4f34e123ef4 100644
--- a/src/pkg/math/asin_386.s
+++ b/src/pkg/math/asin_386.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 // func Asin(x float64) float64
 TEXT ·Asin(SB),NOSPLIT,$0
diff --git a/src/pkg/math/asin_amd64.s b/src/pkg/math/asin_amd64.s
index ea48104ac64..1a43d489b5b 100644
--- a/src/pkg/math/asin_amd64.s
+++ b/src/pkg/math/asin_amd64.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 TEXT ·Asin(SB),NOSPLIT,$0
 	JMP ·asin(SB)
diff --git a/src/pkg/math/asin_arm.s b/src/pkg/math/asin_arm.s
index b90526003e1..8fe03b61d84 100644
--- a/src/pkg/math/asin_arm.s
+++ b/src/pkg/math/asin_arm.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 TEXT ·Asin(SB),NOSPLIT,$0
 	B ·asin(SB)
diff --git a/src/pkg/math/atan2_386.s b/src/pkg/math/atan2_386.s
index fb649316a05..31a74e7262c 100644
--- a/src/pkg/math/atan2_386.s
+++ b/src/pkg/math/atan2_386.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 // func Atan2(y, x float64) float64	// =atan(y/x)
 TEXT ·Atan2(SB),NOSPLIT,$0
diff --git a/src/pkg/math/atan2_amd64.s b/src/pkg/math/atan2_amd64.s
index f7a5a11d469..fc471f76c5d 100644
--- a/src/pkg/math/atan2_amd64.s
+++ b/src/pkg/math/atan2_amd64.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 TEXT ·Atan2(SB),NOSPLIT,$0
 	JMP ·atan2(SB)
diff --git a/src/pkg/math/atan2_arm.s b/src/pkg/math/atan2_arm.s
index 24bff2c03d2..06c12ecbc4b 100644
--- a/src/pkg/math/atan2_arm.s
+++ b/src/pkg/math/atan2_arm.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 TEXT ·Atan2(SB),NOSPLIT,$0
 	B ·atan2(SB)
diff --git a/src/pkg/math/atan_386.s b/src/pkg/math/atan_386.s
index aad8ffcec73..f3976b1d350 100644
--- a/src/pkg/math/atan_386.s
+++ b/src/pkg/math/atan_386.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 // func Atan(x float64) float64
 TEXT ·Atan(SB),NOSPLIT,$0
diff --git a/src/pkg/math/atan_amd64.s b/src/pkg/math/atan_amd64.s
index fc4a91b0deb..b801ae99d2e 100644
--- a/src/pkg/math/atan_amd64.s
+++ b/src/pkg/math/atan_amd64.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 TEXT ·Atan(SB),NOSPLIT,$0
 	JMP ·atan(SB)
diff --git a/src/pkg/math/atan_arm.s b/src/pkg/math/atan_arm.s
index defa93a1ede..d190a8bb0c3 100644
--- a/src/pkg/math/atan_arm.s
+++ b/src/pkg/math/atan_arm.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 TEXT ·Atan(SB),NOSPLIT,$0
 	B ·atan(SB)
diff --git a/src/pkg/math/big/arith_386.s b/src/pkg/math/big/arith_386.s
index 15b036c6578..1b47c898f91 100644
--- a/src/pkg/math/big/arith_386.s
+++ b/src/pkg/math/big/arith_386.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 // This file provides fast assembly versions for the elementary
 // arithmetic operations on vectors implemented in arith.go.
diff --git a/src/pkg/math/big/arith_amd64.s b/src/pkg/math/big/arith_amd64.s
index e2113a7e3a9..56c4cb050e4 100644
--- a/src/pkg/math/big/arith_amd64.s
+++ b/src/pkg/math/big/arith_amd64.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 // This file provides fast assembly versions for the elementary
 // arithmetic operations on vectors implemented in arith.go.
diff --git a/src/pkg/math/big/arith_amd64p32.s b/src/pkg/math/big/arith_amd64p32.s
index 227870a005e..908dbbdc585 100644
--- a/src/pkg/math/big/arith_amd64p32.s
+++ b/src/pkg/math/big/arith_amd64p32.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 TEXT ·mulWW(SB),NOSPLIT,$0
 	JMP ·mulWW_g(SB)
diff --git a/src/pkg/math/big/arith_arm.s b/src/pkg/math/big/arith_arm.s
index 8d36761c4cd..a4c51c2127f 100644
--- a/src/pkg/math/big/arith_arm.s
+++ b/src/pkg/math/big/arith_arm.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 // This file provides fast assembly versions for the elementary
 // arithmetic operations on vectors implemented in arith.go.
diff --git a/src/pkg/math/dim_386.s b/src/pkg/math/dim_386.s
index f715114c436..c8194fed83b 100644
--- a/src/pkg/math/dim_386.s
+++ b/src/pkg/math/dim_386.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 TEXT ·Dim(SB),NOSPLIT,$0
 	JMP ·dim(SB)
diff --git a/src/pkg/math/dim_amd64.s b/src/pkg/math/dim_amd64.s
index 38423ef028c..622cc3fbad3 100644
--- a/src/pkg/math/dim_amd64.s
+++ b/src/pkg/math/dim_amd64.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 #define PosInf 0x7FF0000000000000
 #define NaN    0x7FF8000000000001
diff --git a/src/pkg/math/dim_arm.s b/src/pkg/math/dim_arm.s
index 162f08cda58..be669506874 100644
--- a/src/pkg/math/dim_arm.s
+++ b/src/pkg/math/dim_arm.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 TEXT ·Dim(SB),NOSPLIT,$0
 	B ·dim(SB)
diff --git a/src/pkg/math/exp2_386.s b/src/pkg/math/exp2_386.s
index 71959d94dde..7d11920c2d4 100644
--- a/src/pkg/math/exp2_386.s
+++ b/src/pkg/math/exp2_386.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 // func Exp2(x float64) float64
 TEXT ·Exp2(SB),NOSPLIT,$0
diff --git a/src/pkg/math/exp2_amd64.s b/src/pkg/math/exp2_amd64.s
index 77a53dad4e0..903c8358964 100644
--- a/src/pkg/math/exp2_amd64.s
+++ b/src/pkg/math/exp2_amd64.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 TEXT ·Exp2(SB),NOSPLIT,$0
 	JMP ·exp2(SB)
diff --git a/src/pkg/math/exp2_arm.s b/src/pkg/math/exp2_arm.s
index fe51f25226e..58283cd0825 100644
--- a/src/pkg/math/exp2_arm.s
+++ b/src/pkg/math/exp2_arm.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 TEXT ·Exp2(SB),NOSPLIT,$0
 	B ·exp2(SB)
diff --git a/src/pkg/math/exp_386.s b/src/pkg/math/exp_386.s
index af2d680d550..6a478a5e600 100644
--- a/src/pkg/math/exp_386.s
+++ b/src/pkg/math/exp_386.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 // func Exp(x float64) float64
 TEXT ·Exp(SB),NOSPLIT,$0
diff --git a/src/pkg/math/exp_amd64.s b/src/pkg/math/exp_amd64.s
index 070b45264a8..d9cf8fd86c3 100644
--- a/src/pkg/math/exp_amd64.s
+++ b/src/pkg/math/exp_amd64.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 // The method is based on a paper by Naoki Shibata: "Efficient evaluation
 // methods of elementary functions suitable for SIMD computation", Proc.
diff --git a/src/pkg/math/exp_arm.s b/src/pkg/math/exp_arm.s
index 130b502ac17..ce36d03caa4 100644
--- a/src/pkg/math/exp_arm.s
+++ b/src/pkg/math/exp_arm.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 TEXT ·Exp(SB),NOSPLIT,$0
 	B ·exp(SB)
diff --git a/src/pkg/math/expm1_386.s b/src/pkg/math/expm1_386.s
index b268c58c638..a48ca8a58a0 100644
--- a/src/pkg/math/expm1_386.s
+++ b/src/pkg/math/expm1_386.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 // func Expm1(x float64) float64
 TEXT ·Expm1(SB),NOSPLIT,$0
diff --git a/src/pkg/math/expm1_amd64.s b/src/pkg/math/expm1_amd64.s
index 66a75b3d558..b7d5a3be013 100644
--- a/src/pkg/math/expm1_amd64.s
+++ b/src/pkg/math/expm1_amd64.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 TEXT ·Expm1(SB),NOSPLIT,$0
 	JMP ·expm1(SB)
diff --git a/src/pkg/math/expm1_arm.s b/src/pkg/math/expm1_arm.s
index 838744447f1..5f80d872f3f 100644
--- a/src/pkg/math/expm1_arm.s
+++ b/src/pkg/math/expm1_arm.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 TEXT ·Expm1(SB),NOSPLIT,$0
 	B ·expm1(SB)
diff --git a/src/pkg/math/floor_386.s b/src/pkg/math/floor_386.s
index 37d5a4559fc..31c9b174d6e 100644
--- a/src/pkg/math/floor_386.s
+++ b/src/pkg/math/floor_386.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 // func Ceil(x float64) float64
 TEXT ·Ceil(SB),NOSPLIT,$0
diff --git a/src/pkg/math/floor_amd64.s b/src/pkg/math/floor_amd64.s
index 2fd31c4fae4..67b7cdec04e 100644
--- a/src/pkg/math/floor_amd64.s
+++ b/src/pkg/math/floor_amd64.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 #define Big		0x4330000000000000 // 2**52
 
diff --git a/src/pkg/math/floor_arm.s b/src/pkg/math/floor_arm.s
index cb3b98e95c3..59091765b3b 100644
--- a/src/pkg/math/floor_arm.s
+++ b/src/pkg/math/floor_arm.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 TEXT ·Floor(SB),NOSPLIT,$0
 	B	·floor(SB)
diff --git a/src/pkg/math/frexp_386.s b/src/pkg/math/frexp_386.s
index c6d0a80edae..5bff7e21569 100644
--- a/src/pkg/math/frexp_386.s
+++ b/src/pkg/math/frexp_386.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 // func Frexp(f float64) (frac float64, exp int)
 TEXT ·Frexp(SB),NOSPLIT,$0
diff --git a/src/pkg/math/frexp_amd64.s b/src/pkg/math/frexp_amd64.s
index 03d1012433f..93a321039b8 100644
--- a/src/pkg/math/frexp_amd64.s
+++ b/src/pkg/math/frexp_amd64.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 TEXT ·Frexp(SB),NOSPLIT,$0
 	JMP ·frexp(SB)
diff --git a/src/pkg/math/frexp_arm.s b/src/pkg/math/frexp_arm.s
index 9d40ae46a66..7842eca59b5 100644
--- a/src/pkg/math/frexp_arm.s
+++ b/src/pkg/math/frexp_arm.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 TEXT ·Frexp(SB),NOSPLIT,$0
 	B ·frexp(SB)
diff --git a/src/pkg/math/hypot_386.s b/src/pkg/math/hypot_386.s
index eec1bf5548e..d321f465b4b 100644
--- a/src/pkg/math/hypot_386.s
+++ b/src/pkg/math/hypot_386.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 // func Hypot(p, q float64) float64
 TEXT ·Hypot(SB),NOSPLIT,$0
diff --git a/src/pkg/math/hypot_amd64.s b/src/pkg/math/hypot_amd64.s
index 5c0ff4dd835..a68eebc8ca6 100644
--- a/src/pkg/math/hypot_amd64.s
+++ b/src/pkg/math/hypot_amd64.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 #define PosInf 0x7FF0000000000000
 #define NaN 0x7FF8000000000001
diff --git a/src/pkg/math/hypot_arm.s b/src/pkg/math/hypot_arm.s
index 2562aa8306b..9c8abca1307 100644
--- a/src/pkg/math/hypot_arm.s
+++ b/src/pkg/math/hypot_arm.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 TEXT ·Hypot(SB),NOSPLIT,$0
 	B ·hypot(SB)
diff --git a/src/pkg/math/ldexp_386.s b/src/pkg/math/ldexp_386.s
index baf377ead61..ac8e8ba5409 100644
--- a/src/pkg/math/ldexp_386.s
+++ b/src/pkg/math/ldexp_386.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 // func Ldexp(frac float64, exp int) float64
 TEXT ·Ldexp(SB),NOSPLIT,$0
diff --git a/src/pkg/math/ldexp_amd64.s b/src/pkg/math/ldexp_amd64.s
index c7fc226efab..6063a648079 100644
--- a/src/pkg/math/ldexp_amd64.s
+++ b/src/pkg/math/ldexp_amd64.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 TEXT ·Ldexp(SB),NOSPLIT,$0
 	JMP ·ldexp(SB)
diff --git a/src/pkg/math/ldexp_arm.s b/src/pkg/math/ldexp_arm.s
index 16744ea57dc..fcffa2e0fac 100644
--- a/src/pkg/math/ldexp_arm.s
+++ b/src/pkg/math/ldexp_arm.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 TEXT ·Ldexp(SB),NOSPLIT,$0
 	B ·ldexp(SB)
diff --git a/src/pkg/math/log10_386.s b/src/pkg/math/log10_386.s
index 4ae069da62d..2897f3c1552 100644
--- a/src/pkg/math/log10_386.s
+++ b/src/pkg/math/log10_386.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 // func Log10(x float64) float64
 TEXT ·Log10(SB),NOSPLIT,$0
diff --git a/src/pkg/math/log10_amd64.s b/src/pkg/math/log10_amd64.s
index b9ae8326896..8382ba7ae59 100644
--- a/src/pkg/math/log10_amd64.s
+++ b/src/pkg/math/log10_amd64.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 TEXT ·Log10(SB),NOSPLIT,$0
 	JMP ·log10(SB)
diff --git a/src/pkg/math/log10_arm.s b/src/pkg/math/log10_arm.s
index fa7580f6fbb..dbcb8351cf0 100644
--- a/src/pkg/math/log10_arm.s
+++ b/src/pkg/math/log10_arm.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 TEXT ·Log10(SB),NOSPLIT,$0
 	B ·log10(SB)
diff --git a/src/pkg/math/log1p_386.s b/src/pkg/math/log1p_386.s
index 3b30fd5b7fb..1c2d683a8f8 100644
--- a/src/pkg/math/log1p_386.s
+++ b/src/pkg/math/log1p_386.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 // func Log1p(x float64) float64
 TEXT ·Log1p(SB),NOSPLIT,$0
diff --git a/src/pkg/math/log1p_amd64.s b/src/pkg/math/log1p_amd64.s
index 48c24f41f27..1e58fb110dc 100644
--- a/src/pkg/math/log1p_amd64.s
+++ b/src/pkg/math/log1p_amd64.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 TEXT ·Log1p(SB),NOSPLIT,$0
 	JMP ·log1p(SB)
diff --git a/src/pkg/math/log1p_arm.s b/src/pkg/math/log1p_arm.s
index fd2740d0dde..95d5496788d 100644
--- a/src/pkg/math/log1p_arm.s
+++ b/src/pkg/math/log1p_arm.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 TEXT ·Log1p(SB),NOSPLIT,$0
 	B ·log1p(SB)
diff --git a/src/pkg/math/log_386.s b/src/pkg/math/log_386.s
index 21a0633b19c..ff998afb47a 100644
--- a/src/pkg/math/log_386.s
+++ b/src/pkg/math/log_386.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 // func Log(x float64) float64
 TEXT ·Log(SB),NOSPLIT,$0
diff --git a/src/pkg/math/log_amd64.s b/src/pkg/math/log_amd64.s
index dffc5aec883..84c60ab4dee 100644
--- a/src/pkg/math/log_amd64.s
+++ b/src/pkg/math/log_amd64.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 #define HSqrt2 7.07106781186547524401e-01 // sqrt(2)/2
 #define Ln2Hi  6.93147180369123816490e-01 // 0x3fe62e42fee00000
diff --git a/src/pkg/math/log_arm.s b/src/pkg/math/log_arm.s
index 28448aeefc6..e21d0366e92 100644
--- a/src/pkg/math/log_arm.s
+++ b/src/pkg/math/log_arm.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 TEXT ·Log(SB),NOSPLIT,$0
 	B ·log(SB)
diff --git a/src/pkg/math/mod_386.s b/src/pkg/math/mod_386.s
index 9b3b6bd06fe..10ad98be3e8 100644
--- a/src/pkg/math/mod_386.s
+++ b/src/pkg/math/mod_386.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 // func Mod(x, y float64) float64
 TEXT ·Mod(SB),NOSPLIT,$0
diff --git a/src/pkg/math/mod_amd64.s b/src/pkg/math/mod_amd64.s
index bef83fcf7f7..f99dbe29312 100644
--- a/src/pkg/math/mod_amd64.s
+++ b/src/pkg/math/mod_amd64.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 TEXT ·Mod(SB),NOSPLIT,$0
 	JMP ·mod(SB)
diff --git a/src/pkg/math/mod_arm.s b/src/pkg/math/mod_arm.s
index 1f51588f8df..5afb3594dda 100644
--- a/src/pkg/math/mod_arm.s
+++ b/src/pkg/math/mod_arm.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 TEXT ·Mod(SB),NOSPLIT,$0
 	B ·mod(SB)
diff --git a/src/pkg/math/modf_386.s b/src/pkg/math/modf_386.s
index 07a0dc5cfe9..3debd3b95db 100644
--- a/src/pkg/math/modf_386.s
+++ b/src/pkg/math/modf_386.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 // func Modf(f float64) (int float64, frac float64)
 TEXT ·Modf(SB),NOSPLIT,$0
diff --git a/src/pkg/math/modf_amd64.s b/src/pkg/math/modf_amd64.s
index 05feb4bf90c..701cf72a3b4 100644
--- a/src/pkg/math/modf_amd64.s
+++ b/src/pkg/math/modf_amd64.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 TEXT ·Modf(SB),NOSPLIT,$0
 	JMP ·modf(SB)
diff --git a/src/pkg/math/modf_arm.s b/src/pkg/math/modf_arm.s
index e6bd26d53bd..ea3c8dc74f5 100644
--- a/src/pkg/math/modf_arm.s
+++ b/src/pkg/math/modf_arm.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 TEXT ·Modf(SB),NOSPLIT,$0
 	B ·modf(SB)
diff --git a/src/pkg/math/remainder_386.s b/src/pkg/math/remainder_386.s
index bbe13a0d927..318fa2c4657 100644
--- a/src/pkg/math/remainder_386.s
+++ b/src/pkg/math/remainder_386.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 // func Remainder(x, y float64) float64
 TEXT ·Remainder(SB),NOSPLIT,$0
diff --git a/src/pkg/math/remainder_amd64.s b/src/pkg/math/remainder_amd64.s
index e5e23c7ce31..f7fda99d855 100644
--- a/src/pkg/math/remainder_amd64.s
+++ b/src/pkg/math/remainder_amd64.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 TEXT ·Remainder(SB),NOSPLIT,$0
 	JMP ·remainder(SB)
diff --git a/src/pkg/math/remainder_arm.s b/src/pkg/math/remainder_arm.s
index 8728afe9310..1ae597a60e6 100644
--- a/src/pkg/math/remainder_arm.s
+++ b/src/pkg/math/remainder_arm.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 TEXT ·Remainder(SB),NOSPLIT,$0
 	B ·remainder(SB)
diff --git a/src/pkg/math/sin_386.s b/src/pkg/math/sin_386.s
index 09271c03559..ccc8e64beed 100644
--- a/src/pkg/math/sin_386.s
+++ b/src/pkg/math/sin_386.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 // func Cos(x float64) float64
 TEXT ·Cos(SB),NOSPLIT,$0
diff --git a/src/pkg/math/sin_amd64.s b/src/pkg/math/sin_amd64.s
index 008bf4be582..0c33cecef38 100644
--- a/src/pkg/math/sin_amd64.s
+++ b/src/pkg/math/sin_amd64.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 TEXT ·Sin(SB),NOSPLIT,$0
 	JMP	·sin(SB)
diff --git a/src/pkg/math/sin_arm.s b/src/pkg/math/sin_arm.s
index a057b4fc9d5..467af3dead0 100644
--- a/src/pkg/math/sin_arm.s
+++ b/src/pkg/math/sin_arm.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 TEXT ·Sin(SB),NOSPLIT,$0
 	B	·sin(SB)
diff --git a/src/pkg/math/sincos_386.s b/src/pkg/math/sincos_386.s
index bf964b16811..83af5016eff 100644
--- a/src/pkg/math/sincos_386.s
+++ b/src/pkg/math/sincos_386.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 // func Sincos(x float64) (sin, cos float64)
 TEXT ·Sincos(SB),NOSPLIT,$0
diff --git a/src/pkg/math/sincos_amd64.s b/src/pkg/math/sincos_amd64.s
index bccc1ade125..dae636b2487 100644
--- a/src/pkg/math/sincos_amd64.s
+++ b/src/pkg/math/sincos_amd64.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 // The method is based on a paper by Naoki Shibata: "Efficient evaluation
 // methods of elementary functions suitable for SIMD computation", Proc.
diff --git a/src/pkg/math/sincos_arm.s b/src/pkg/math/sincos_arm.s
index b6866af54f2..9fe048248b1 100644
--- a/src/pkg/math/sincos_arm.s
+++ b/src/pkg/math/sincos_arm.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 TEXT ·Sincos(SB),NOSPLIT,$0
 	B ·sincos(SB)
diff --git a/src/pkg/math/sqrt_386.s b/src/pkg/math/sqrt_386.s
index 2d0c786d0c2..5234a1e881e 100644
--- a/src/pkg/math/sqrt_386.s
+++ b/src/pkg/math/sqrt_386.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 // func Sqrt(x float64) float64	
 TEXT ·Sqrt(SB),NOSPLIT,$0
diff --git a/src/pkg/math/sqrt_amd64.s b/src/pkg/math/sqrt_amd64.s
index 1508944c908..443d83fe359 100644
--- a/src/pkg/math/sqrt_amd64.s
+++ b/src/pkg/math/sqrt_amd64.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 // func Sqrt(x float64) float64
 TEXT ·Sqrt(SB),NOSPLIT,$0
diff --git a/src/pkg/math/sqrt_arm.s b/src/pkg/math/sqrt_arm.s
index f731ee976d6..4f9dc2e038b 100644
--- a/src/pkg/math/sqrt_arm.s
+++ b/src/pkg/math/sqrt_arm.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 // func Sqrt(x float64) float64	
 TEXT ·Sqrt(SB),NOSPLIT,$0
diff --git a/src/pkg/math/tan_386.s b/src/pkg/math/tan_386.s
index 2320326e374..f1bdae1536b 100644
--- a/src/pkg/math/tan_386.s
+++ b/src/pkg/math/tan_386.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 // func Tan(x float64) float64
 TEXT ·Tan(SB),NOSPLIT,$0
diff --git a/src/pkg/math/tan_amd64.s b/src/pkg/math/tan_amd64.s
index 9fa5f148ef4..39aa08061ce 100644
--- a/src/pkg/math/tan_amd64.s
+++ b/src/pkg/math/tan_amd64.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 TEXT ·Tan(SB),NOSPLIT,$0
 	JMP ·tan(SB)
diff --git a/src/pkg/math/tan_arm.s b/src/pkg/math/tan_arm.s
index 68fea318da6..36c7c128f6b 100644
--- a/src/pkg/math/tan_arm.s
+++ b/src/pkg/math/tan_arm.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 TEXT ·Tan(SB),NOSPLIT,$0
 	B ·tan(SB)
diff --git a/src/pkg/os/signal/sig.s b/src/pkg/os/signal/sig.s
index f860924aa0b..d54c284b5e9 100644
--- a/src/pkg/os/signal/sig.s
+++ b/src/pkg/os/signal/sig.s
@@ -6,7 +6,7 @@
 
 // +build amd64 amd64p32 arm 386
 
-#include "../../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 #ifdef GOARCH_arm
 #define JMP B
diff --git a/src/pkg/reflect/asm_386.s b/src/pkg/reflect/asm_386.s
index a538624083f..8c84bba43bd 100644
--- a/src/pkg/reflect/asm_386.s
+++ b/src/pkg/reflect/asm_386.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 // makeFuncStub is the code half of the function returned by MakeFunc.
 // See the comment on the declaration of makeFuncStub in makefunc.go
diff --git a/src/pkg/reflect/asm_amd64.s b/src/pkg/reflect/asm_amd64.s
index 12a8879b79c..195928bff9f 100644
--- a/src/pkg/reflect/asm_amd64.s
+++ b/src/pkg/reflect/asm_amd64.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 // makeFuncStub is the code half of the function returned by MakeFunc.
 // See the comment on the declaration of makeFuncStub in makefunc.go
diff --git a/src/pkg/reflect/asm_amd64p32.s b/src/pkg/reflect/asm_amd64p32.s
index a538624083f..8c84bba43bd 100644
--- a/src/pkg/reflect/asm_amd64p32.s
+++ b/src/pkg/reflect/asm_amd64p32.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 // makeFuncStub is the code half of the function returned by MakeFunc.
 // See the comment on the declaration of makeFuncStub in makefunc.go
diff --git a/src/pkg/reflect/asm_arm.s b/src/pkg/reflect/asm_arm.s
index 69e4ab48887..fafc6f313ec 100644
--- a/src/pkg/reflect/asm_arm.s
+++ b/src/pkg/reflect/asm_arm.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 // makeFuncStub is jumped to by the code generated by MakeFunc.
 // See the comment on the declaration of makeFuncStub in makefunc.go
diff --git a/src/pkg/sync/atomic/asm_386.s b/src/pkg/sync/atomic/asm_386.s
index 807c2f873bb..740dfe76baf 100644
--- a/src/pkg/sync/atomic/asm_386.s
+++ b/src/pkg/sync/atomic/asm_386.s
@@ -4,7 +4,7 @@
 
 // +build !race
 
-#include "../../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 TEXT ·SwapInt32(SB),NOSPLIT,$0-12
 	JMP	·SwapUint32(SB)
diff --git a/src/pkg/sync/atomic/asm_amd64.s b/src/pkg/sync/atomic/asm_amd64.s
index 77afa129ed5..6e53ebedd2d 100644
--- a/src/pkg/sync/atomic/asm_amd64.s
+++ b/src/pkg/sync/atomic/asm_amd64.s
@@ -4,7 +4,7 @@
 
 // +build !race
 
-#include "../../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 TEXT ·SwapInt32(SB),NOSPLIT,$0-20
 	JMP	·SwapUint32(SB)
diff --git a/src/pkg/sync/atomic/asm_amd64p32.s b/src/pkg/sync/atomic/asm_amd64p32.s
index b24ae7a59ea..d77cc2c0888 100644
--- a/src/pkg/sync/atomic/asm_amd64p32.s
+++ b/src/pkg/sync/atomic/asm_amd64p32.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 TEXT ·SwapInt32(SB),NOSPLIT,$0-12
 	JMP	·SwapUint32(SB)
diff --git a/src/pkg/sync/atomic/asm_arm.s b/src/pkg/sync/atomic/asm_arm.s
index 7c8620a51b6..47639a80ea4 100644
--- a/src/pkg/sync/atomic/asm_arm.s
+++ b/src/pkg/sync/atomic/asm_arm.s
@@ -4,7 +4,7 @@
 
 // +build !race
 
-#include "../../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 // ARM atomic operations, for use by asm_$(GOOS)_arm.s.
 
diff --git a/src/pkg/sync/atomic/asm_freebsd_arm.s b/src/pkg/sync/atomic/asm_freebsd_arm.s
index db37f73bc44..06b975e897a 100644
--- a/src/pkg/sync/atomic/asm_freebsd_arm.s
+++ b/src/pkg/sync/atomic/asm_freebsd_arm.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 // FreeBSD/ARM atomic operations.
 // TODO(minux): this only supports ARMv6K or higher.
diff --git a/src/pkg/sync/atomic/asm_linux_arm.s b/src/pkg/sync/atomic/asm_linux_arm.s
index 27be57aa1d7..bfcfd797793 100644
--- a/src/pkg/sync/atomic/asm_linux_arm.s
+++ b/src/pkg/sync/atomic/asm_linux_arm.s
@@ -4,7 +4,7 @@
 
 // +build !race
 
-#include "../../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 // Linux/ARM atomic operations.
 
diff --git a/src/pkg/sync/atomic/asm_nacl_arm.s b/src/pkg/sync/atomic/asm_nacl_arm.s
index 084ab71f829..76f62333645 100644
--- a/src/pkg/sync/atomic/asm_nacl_arm.s
+++ b/src/pkg/sync/atomic/asm_nacl_arm.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 // NaCl/ARM atomic operations.
 // NaCl/ARM explicitly targets ARMv7A.
diff --git a/src/pkg/sync/atomic/asm_netbsd_arm.s b/src/pkg/sync/atomic/asm_netbsd_arm.s
index 64f4dbe714b..dbe80898fd4 100644
--- a/src/pkg/sync/atomic/asm_netbsd_arm.s
+++ b/src/pkg/sync/atomic/asm_netbsd_arm.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 // NetBSD/ARM atomic operations.
 // TODO(minux): this only supports ARMv6K or higher.
diff --git a/src/pkg/syscall/asm_darwin_386.s b/src/pkg/syscall/asm_darwin_386.s
index 9b4dfa81df8..dfe94fb526a 100644
--- a/src/pkg/syscall/asm_darwin_386.s
+++ b/src/pkg/syscall/asm_darwin_386.s
@@ -5,7 +5,7 @@
 // TODO(rsc): Rewrite all nn(SP) references into name+(nn-8)(FP)
 // so that go vet can check that they are correct.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 //
 // System call support for 386, Darwin
diff --git a/src/pkg/syscall/asm_darwin_amd64.s b/src/pkg/syscall/asm_darwin_amd64.s
index 19ea05be722..d6f1c96f5f3 100644
--- a/src/pkg/syscall/asm_darwin_amd64.s
+++ b/src/pkg/syscall/asm_darwin_amd64.s
@@ -5,7 +5,7 @@
 // TODO(rsc): Rewrite all nn(SP) references into name+(nn-8)(FP)
 // so that go vet can check that they are correct.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 //
 // System call support for AMD64, Darwin
diff --git a/src/pkg/syscall/asm_dragonfly_386.s b/src/pkg/syscall/asm_dragonfly_386.s
index d24216fddc2..37d655fba91 100644
--- a/src/pkg/syscall/asm_dragonfly_386.s
+++ b/src/pkg/syscall/asm_dragonfly_386.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 //
 // System call support for 386, FreeBSD
diff --git a/src/pkg/syscall/asm_dragonfly_amd64.s b/src/pkg/syscall/asm_dragonfly_amd64.s
index 31d107490ac..c8434f96b73 100644
--- a/src/pkg/syscall/asm_dragonfly_amd64.s
+++ b/src/pkg/syscall/asm_dragonfly_amd64.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 //
 // System call support for AMD64, DragonFly
diff --git a/src/pkg/syscall/asm_freebsd_386.s b/src/pkg/syscall/asm_freebsd_386.s
index 91a46b1062a..f50b5a09bfd 100644
--- a/src/pkg/syscall/asm_freebsd_386.s
+++ b/src/pkg/syscall/asm_freebsd_386.s
@@ -5,7 +5,7 @@
 // TODO(rsc): Rewrite all nn(SP) references into name+(nn-8)(FP)
 // so that go vet can check that they are correct.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 //
 // System call support for 386, FreeBSD
diff --git a/src/pkg/syscall/asm_freebsd_amd64.s b/src/pkg/syscall/asm_freebsd_amd64.s
index 7abb36828a3..58cbfe1a993 100644
--- a/src/pkg/syscall/asm_freebsd_amd64.s
+++ b/src/pkg/syscall/asm_freebsd_amd64.s
@@ -5,7 +5,7 @@
 // TODO(rsc): Rewrite all nn(SP) references into name+(nn-8)(FP)
 // so that go vet can check that they are correct.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 //
 // System call support for AMD64, FreeBSD
diff --git a/src/pkg/syscall/asm_freebsd_arm.s b/src/pkg/syscall/asm_freebsd_arm.s
index c01ce6febf5..5eb40334b98 100644
--- a/src/pkg/syscall/asm_freebsd_arm.s
+++ b/src/pkg/syscall/asm_freebsd_arm.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 //
 // System call support for ARM, FreeBSD
diff --git a/src/pkg/syscall/asm_linux_386.s b/src/pkg/syscall/asm_linux_386.s
index 30b22073df3..05cf89aa224 100644
--- a/src/pkg/syscall/asm_linux_386.s
+++ b/src/pkg/syscall/asm_linux_386.s
@@ -5,7 +5,7 @@
 // TODO(rsc): Rewrite all nn(SP) references into name+(nn-8)(FP)
 // so that go vet can check that they are correct.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 //
 // System calls for 386, Linux
diff --git a/src/pkg/syscall/asm_linux_amd64.s b/src/pkg/syscall/asm_linux_amd64.s
index 995b60ecd0b..514693283bd 100644
--- a/src/pkg/syscall/asm_linux_amd64.s
+++ b/src/pkg/syscall/asm_linux_amd64.s
@@ -5,7 +5,7 @@
 // TODO(rsc): Rewrite all nn(SP) references into name+(nn-8)(FP)
 // so that go vet can check that they are correct.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 //
 // System calls for AMD64, Linux
diff --git a/src/pkg/syscall/asm_linux_arm.s b/src/pkg/syscall/asm_linux_arm.s
index a28bc6cfc0e..014fa618f6f 100644
--- a/src/pkg/syscall/asm_linux_arm.s
+++ b/src/pkg/syscall/asm_linux_arm.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 //
 // System calls for arm, Linux
diff --git a/src/pkg/syscall/asm_nacl_386.s b/src/pkg/syscall/asm_nacl_386.s
index de7c3cc5da6..3c86decd39c 100644
--- a/src/pkg/syscall/asm_nacl_386.s
+++ b/src/pkg/syscall/asm_nacl_386.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 #include "../runtime/syscall_nacl.h"
 
 //
diff --git a/src/pkg/syscall/asm_nacl_amd64p32.s b/src/pkg/syscall/asm_nacl_amd64p32.s
index de030ec806b..b91e09bd6df 100644
--- a/src/pkg/syscall/asm_nacl_amd64p32.s
+++ b/src/pkg/syscall/asm_nacl_amd64p32.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 #include "../runtime/syscall_nacl.h"
 
 //
diff --git a/src/pkg/syscall/asm_nacl_arm.s b/src/pkg/syscall/asm_nacl_arm.s
index ffc48ceaa8f..cc4b9cd2d65 100644
--- a/src/pkg/syscall/asm_nacl_arm.s
+++ b/src/pkg/syscall/asm_nacl_arm.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 #include "../runtime/syscall_nacl.h"
 
 //
diff --git a/src/pkg/syscall/asm_netbsd_386.s b/src/pkg/syscall/asm_netbsd_386.s
index 40b30b40531..c58263254a2 100644
--- a/src/pkg/syscall/asm_netbsd_386.s
+++ b/src/pkg/syscall/asm_netbsd_386.s
@@ -5,7 +5,7 @@
 // TODO(rsc): Rewrite all nn(SP) references into name+(nn-8)(FP)
 // so that go vet can check that they are correct.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 //
 // System call support for 386, NetBSD
diff --git a/src/pkg/syscall/asm_netbsd_amd64.s b/src/pkg/syscall/asm_netbsd_amd64.s
index 94ad0284adc..8285382ce24 100644
--- a/src/pkg/syscall/asm_netbsd_amd64.s
+++ b/src/pkg/syscall/asm_netbsd_amd64.s
@@ -5,7 +5,7 @@
 // TODO(rsc): Rewrite all nn(SP) references into name+(nn-8)(FP)
 // so that go vet can check that they are correct.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 //
 // System call support for AMD64, NetBSD
diff --git a/src/pkg/syscall/asm_netbsd_arm.s b/src/pkg/syscall/asm_netbsd_arm.s
index 2c0d65401ae..b0611804917 100644
--- a/src/pkg/syscall/asm_netbsd_arm.s
+++ b/src/pkg/syscall/asm_netbsd_arm.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 //
 // System call support for ARM, NetBSD
diff --git a/src/pkg/syscall/asm_openbsd_386.s b/src/pkg/syscall/asm_openbsd_386.s
index 7dd2e373f7e..17fbb65c809 100644
--- a/src/pkg/syscall/asm_openbsd_386.s
+++ b/src/pkg/syscall/asm_openbsd_386.s
@@ -5,7 +5,7 @@
 // TODO(rsc): Rewrite all nn(SP) references into name+(nn-8)(FP)
 // so that go vet can check that they are correct.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 //
 // System call support for 386, OpenBSD
diff --git a/src/pkg/syscall/asm_openbsd_amd64.s b/src/pkg/syscall/asm_openbsd_amd64.s
index e127bf220cf..fe61482cd5c 100644
--- a/src/pkg/syscall/asm_openbsd_amd64.s
+++ b/src/pkg/syscall/asm_openbsd_amd64.s
@@ -5,7 +5,7 @@
 // TODO(rsc): Rewrite all nn(SP) references into name+(nn-8)(FP)
 // so that go vet can check that they are correct.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 //
 // System call support for AMD64, OpenBSD
diff --git a/src/pkg/syscall/asm_plan9_386.s b/src/pkg/syscall/asm_plan9_386.s
index f8c07c407af..aaa8b9a6921 100644
--- a/src/pkg/syscall/asm_plan9_386.s
+++ b/src/pkg/syscall/asm_plan9_386.s
@@ -5,7 +5,7 @@
 // TODO(rsc): Rewrite all nn(SP) references into name+(nn-8)(FP)
 // so that go vet can check that they are correct.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 //
 // System call support for 386, Plan 9
diff --git a/src/pkg/syscall/asm_plan9_amd64.s b/src/pkg/syscall/asm_plan9_amd64.s
index 220ea680022..22dc5f9576f 100644
--- a/src/pkg/syscall/asm_plan9_amd64.s
+++ b/src/pkg/syscall/asm_plan9_amd64.s
@@ -5,7 +5,7 @@
 // TODO(rsc): Rewrite all nn(SP) references into name+(nn-8)(FP)
 // so that go vet can check that they are correct.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 //
 // System call support for Plan 9
diff --git a/src/pkg/syscall/time_nacl_386.s b/src/pkg/syscall/time_nacl_386.s
index b5a22d31b5a..c0c89dccc0f 100644
--- a/src/pkg/syscall/time_nacl_386.s
+++ b/src/pkg/syscall/time_nacl_386.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 TEXT ·startTimer(SB),NOSPLIT,$0
 	JMP time·startTimer(SB)
diff --git a/src/pkg/syscall/time_nacl_amd64p32.s b/src/pkg/syscall/time_nacl_amd64p32.s
index b5a22d31b5a..c0c89dccc0f 100644
--- a/src/pkg/syscall/time_nacl_amd64p32.s
+++ b/src/pkg/syscall/time_nacl_amd64p32.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 TEXT ·startTimer(SB),NOSPLIT,$0
 	JMP time·startTimer(SB)
diff --git a/src/pkg/syscall/time_nacl_arm.s b/src/pkg/syscall/time_nacl_arm.s
index 99baaf59b62..4f4b4d89aef 100644
--- a/src/pkg/syscall/time_nacl_arm.s
+++ b/src/pkg/syscall/time_nacl_arm.s
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "../../cmd/ld/textflag.h"
+#include "textflag.h"
 
 TEXT ·startTimer(SB),NOSPLIT,$0
 	B time·startTimer(SB)
-- 
GitLab