[llvm] 24c6ea9 - [JMCInstrument] rename ELF section name from ".just.my.code" to ".data.just.my.code"

Yuanfang Chen via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 19 10:50:11 PDT 2022


Author: Yuanfang Chen
Date: 2022-10-19T10:49:54-07:00
New Revision: 24c6ea917cfd30211f56d48bb346a09e91d0176b

URL: https://github.com/llvm/llvm-project/commit/24c6ea917cfd30211f56d48bb346a09e91d0176b
DIFF: https://github.com/llvm/llvm-project/commit/24c6ea917cfd30211f56d48bb346a09e91d0176b.diff

LOG: [JMCInstrument] rename ELF section name from ".just.my.code" to ".data.just.my.code"

This gives linker scripts a hint about where to place the section.

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/JMCInstrumenter.cpp b/llvm/lib/CodeGen/JMCInstrumenter.cpp
index 23220872b5321..f1953c363b596 100644
--- a/llvm/lib/CodeGen/JMCInstrumenter.cpp
+++ b/llvm/lib/CodeGen/JMCInstrumenter.cpp
@@ -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);

diff  --git a/llvm/test/Instrumentation/JustMyCode/jmc-instrument-elf.ll b/llvm/test/Instrumentation/JustMyCode/jmc-instrument-elf.ll
index 52915709eb891..12ca42703732e 100644
--- a/llvm/test/Instrumentation/JustMyCode/jmc-instrument-elf.ll
+++ b/llvm/test/Instrumentation/JustMyCode/jmc-instrument-elf.ll
@@ -1,7 +1,7 @@
 ; RUN: opt -jmc-instrument -mtriple=x86_64-unknown-linux-gnu  -S < %s | FileCheck %s
 
-; CHECK: @"__7DF23CF5_x at c" = internal unnamed_addr global i8 1, section ".just.my.code", align 1, !dbg !0
-; CHECK: @"__A8764FDD_x at c" = internal unnamed_addr global i8 1, section ".just.my.code", align 1, !dbg !5
+; CHECK: @"__7DF23CF5_x at c" = internal unnamed_addr global i8 1, section ".data.just.my.code", align 1, !dbg !0
+; CHECK: @"__A8764FDD_x at 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 at c")


        


More information about the llvm-commits mailing list