summaryrefslogtreecommitdiff
path: root/src/liblink/asm5.c
diff options
context:
space:
mode:
authorElias Naur <elias.naur@gmail.com>2014-02-03 14:49:57 -0800
committerElias Naur <elias.naur@gmail.com>2014-02-03 14:49:57 -0800
commitfe3301ba65ac4434ea9556f2ddd39198e9534105 (patch)
treef1ed9c9f14fb630bee9b5655fdb3f74d40b3e13f /src/liblink/asm5.c
parent70a195094ee9d393ef3da734f47370625e2a48df (diff)
downloadgo-fe3301ba65ac4434ea9556f2ddd39198e9534105.tar.gz
liblink, cmd/5l: restore flag_shared
CL 56120043 fixed and cleaned up TLS on ARM after introducing liblink, but left flag_shared broken. This CL restores the (unsupported) flag_shared behaviour by simply rewriting access to $runtime.tlsgm(SB) with runtime.tlsgm(SB), to compensate for the extra indirection when going from the R_ARM_TLS_LE32 relocation to the R_ARM_TLS_IE32 relocation. Also, remove unnecessary symbol lookup left after 56120043. LGTM=iant R=iant, rsc CC=golang-codereviews https://codereview.appspot.com/57000043 Committer: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/liblink/asm5.c')
-rw-r--r--src/liblink/asm5.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/liblink/asm5.c b/src/liblink/asm5.c
index d19283a19..02b6e8e46 100644
--- a/src/liblink/asm5.c
+++ b/src/liblink/asm5.c
@@ -1371,11 +1371,10 @@ if(0 /*debug['G']*/) print("%ux: %s: arm %d\n", (uint32)(p->pc), p->from.sym->na
// Its "address" is the offset from the TLS thread pointer
// to the thread-local g and m pointers.
// Emit a TLS relocation instead of a standard one.
- // The TLS flag_shared case is not tested and probably now wrong.
if(rel->sym == ctxt->gmsym) {
rel->type = D_TLS;
if(ctxt->flag_shared)
- rel->add += ctxt->pc - p->pcrel->pc - 8 - rel->siz; // TODO: probably wrong
+ rel->add += ctxt->pc - p->pcrel->pc - 8 - rel->siz;
rel->xadd = rel->add;
rel->xsym = rel->sym;
} else if(ctxt->flag_shared) {