This reverts commit 4bc4c9584a13736c20855cdea2203d3bd0a259a3.
We can re-enable BTI now, since the stock `as` in OpenBSD 7.5 seems to
support it:
qbe $ ./qbe test/tls.ssa > /tmp/tls.s
qbe $ grep endbr64 /tmp/tls.s | uniq -c
6 endbr64
qbe $ as /tmp/tls.s -o /tmp/tls.o
qbe $ ls -al /tmp/tls.o
-rw-r--r-- 1 w wheel 2312 Apr 19 06:57 /tmp/tls.o
isel4.ssa and tls.ssa currently fail with SIGILL on my machine. This
commit fixes that.
Hi, do you think we could use .cfi_startproc uniformly across
all targets and let the assembler emit the right instructions?
---
amd64/emit.c | 2 +-
arm64/emit.c | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/amd64/emit.c b/amd64/emit.c
index 9636209..65fc9dc 100644
--- a/amd64/emit.c
+++ b/amd64/emit.c
@@ -581,7 +581,7 @@ amd64_emitfn(Fn *fn, FILE *f)
uint64_t fs;
emitfnlnk(fn->name, &fn->lnk, f);
- fputs("\tpushq %rbp\n\tmovq %rsp, %rbp\n", f);
+ fputs("\tendbr64\n\tpushq %rbp\n\tmovq %rsp, %rbp\n", f);
fs = framesz(fn);
if (fs)
fprintf(f, "\tsubq $%"PRIu64", %%rsp\n", fs);
diff --git a/arm64/emit.c b/arm64/emit.c
index 990d839..6363271 100644
--- a/arm64/emit.c
+++ b/arm64/emit.c
@@ -514,6 +514,7 @@ arm64_emitfn(Fn *fn, FILE *out)
if (T.apple)
e->fn->lnk.align = 4;
emitfnlnk(e->fn->name, &e->fn->lnk, e->f);
+ fputs("\thint\t#34\n", e->f);
framelayout(e);
if (e->fn->vararg && !T.apple) {
--
2.44.0