From e13063aad7aee341d278d2a879a76ec7b59b2ad8 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Fri, 14 Sep 2018 23:08:53 -0400 Subject: add hidden version of &errno accessor function this significantly improves codegen in functions that need to access errno but otherwise have no need for a GOT pointer. we could probably improve it much more by including an inline version of the &errno accessor function, but that depends on having the definitions of struct __pthread and __pthread_self(), which at present would expose a lot more than is appropriate. moving them to a small tls.h later might make this more reasonable. --- src/include/errno.h | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 src/include/errno.h (limited to 'src/include') diff --git a/src/include/errno.h b/src/include/errno.h new file mode 100644 index 00000000..54a38ff4 --- /dev/null +++ b/src/include/errno.h @@ -0,0 +1,11 @@ +#ifndef ERRNO_H +#define ERRNO_H + +#include "../../include/errno.h" + +hidden int *___errno_location(void); + +#undef errno +#define errno (*___errno_location()) + +#endif -- cgit v1.2.1