From f430ba5bd530c52ed3670bfb092f9aa1c4f21994 Mon Sep 17 00:00:00 2001 From: Torrekie Gen Date: Mon, 8 Apr 2024 22:29:54 +0800 Subject: [PATCH] Use Read-Only DATA (__RODATA) instead of __DATA Co-authored-by: Weijia Wang Signed-off-by: Torrekie Gen --- tests/test-runner.c | 4 ++-- tests/test-runner.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/test-runner.c b/tests/test-runner.c index 5eafe3ea..639f5a2e 100644 --- a/tests/test-runner.c +++ b/tests/test-runner.c @@ -64,8 +64,8 @@ static int timeouts_enabled = 1; static int is_atty = 0; #if __APPLE__ -extern const struct test __start_test_section __asm("section$start$__DATA$test_section"); -extern const struct test __stop_test_section __asm("section$end$__DATA$test_section"); +extern const struct test __start_test_section __asm("section$start$__RODATA$test_section"); +extern const struct test __stop_test_section __asm("section$end$__RODATA$test_section"); #else extern const struct test __start_test_section, __stop_test_section; #endif diff --git a/tests/test-runner.h b/tests/test-runner.h index 8936865b..50eff6af 100644 --- a/tests/test-runner.h +++ b/tests/test-runner.h @@ -38,7 +38,7 @@ struct test { } __attribute__ ((aligned (16))); #if __APPLE__ -#define TEST_SECTION "__DATA,test_section" +#define TEST_SECTION "__RODATA,test_section" #else #define TEST_SECTION "test_section" #endif @@ -123,4 +123,4 @@ set_cloexec_or_close(int fd) err: close(fd); return -1; -} \ No newline at end of file +}