mirror of
https://github.com/golang/go
synced 2024-11-20 01:14:40 -07:00
cmd/ld: take section symbols' value into account for PE
ld -r could generate multiple section symbols for the same section, but with different values, we have to take that into account. Fixes #3322. Part of issue 3261. For CL 5822049. R=golang-dev, iant, rsc, iant CC=golang-dev https://golang.org/cl/5823059
This commit is contained in:
parent
090f9fc3ef
commit
1c4b77a7c8
@ -300,6 +300,11 @@ ldpe(Biobuf *f, char *pkg, int64 len, char *pn)
|
||||
rp->add = le64(rsect->base+rp->off);
|
||||
break;
|
||||
}
|
||||
// ld -r could generate multiple section symbols for the
|
||||
// same section but with different values, we have to take
|
||||
// that into account
|
||||
if (obj->pesym[symindex].name[0] == '.')
|
||||
rp->add += obj->pesym[symindex].value;
|
||||
}
|
||||
qsort(r, rsect->sh.NumberOfRelocations, sizeof r[0], rbyoff);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user