diff options
author | Alex Brainman <alex.brainman@gmail.com> | 2018-06-02 15:35:25 +1000 |
---|---|---|
committer | Alex Brainman <alex.brainman@gmail.com> | 2018-06-09 07:34:45 +0000 |
commit | d67db881465320b46e8142d5eac1b808c3ac659d (patch) | |
tree | 869fb82905e55e4b4d0feea3a4bcac4b25e2eff6 /src/cmd/nm | |
parent | 1f137052e4a20dbd302f947b1cf34cdf4b427d65 (diff) | |
download | go-d67db881465320b46e8142d5eac1b808c3ac659d.tar.gz go-d67db881465320b46e8142d5eac1b808c3ac659d.zip |
cmd/link: split pe .text section into .text and .rdata
Fixes #24725
Change-Id: I2864b88315ab15be036e8940d0a5884d876698d6
Reviewed-on: https://go-review.googlesource.com/115975
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/cmd/nm')
-rw-r--r-- | src/cmd/nm/nm_test.go | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/cmd/nm/nm_test.go b/src/cmd/nm/nm_test.go index 4be5d0e74e..890df0f902 100644 --- a/src/cmd/nm/nm_test.go +++ b/src/cmd/nm/nm_test.go @@ -126,6 +126,15 @@ func testGoExec(t *testing.T, iscgo, isexternallinker bool) { names["main."+f[0]] = f[1] } + runtimeSyms := map[string]string{ + "runtime.text": "T", + "runtime.etext": "T", + "runtime.rodata": "R", + "runtime.erodata": "R", + "runtime.epclntab": "R", + "runtime.noptrdata": "D", + } + out, err = exec.Command(testnmpath, exe).CombinedOutput() if err != nil { t.Fatalf("go tool nm: %v\n%s", err, string(out)) @@ -147,6 +156,12 @@ func testGoExec(t *testing.T, iscgo, isexternallinker bool) { if _, found := dups[name]; found { t.Errorf("duplicate name of %q is found", name) } + if stype, found := runtimeSyms[name]; found { + if want, have := stype, strings.ToUpper(f[1]); have != want { + t.Errorf("want %s type for %s symbol, but have %s", want, name, have) + } + delete(runtimeSyms, name) + } } err = scanner.Err() if err != nil { @@ -155,6 +170,9 @@ func testGoExec(t *testing.T, iscgo, isexternallinker bool) { if len(names) > 0 { t.Errorf("executable is missing %v symbols", names) } + if len(runtimeSyms) > 0 { + t.Errorf("executable is missing %v symbols", runtimeSyms) + } } func TestGoExec(t *testing.T) { |