]> Cypherpunks.ru repositories - gostls13.git/commitdiff
make 5l ignore multiple defs, remove use of multiple
authorKai Backman <kaib@golang.org>
Sun, 25 Oct 2009 18:59:58 +0000 (11:59 -0700)
committerKai Backman <kaib@golang.org>
Sun, 25 Oct 2009 18:59:58 +0000 (11:59 -0700)
        defs from embed1 and gotest

R=rsc
http://go/go-review/1014009

src/cmd/5l/obj.c
src/cmd/gotest/gotest
test/interface/embed1.go

index 45751e8c5eeec3b98fbef1f30fa13da712d8c018..805d39544eee06b6424858637eae48109e551424 100644 (file)
@@ -432,9 +432,11 @@ ldobj1(Biobuf *f, int64 len, char *pn)
        int v, o, r, skip;
        uint32 sig;
        char *name;
+       int ntext;
        int32 eof;
        char src[1024];
 
+       ntext = 0;
        eof = Boffset(f) + len;
        di = S;
        src[0] = 0;
@@ -657,6 +659,13 @@ loop:
                break;
 
        case ATEXT:
+               s = p->from.sym;
+               if(ntext++ == 0 && s->type != 0 && s->type != SXREF) {
+                       /* redefinition, so file has probably been seen before */
+                       if(debug['v'])
+                               Bprint(&bso, "skipping: %s: redefinition: %s", pn, s->name);
+                       return;
+               }
                setarch(p);
                setthumb(p);
                p->align = 4;
index 212abbf755106598fcd68e62e459d1c4cc894eac..e274ef9b813efbef5de87d77da1d52aa02b9adb6 100755 (executable)
@@ -22,6 +22,12 @@ nacl)
        E="nacl"
 esac
 
+# TODO(kaib): proper emulator strategy
+case x"$GOARCH" in
+xarm)
+       E="qemu-arm -cpu cortex-a8"
+esac
+
 # Allow overrides
 GC=${_GC:-$GC}
 GL=${GL:-$LD}
@@ -131,5 +137,5 @@ importpath=$(make -s importpath)
 }>_testmain.go
 
 $GC _testmain.go
-$GL _testmain.$O _test/$importpath.a $xofile
+$GL _testmain.$O
 $E ./$O.out "$@"
index b3fe06f47bfb8059f16306b4d5b35825c153983c..6e15031eab1c45b569a5336e23b0f81a12f791e5 100644 (file)
@@ -1,4 +1,4 @@
-// $G $D/embed0.go && $G $D/$F.go && $L embed0.$A $F.$A && ./$A.out
+// $G $D/embed0.go && $G $D/$F.go && $L $F.$A && ./$A.out
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style