aboutsummaryrefslogtreecommitdiff
path: root/src/cmd
diff options
context:
space:
mode:
authorAustin Clements <austin@google.com>2014-12-16 14:01:08 -0500
committerAustin Clements <austin@google.com>2015-01-07 20:34:55 +0000
commite32fe2049d41cefabe0380212beb2aea86a1789b (patch)
tree26a9428fa44b4219345648e776e4157b799f51e7 /src/cmd
parentec767c10b30819d907b010a8cfb4831420db7718 (diff)
downloadgo-e32fe2049d41cefabe0380212beb2aea86a1789b.tar.xz
cmd/ld: decode local entry offset from ppc64 symbols
ppc64 function symbols have both a global entry point and a local entry point, where the difference is stashed in sym.other. We'll need this information to generate calls to ELF ABI functions. Change-Id: Ibe343923f56801de7ebec29946c79690a9ffde57 Reviewed-on: https://go-review.googlesource.com/2002 Reviewed-by: Russ Cox <rsc@golang.org> Reviewed-by: Minux Ma <minux@golang.org>
Diffstat (limited to 'src/cmd')
-rw-r--r--src/cmd/ld/ldelf.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/cmd/ld/ldelf.c b/src/cmd/ld/ldelf.c
index 894b9ee2f4..90da4aeb8f 100644
--- a/src/cmd/ld/ldelf.c
+++ b/src/cmd/ld/ldelf.c
@@ -327,7 +327,7 @@ ldelf(Biobuf *f, char *pkg, int64 len, char *pn)
int32 base;
uint64 add, info;
char *name;
- int i, j, rela, is64, n;
+ int i, j, rela, is64, n, flag;
uchar hdrbuf[64];
uchar *p;
ElfHdrBytes *hdr;
@@ -616,6 +616,13 @@ ldelf(Biobuf *f, char *pkg, int64 len, char *pn)
diag("%s: duplicate definition of %s", pn, s->name);
s->external = 1;
}
+ if(obj->machine == ElfMachPower64) {
+ flag = sym.other >> 5;
+ if(2 <= flag && flag <= 6)
+ s->localentry = 1 << (flag - 2);
+ else if(flag == 7)
+ diag("%s: invalid sym.other 0x%x for %s", pn, sym.other, s->name);
+ }
}
// Sort outer lists by address, adding to textp.