diff options
Diffstat (limited to 'src/liblink/asm5.c')
| -rw-r--r-- | src/liblink/asm5.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/liblink/asm5.c b/src/liblink/asm5.c index 7b4ac47e85..3947a571e5 100644 --- a/src/liblink/asm5.c +++ b/src/liblink/asm5.c @@ -1638,9 +1638,11 @@ if(0 /*debug['G']*/) print("%ux: %s: arm %d\n", (uint32)(p->pc), p->from.sym->na // runtime.tlsg is special. // 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 if it's - // typed STLSBSS. - if(rel->sym == ctxt->tlsg && ctxt->tlsg->type == STLSBSS) { + // Emit a TLS relocation instead of a standard one if its + // type is not explicitly set by runtime. This assumes that + // all references to runtime.tlsg should be accompanied with + // its type declaration if necessary. + if(rel->sym == ctxt->tlsg && ctxt->tlsg->type == 0) { rel->type = R_TLS; if(ctxt->flag_shared) rel->add += ctxt->pc - p->pcrel->pc - 8 - rel->siz; |
