value.h: use etext and edata which are more widely available; #5547

This commit is contained in:
Yukihiro "Matz" Matsumoto
2021-09-09 10:12:50 +09:00
parent a3fe04eda2
commit a503484cb3
+2 -4
View File
@@ -413,13 +413,11 @@ mrb_undef_value(void)
mrb_bool mrb_ro_data_p(const char *p);
#elif (defined(__linux__) && !defined(__KERNEL__))
#define MRB_LINK_TIME_RO_DATA_P
extern char __ehdr_start[];
extern char __init_array_start[];
extern char etext, edata;
static inline mrb_bool
mrb_ro_data_p(const char *p)
{
return __ehdr_start < p && p < __init_array_start;
return &etext < p && p < &edata;
}
#elif defined(__APPLE__)
#define MRB_LINK_TIME_RO_DATA_P