[JMCInstrument] rename ELF section name from ".just.my.code" to ".data.just.my.code"
authorYuanfang Chen <yuanfang.chen@sony.com>
Wed, 19 Oct 2022 17:36:36 +0000 (10:36 -0700)
committerYuanfang Chen <yuanfang.chen@sony.com>
Wed, 19 Oct 2022 17:49:54 +0000 (10:49 -0700)
This gives linker scripts a hint about where to place the section.

llvm/lib/CodeGen/JMCInstrumenter.cpp
llvm/test/Instrumentation/JustMyCode/jmc-instrument-elf.ll

index 2322087..f1953c3 100644 (file)
@@ -151,7 +151,7 @@ bool JMCInstrumenter::runOnModule(Module &M) {
   bool IsELF = ModuleTriple.isOSBinFormatELF();
   assert((IsELF || IsMSVC) && "Unsupported triple for JMC");
   bool UseX86FastCall = IsMSVC && ModuleTriple.getArch() == Triple::x86;
-  const char *const FlagSymbolSection = IsELF ? ".just.my.code" : ".msvcjmc";
+  const char *const FlagSymbolSection = IsELF ? ".data.just.my.code" : ".msvcjmc";
 
   GlobalValue *CheckFunction = nullptr;
   DenseMap<DISubprogram *, Constant *> SavedFlags(8);
index 5291570..12ca427 100644 (file)
@@ -1,7 +1,7 @@
 ; RUN: opt -jmc-instrument -mtriple=x86_64-unknown-linux-gnu  -S < %s | FileCheck %s
 
-; CHECK: @"__7DF23CF5_x@c" = internal unnamed_addr global i8 1, section ".just.my.code", align 1, !dbg !0
-; CHECK: @"__A8764FDD_x@c" = internal unnamed_addr global i8 1, section ".just.my.code", align 1, !dbg !5
+; CHECK: @"__7DF23CF5_x@c" = internal unnamed_addr global i8 1, section ".data.just.my.code", align 1, !dbg !0
+; CHECK: @"__A8764FDD_x@c" = internal unnamed_addr global i8 1, section ".data.just.my.code", align 1, !dbg !5
 
 ; CHECK: define void @l1() !dbg !12 {
 ; CHECK:   call void @__CheckForDebuggerJustMyCode(ptr noundef @"__7DF23CF5_x@c")