From b1532344ef58fe644c85bbc6e268102528d39c61 Mon Sep 17 00:00:00 2001 From: Shenghou Ma Date: Tue, 21 Aug 2012 00:34:06 +0800 Subject: [PATCH] cmd/ld: skip R_*_NONE relocations, fix Linux/386 build again 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 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/cmd/ld/ldelf.c b/src/cmd/ld/ldelf.c index 6376d9370e..f6da33341c 100644 --- a/src/cmd/ld/ldelf.c +++ b/src/cmd/ld/ldelf.c @@ -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 { -- 2.48.1