[ubsan] Make TypeCheckKinds const. NFC
authorFangrui Song <i@maskray.me>
Wed, 3 Aug 2022 18:02:22 +0000 (11:02 -0700)
committerFangrui Song <i@maskray.me>
Wed, 3 Aug 2022 18:02:22 +0000 (11:02 -0700)
Move it from .data to .data.rel.ro

compiler-rt/lib/ubsan/ubsan_handlers.cpp
compiler-rt/lib/ubsan/ubsan_handlers_cxx.cpp

index e201e6b..410292a 100644 (file)
@@ -76,7 +76,7 @@ enum TypeCheckKind {
   TCK_DynamicOperation
 };
 
-const char *TypeCheckKinds[] = {
+extern const char *const TypeCheckKinds[] = {
     "load of", "store to", "reference binding to", "member access within",
     "member call on", "constructor call on", "downcast of", "downcast of",
     "upcast of", "cast to virtual base of", "_Nonnull binding to",
index 2a6d558..0317a3d 100644 (file)
@@ -26,7 +26,7 @@ using namespace __sanitizer;
 using namespace __ubsan;
 
 namespace __ubsan {
-  extern const char *TypeCheckKinds[];
+  extern const char *const TypeCheckKinds[];
 }
 
 // Returns true if UBSan has printed an error report.