From bff32ce4d5a22fe7664f77c96f281fe3b02a9c75 Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Thu, 15 Mar 2007 19:48:35 +0000 Subject: gzip: Improve ptr_to_globals trick, allowing gcc to optimize better. -480 bytes. --- include/libbb.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/libbb.h b/include/libbb.h index 90fb0ad91..d68519dfa 100644 --- a/include/libbb.h +++ b/include/libbb.h @@ -804,7 +804,10 @@ extern char bb_common_bufsiz1[BUFSIZ+1]; /* This struct is deliberately not defined. */ /* See docs/keep_data_small.txt */ struct globals; -extern struct globals *ptr_to_globals; +/* Magic prevents this from going into rodata */ +/* If you want to assign a value, use PTR_TO_GLOBALS = xxx */ +extern struct globals *const ptr_to_globals; +#define PTR_TO_GLOBALS (*(struct globals**)&ptr_to_globals) /* You can change LIBBB_DEFAULT_LOGIN_SHELL, but don't use it, * use bb_default_login_shell and following defines. -- cgit v1.2.3