summaryrefslogtreecommitdiff
path: root/src/cmd
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2014-10-06 14:45:36 -0400
committerRuss Cox <rsc@golang.org>2014-10-06 14:45:36 -0400
commitdebf5b7b4fdf985bb292afea65ce6dba6cfaecbb (patch)
treed2ff694c0e7b60e139bda86fe0b00a502457ed7c /src/cmd
parentf85d9767d353a27de22f648b7bc6312b040c0c4e (diff)
parent7ad347e9e6e3bc5723b709768c87e87bd4c7493c (diff)
downloadgo-debf5b7b4fdf985bb292afea65ce6dba6cfaecbb.tar.gz
[dev.garbage] all: merge default into dev.garbage
This picks up the TestDualStackUDPListener fix. LGTM=rlh R=rlh CC=golang-codereviews https://codereview.appspot.com/147660044
Diffstat (limited to 'src/cmd')
-rw-r--r--src/cmd/8l/asm.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/cmd/8l/asm.c b/src/cmd/8l/asm.c
index c135dce70..98c042403 100644
--- a/src/cmd/8l/asm.c
+++ b/src/cmd/8l/asm.c
@@ -117,13 +117,21 @@ adddynrel(LSym *s, Reloc *r)
case 256 + R_386_GOT32:
if(targ->type != SDYNIMPORT) {
// have symbol
- // turn MOVL of GOT entry into LEAL of symbol itself
- if(r->off < 2 || s->p[r->off-2] != 0x8b) {
- diag("unexpected GOT reloc for non-dynamic symbol %s", targ->name);
+ if(r->off >= 2 && s->p[r->off-2] == 0x8b) {
+ // turn MOVL of GOT entry into LEAL of symbol address, relative to GOT.
+ s->p[r->off-2] = 0x8d;
+ r->type = R_GOTOFF;
return;
}
- s->p[r->off-2] = 0x8d;
- r->type = R_GOTOFF;
+ if(r->off >= 2 && s->p[r->off-2] == 0xff && s->p[r->off-1] == 0xb3) {
+ // turn PUSHL of GOT entry into PUSHL of symbol itself.
+ // use unnecessary SS prefix to keep instruction same length.
+ s->p[r->off-2] = 0x36;
+ s->p[r->off-1] = 0x68;
+ r->type = R_ADDR;
+ return;
+ }
+ diag("unexpected GOT reloc for non-dynamic symbol %s", targ->name);
return;
}
addgotsym(ctxt, targ);