]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
libio: adjust _IO_FILE / _IO_FILE_complete for 128 bit pointers
authorSzabolcs Nagy <szabolcs.nagy@arm.com>
Mon, 26 Jul 2021 19:31:38 +0000 (16:31 -0300)
committerSzabolcs Nagy <szabolcs.nagy@arm.com>
Thu, 27 Oct 2022 13:46:48 +0000 (14:46 +0100)
The size of the reserved space has to be adjusted because it underflows
with 16 byte pointers.  With the new value there should be enough space
for 2 more pointers in the struct on CHERI targets.

libio/bits/types/struct_FILE.h

index 1eb429888c459fcd443d78fdea4f3c95a026e269..f73d051c0e17b2aaeed53aac9db82f2790f60008 100644 (file)
@@ -95,7 +95,9 @@ struct _IO_FILE_complete
   size_t __pad5;
   int _mode;
   /* Make sure we don't get into trouble again.  */
-  char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)];
+  char _unused2[sizeof (void *) == 4 * sizeof (int)
+               ? 9 * sizeof (int)
+               : 15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)];
 };
 
 /* These macros are used by bits/stdio.h and internal headers.  */