From: Konstantin Demin rockdrilla@gmail.com
these changes improve building Wine with LTO.
Signed-off-by: Konstantin Demin rockdrilla@gmail.com --- loader/preloader.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/loader/preloader.c b/loader/preloader.c index ce82a9f296f..12d76546c79 100644 --- a/loader/preloader.c +++ b/loader/preloader.c @@ -181,6 +181,7 @@ void __bb_init_func(void) { return; }
static int thread_data[256];
+__attribute__((used)) struct { /* this is the kernel modify_ldt struct */ @@ -335,7 +336,7 @@ static inline int wld_prctl( int code, long arg )
#elif defined(__x86_64__)
-void *thread_data[256]; +void __attribute__((used)) *thread_data[256];
/* * The _start function is the entry and exit point of this program @@ -424,7 +425,7 @@ SYSCALL_NOERR( wld_getegid, 108 /* SYS_getegid */ );
#elif defined(__aarch64__)
-void *thread_data[256]; +void __attribute__((used)) *thread_data[256];
/* * The _start function is the entry and exit point of this program @@ -531,7 +532,7 @@ SYSCALL_NOERR( wld_getegid, 177 /* SYS_getegid */ );
#elif defined(__arm__)
-void *thread_data[256]; +void __attribute__((used)) *thread_data[256];
/* * The _start function is the entry and exit point of this program @@ -630,7 +631,7 @@ SYSCALL_NOERR( wld_geteuid, 49 /* SYS_geteuid */ ); gid_t wld_getegid(void); SYSCALL_NOERR( wld_getegid, 50 /* SYS_getegid */ );
-unsigned long long __aeabi_uidivmod(unsigned int num, unsigned int den) +unsigned long long __attribute__((used)) __aeabi_uidivmod(unsigned int num, unsigned int den) { unsigned int bit = 1; unsigned int quota = 0; @@ -1397,7 +1398,7 @@ static void set_process_name( int argc, char *argv[] ) * Load the binary and then its ELF interpreter. * Note, we assume that the binary is a dynamically linked ELF shared object. */ -void* wld_start( void **stack ) +void* __attribute__((used)) wld_start( void **stack ) { long i, *pargc; char **argv, **p;