[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.
This commit is contained in:
Yuanfang Chen 2022-10-19 10:36:36 -07:00
parent fcd7717ddf
commit 24c6ea917c
2 changed files with 3 additions and 3 deletions

View 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);

View 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")