[PATCH] UBSAN: Add __ubsan_handle_type_mismatch_v1 handler

From: Prasad Sodagudi
Date: Tue Oct 10 2017 - 03:06:21 EST


In LLVM __ubsan_handle_type_mismatch handler is renamed to
__ubsan_handle_type_mismatch_v1. Add support for
__ubsan_handle_type_mismatch_v1 handler to avoid compilation
issues with latest llvm tool chain. Also keeping
__ubsan_handle_type_mismatch handler for backward compatibility.

Signed-off-by: Prasad Sodagudi <psodagud@xxxxxxxxxxxxxx>
---
lib/ubsan.c | 8 ++++++++
1 file changed, 8 insertions(+)

diff --git a/lib/ubsan.c b/lib/ubsan.c
index fb0409d..9baf17d 100644
--- a/lib/ubsan.c
+++ b/lib/ubsan.c
@@ -328,6 +328,14 @@ void __ubsan_handle_type_mismatch(struct type_mismatch_data *data,
}
EXPORT_SYMBOL(__ubsan_handle_type_mismatch);

+void __ubsan_handle_type_mismatch_v1(struct type_mismatch_data *data,
+ unsigned long ptr)
+{
+ __ubsan_handle_type_mismatch(data, ptr);
+}
+EXPORT_SYMBOL(__ubsan_handle_type_mismatch_v1);
+
+
void __ubsan_handle_nonnull_return(struct nonnull_return_data *data)
{
unsigned long flags;
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project