From d605d75ba8b09e714abb88147dacf39471e201cc Mon Sep 17 00:00:00 2001 From: herman ten brugge Date: Fri, 18 Nov 2022 01:56:46 -0600 Subject: [PATCH] Fix stab support for apple --- tccelf.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tccelf.c b/tccelf.c index bd210e89..8e78763a 100644 --- a/tccelf.c +++ b/tccelf.c @@ -1584,6 +1584,11 @@ ST_FUNC void tcc_add_btstub(TCCState *s1) section_ptr_add(s, 3 * PTR_SIZE); /* prog_base : local nameless symbol with offset 0 at SHN_ABS */ put_ptr(s1, NULL, 0); +#if defined TCC_TARGET_MACHO + /* adjust for __PAGEZERO */ + write64le(data_section->data + data_section->data_offset - PTR_SIZE, + (uint64_t)1 << 32); +#endif n = 2 * PTR_SIZE; #ifdef CONFIG_TCC_BCHECK if (s1->do_bounds_check) {