[compiler-rt] f2fa4f9 - [sanitizer] Update dn_expand interceptor for glibc 2.34
Vitaly Buka via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 1 16:29:16 PDT 2022
Author: Vitaly Buka
Date: 2022-07-01T16:26:58-07:00
New Revision: f2fa4f97591a411dd0faef7475a78c15404cf4a7
URL: https://github.com/llvm/llvm-project/commit/f2fa4f97591a411dd0faef7475a78c15404cf4a7
DIFF: https://github.com/llvm/llvm-project/commit/f2fa4f97591a411dd0faef7475a78c15404cf4a7.diff
LOG: [sanitizer] Update dn_expand interceptor for glibc 2.34
Symbol changed with 640bbdf71c6f10ac26252ac67a22902e26657bd8
Added:
Modified:
compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc
Removed:
################################################################################
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc b/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc
index 9b828ffc36e47..60537018b8894 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc
@@ -2531,19 +2531,25 @@ INTERCEPTOR(int, __b64_pton, char const *src, char *target, SIZE_T targsize) {
#endif // SANITIZER_INTERCEPT___B64_TO
#if SANITIZER_INTERCEPT___DN_EXPAND
- INTERCEPTOR(int, __dn_expand, unsigned char const *base,
+#if __GLIBC_PREREQ(2, 34)
+// Changed with https://sourceware.org/git/?p=glibc.git;h=640bbdf
+#define DN_EXPAND_INTERCEPTOR_NAME dn_expand
+#else
+#define DN_EXPAND_INTERCEPTOR_NAME __dn_expand
+#endif
+ INTERCEPTOR(int, DN_EXPAND_INTERCEPTOR_NAME, unsigned char const *base,
unsigned char const *end, unsigned char const *src, char *dest,
int space) {
void *ctx;
- COMMON_INTERCEPTOR_ENTER(ctx, __dn_expand, base, end, src, dest, space);
+ COMMON_INTERCEPTOR_ENTER(ctx, DN_EXPAND_INTERCEPTOR_NAME, base, end, src, dest, space);
// TODO: add read check if __dn_comp intercept added
- int res = REAL(__dn_expand)(base, end, src, dest, space);
+ int res = REAL(DN_EXPAND_INTERCEPTOR_NAME)(base, end, src, dest, space);
if (res >= 0)
COMMON_INTERCEPTOR_WRITE_RANGE(ctx, dest, res + 1);
return res;
}
#define INIT___DN_EXPAND \
- COMMON_INTERCEPT_FUNCTION(__dn_expand);
+ COMMON_INTERCEPT_FUNCTION(DN_EXPAND_INTERCEPTOR_NAME);
#else // SANITIZER_INTERCEPT___DN_EXPAND
#define INIT___DN_EXPAND
#endif // SANITIZER_INTERCEPT___DN_EXPAND
More information about the llvm-commits
mailing list