Commit 1c4b77a7 authored by Shenghou Ma's avatar Shenghou Ma

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
parent 090f9fc3
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment