diff options
Diffstat (limited to 'coreutils/test.c')
| -rw-r--r-- | coreutils/test.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/coreutils/test.c b/coreutils/test.c index 2f5b6b8a1..3c725a245 100644 --- a/coreutils/test.c +++ b/coreutils/test.c | |||
| @@ -159,7 +159,7 @@ typedef int arith_t; | |||
| 159 | 159 | ||
| 160 | 160 | ||
| 161 | /* We try to minimize both static and stack usage. */ | 161 | /* We try to minimize both static and stack usage. */ |
| 162 | struct statics { | 162 | struct test_statics { |
| 163 | char **t_wp; | 163 | char **t_wp; |
| 164 | const struct t_op *t_wp_op; | 164 | const struct t_op *t_wp_op; |
| 165 | gid_t *group_array; | 165 | gid_t *group_array; |
| @@ -167,11 +167,10 @@ struct statics { | |||
| 167 | jmp_buf leaving; | 167 | jmp_buf leaving; |
| 168 | }; | 168 | }; |
| 169 | 169 | ||
| 170 | /* Make it reside in writable memory, yet make compiler understand | 170 | /* See test_ptr_hack.c */ |
| 171 | * that it is not going to change. */ | 171 | extern struct test_statics *const test_ptr_to_statics; |
| 172 | static struct statics *const ptr_to_statics __attribute__ ((section (".data"))); | ||
| 173 | 172 | ||
| 174 | #define S (*ptr_to_statics) | 173 | #define S (*test_ptr_to_statics) |
| 175 | #define t_wp (S.t_wp ) | 174 | #define t_wp (S.t_wp ) |
| 176 | #define t_wp_op (S.t_wp_op ) | 175 | #define t_wp_op (S.t_wp_op ) |
| 177 | #define group_array (S.group_array ) | 176 | #define group_array (S.group_array ) |
| @@ -179,11 +178,11 @@ static struct statics *const ptr_to_statics __attribute__ ((section (".data"))); | |||
| 179 | #define leaving (S.leaving ) | 178 | #define leaving (S.leaving ) |
| 180 | 179 | ||
| 181 | #define INIT_S() do { \ | 180 | #define INIT_S() do { \ |
| 182 | (*(struct statics**)&ptr_to_statics) = xzalloc(sizeof(S)); \ | 181 | (*(struct test_statics**)&test_ptr_to_statics) = xzalloc(sizeof(S)); \ |
| 183 | barrier(); \ | 182 | barrier(); \ |
| 184 | } while (0) | 183 | } while (0) |
| 185 | #define DEINIT_S() do { \ | 184 | #define DEINIT_S() do { \ |
| 186 | free(ptr_to_statics); \ | 185 | free(test_ptr_to_statics); \ |
| 187 | } while (0) | 186 | } while (0) |
| 188 | 187 | ||
| 189 | static arith_t primary(enum token n); | 188 | static arith_t primary(enum token n); |
