summary refs log tree commit diff
path: root/amd64/emit.c
diff options
context:
space:
mode:
Diffstat (limited to 'amd64/emit.c')
-rw-r--r--amd64/emit.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/amd64/emit.c b/amd64/emit.c
index 84714e8..37dd1e9 100644
--- a/amd64/emit.c
+++ b/amd64/emit.c
@@ -167,9 +167,12 @@ emitcon(Con *con, FILE *f)
 	case CAddr:
 		l = str(con->label);
 		p = l[0] == '"' ? "" : T.assym;
-		if (con->reloc == RelThr)
-			fprintf(f, "%%fs:%s%s@tpoff", p, l);
-		else
+		if (con->reloc == RelThr) {
+			if (T.apple)
+				fprintf(f, "%s%s@TLVP", p, l);
+			else
+				fprintf(f, "%%fs:%s%s@tpoff", p, l);
+		} else
 			fprintf(f, "%s%s", p, l);
 		if (con->bits.i)
 			fprintf(f, "%+"PRId64, con->bits.i);
@@ -340,7 +343,8 @@ Next:
 		case RCon:
 			off = fn->con[ref.val];
 			emitcon(&off, f);
-			if (off.type == CAddr && off.reloc != RelThr)
+			if (off.type == CAddr)
+			if (off.reloc != RelThr || T.apple)
 				fprintf(f, "(%%rip)");
 			break;
 		case RTmp: