diff options
| author | Austin Clements <austin@google.com> | 2014-12-16 14:12:01 -0500 |
|---|---|---|
| committer | Austin Clements <austin@google.com> | 2015-01-07 20:35:13 +0000 |
| commit | fcdffb3f334ae4bfa5fda2c01b3cc51c3c4e5715 (patch) | |
| tree | 9ef6e328e41335942e9e8dba89a5f64bf06f0fab /src/cmd/ld/data.c | |
| parent | e32fe2049d41cefabe0380212beb2aea86a1789b (diff) | |
| download | go-fcdffb3f334ae4bfa5fda2c01b3cc51c3c4e5715.tar.xz | |
cmd/ld: support 2 byte relocations
ppc64 has a bunch of these.
Change-Id: I3b93ed2bae378322a8dec036b1681e520b56ff53
Reviewed-on: https://go-review.googlesource.com/2003
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Minux Ma <minux@golang.org>
Diffstat (limited to 'src/cmd/ld/data.c')
| -rw-r--r-- | src/cmd/ld/data.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/cmd/ld/data.c b/src/cmd/ld/data.c index 92c6fb57ce..3cf0bbdfe1 100644 --- a/src/cmd/ld/data.c +++ b/src/cmd/ld/data.c @@ -132,6 +132,7 @@ relocsym(LSym *s) { Reloc *r; LSym *rs; + int16 i16; int32 i, off, siz, fl; vlong o; uchar *cast; @@ -317,6 +318,14 @@ relocsym(LSym *s) // TODO(rsc): Remove. s->p[off] = (int8)o; break; + case 2: + if(o != (int16)o) + diag("relocation address is too big: %#llx", o); + i16 = o; + cast = (uchar*)&i16; + for(i=0; i<2; i++) + s->p[off+i] = cast[inuxi2[i]]; + break; case 4: if(r->type == R_PCREL || r->type == R_CALL) { if(o != (int32)o) |
