]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/ld: fix addstrdata for big-endian systems
authorIan Lance Taylor <iant@golang.org>
Tue, 21 Oct 2014 17:10:11 +0000 (10:10 -0700)
committerIan Lance Taylor <iant@golang.org>
Tue, 21 Oct 2014 17:10:11 +0000 (10:10 -0700)
LGTM=rsc
R=minux, rsc
CC=golang-codereviews
https://golang.org/cl/158280043

src/cmd/ld/data.c

index 9983a9281cb07f6238d421719d8aa78f5ccbe35e..61847546a33d5ba95fedb5967283e7068950b377 100644 (file)
@@ -633,9 +633,7 @@ addstrdata(char *name, char *value)
        s->dupok = 1;
        reachable = s->reachable;
        addaddr(ctxt, s, sp);
-       adduint32(ctxt, s, strlen(value));
-       if(PtrSize == 8)
-               adduint32(ctxt, s, 0);  // round struct to pointer width
+       adduintxx(ctxt, s, strlen(value), PtrSize);
 
        // addstring, addaddr, etc., mark the symbols as reachable.
        // In this case that is not necessarily true, so stick to what