aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/ld/lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/ld/lib.c')
-rw-r--r--src/cmd/ld/lib.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/cmd/ld/lib.c b/src/cmd/ld/lib.c
index 72c903b4d2..200c96da96 100644
--- a/src/cmd/ld/lib.c
+++ b/src/cmd/ld/lib.c
@@ -269,11 +269,13 @@ loadlib(void)
tlsg = linklookup(ctxt, "runtime.tlsg", 0);
// For most ports, runtime.tlsg is a placeholder symbol for TLS
- // relocation. However, the Android and Darwin ports need it to
- // be a real variable. Instead of hard-coding which platforms
- // need it to be a real variable, we set the type to STLSBSS only
- // when the runtime has not declared its type already.
- if(tlsg->type == 0)
+ // relocation. However, the Android and Darwin arm ports need it
+ // to be a real variable.
+ //
+ // TODO(crawshaw): android should require leaving the tlsg->type
+ // alone (as the runtime-provided SNOPTRBSS) just like darwin/arm.
+ // But some other part of the linker is expecting STLSBSS.
+ if (!(strcmp(goos, "darwin") == 0 && thearch.thechar == '5'))
tlsg->type = STLSBSS;
tlsg->size = thearch.ptrsize;
tlsg->hide = 1;