change errno to static linkage (improves PIC code generation)
authorRich Felker <dalias@aerifal.cx>
Tue, 22 Feb 2011 04:00:52 +0000 (23:00 -0500)
committerRich Felker <dalias@aerifal.cx>
Tue, 22 Feb 2011 04:00:52 +0000 (23:00 -0500)
src/errno/__errno_location.c

index 0a220b6383a6d1ff547164c34c075b4614cd65c7..a0185780c531cc2a21edf9b0d059eac1b4c6c071 100644 (file)
@@ -1,11 +1,9 @@
 #include <errno.h>
 #include "libc.h"
 
-#undef errno
-int errno;
-
 int *__errno_location(void)
 {
+       static int e;
        if (libc.errno_location) return libc.errno_location();
-       return &errno;
+       return &e;
 }