summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzabolcs Nagy <szabolcs.nagy@arm.com>2022-12-01 16:58:55 +0000
committerSzabolcs Nagy <szabolcs.nagy@arm.com>2022-12-08 17:27:31 +0000
commit1861652b2ee82eda7d466ae582d195b3b0dae116 (patch)
tree2911de487ac9d43bd506e8c939e4d31fcf312dcf
parentae90dd111bc393178a39cc6166170aa7c3656296 (diff)
downloadglibc-1861652b2ee82eda7d466ae582d195b3b0dae116.tar.gz
cheri: malloc: bump OBSTACK_INTERFACE_VERSION
The obstack version should have been bumped after commit 2fd4de4b15a66f821057af90714145d2c034a609 [BZ #321] which changed a ptrdiff_t struct member into a union of ptrdiff_t and a pointer and thus changed the ABI on targets where ptrdiff_t and pointer have different size or alignment. This affects CHERI targets. Old versions of obstack are used in the wild and conflict with the one provided by glibc so at least on CHERI targets it has to be bumped. On other targets we don't bump the version as it changes compile time behaviour (the ABI remains backward compatible either way).
-rw-r--r--include/gnu-versions.h4
-rw-r--r--malloc/obstack.c4
2 files changed, 8 insertions, 0 deletions
diff --git a/include/gnu-versions.h b/include/gnu-versions.h
index f2566683ec..842a215b17 100644
--- a/include/gnu-versions.h
+++ b/include/gnu-versions.h
@@ -43,7 +43,11 @@
remember, if any of these versions change, the libc.so major version
number must change too (so avoid it)! */
+#ifdef __CHERI_PURE_CAPABILITY__
+#define _GNU_OBSTACK_INTERFACE_VERSION 2 /* vs malloc/obstack.c */
+#else
#define _GNU_OBSTACK_INTERFACE_VERSION 1 /* vs malloc/obstack.c */
+#endif
#define _GNU_REGEX_INTERFACE_VERSION 1 /* vs posix/regex.c */
#define _GNU_GLOB_INTERFACE_VERSION 2 /* vs posix/glob.c */
#define _GNU_GETOPT_INTERFACE_VERSION 2 /* vs posix/getopt.c and
diff --git a/malloc/obstack.c b/malloc/obstack.c
index 40b9c29b79..aad6a34f58 100644
--- a/malloc/obstack.c
+++ b/malloc/obstack.c
@@ -28,7 +28,11 @@
/* NOTE BEFORE MODIFYING THIS FILE: This version number must be
incremented whenever callers compiled using an old obstack.h can no
longer properly call the functions in this obstack.c. */
+#ifdef __CHERI_PURE_CAPABILITY__
+#define OBSTACK_INTERFACE_VERSION 2
+#else
#define OBSTACK_INTERFACE_VERSION 1
+#endif
/* Comment out all this code if we are using the GNU C Library, and are not
actually compiling the library itself, and the installed library