aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/newlink/testdata/layout.s
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2015-05-21 13:28:06 -0400
committerRuss Cox <rsc@golang.org>2015-05-21 17:31:40 +0000
commit2a141dedc4bb7b33f5caee6e7b185dfbd20c92bc (patch)
treee3a24653ae2a9a1eac780c1d57adc7dd68b879b6 /src/cmd/newlink/testdata/layout.s
parentbe59731d9fffb53a499d1ae64863e2a380f2dede (diff)
downloadgo-2a141dedc4bb7b33f5caee6e7b185dfbd20c92bc.tar.xz
cmd/link: move to cmd/newlink
In preparation for making the current linker cmd/link. If cmd/newlink is ever completed, it can be moved back. See golang-dev thread titled "go tool compile, etc" for background. Change-Id: I4029580f470038240c5181a37ea4202ba971f9ef Reviewed-on: https://go-review.googlesource.com/10286 Reviewed-by: Rob Pike <r@golang.org>
Diffstat (limited to 'src/cmd/newlink/testdata/layout.s')
-rw-r--r--src/cmd/newlink/testdata/layout.s29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/cmd/newlink/testdata/layout.s b/src/cmd/newlink/testdata/layout.s
new file mode 100644
index 0000000000..c3e55ef49a
--- /dev/null
+++ b/src/cmd/newlink/testdata/layout.s
@@ -0,0 +1,29 @@
+// Copyright 2014 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// 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 "textflag.h"
+
+TEXT text_start(SB),7,$0
+ MOVQ $rodata_sym(SB), AX
+ MOVQ $noptrdata_sym(SB), AX
+ MOVQ $data_sym(SB), AX
+ MOVQ $bss_sym(SB), AX
+ MOVQ $noptrbss_sym(SB), AX
+ RET
+
+DATA rodata_sym(SB)/4, $1
+GLOBL rodata_sym(SB), RODATA, $4
+
+DATA noptrdata_sym(SB)/4, $1
+GLOBL noptrdata_sym(SB), NOPTR, $4
+
+DATA data_sym(SB)/4, $1
+GLOBL data_sym(SB), $4
+
+GLOBL bss_sym(SB), $4
+
+GLOBL noptrbss_sym(SB), NOPTR, $4