]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/ld: skip R_*_NONE relocations, fix Linux/386 build again
authorShenghou Ma <minux.ma@gmail.com>
Mon, 20 Aug 2012 16:34:06 +0000 (00:34 +0800)
committerShenghou Ma <minux.ma@gmail.com>
Mon, 20 Aug 2012 16:34:06 +0000 (00:34 +0800)
The last fix was wrong w.r.t C's operator precedence,
and it also failed to really skip the NONE relocation.

The offending R_386_NONE relocation is a absolute
relocation in section .eh_frame.

TBR=golang-dev
CC=golang-dev
https://golang.org/cl/6463058

src/cmd/ld/ldelf.c

index 6376d9370ef065559d4d06db0ab48de82a99e7af..f6da33341cc73692270f06a1448b564d2856738d 100644 (file)
@@ -658,8 +658,11 @@ ldelf(Biobuf *f, char *pkg, int64 len, char *pn)
                                        p += 4;
                                }
                        }
-                       if(info & 0xffffffff == 0) // R_*_NONE relocation
+                       if((info & 0xffffffff) == 0) { // skip R_*_NONE relocation
+                               j--;
+                               n--;
                                continue;
+                       }
                        if((info >> 32) == 0) { // absolute relocation, don't bother reading the null symbol
                                rp->sym = S;
                        } else {