summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2021-10-20 06:54:34 -0700
committerKarl Berry <karl@freefriends.org>2021-10-20 06:54:34 -0700
commit4aaab7c66cf7711863f1023f3670627c07394ef5 (patch)
tree074c86dcf0b5fb6b8c0918f8c6e8900906eaef70 /lib
parent107c945430f8479c98dbfcc2b6947fb22fc7a4b5 (diff)
downloadgnulib-4aaab7c66cf7711863f1023f3670627c07394ef5.tar.gz
autoupdate
Diffstat (limited to 'lib')
-rw-r--r--lib/cdefs.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/cdefs.h b/lib/cdefs.h
index 4dac9d264d..f6ab95ab81 100644
--- a/lib/cdefs.h
+++ b/lib/cdefs.h
@@ -605,12 +605,22 @@ _Static_assert (0, "IEEE 128-bits long double requires redirection on this platf
size-index is not provided:
access (access-mode, <ref-index> [, <size-index>]) */
# define __attr_access(x) __attribute__ ((__access__ x))
+/* For _FORTIFY_SOURCE == 3 we use __builtin_dynamic_object_size, which may
+ use the access attribute to get object sizes from function definition
+ arguments, so we can't use them on functions we fortify. Drop the object
+ size hints for such functions. */
+# if __USE_FORTIFY_LEVEL == 3
+# define __fortified_attr_access(a, o, s) __attribute__ ((__access__ (a, o)))
+# else
+# define __fortified_attr_access(a, o, s) __attr_access ((a, o, s))
+# endif
# if __GNUC_PREREQ (11, 0)
# define __attr_access_none(argno) __attribute__ ((__access__ (__none__, argno)))
# else
# define __attr_access_none(argno)
# endif
#else
+# define __fortified_attr_access(a, o, s)
# define __attr_access(x)
# define __attr_access_none(argno)
#endif