Skip to content

Commit e018cbf

Browse files
committed
[IR] Make stack protector symbol dso_local according to -f[no-]direct-access-external-data
There are two motivations. `-fno-pic -fstack-protector -mstack-protector-guard=global` created `__stack_chk_guard` is referenced directly on all ELF OSes except FreeBSD. This patch allows referencing the symbol indirectly with -fno-direct-access-external-data. Some Linux kernel folks want `-fno-pic -fstack-protector -mstack-protector-guard-reg=gs -mstack-protector-guard-symbol=__stack_chk_guard` created `__stack_chk_guard` to be referenced directly, avoiding R_X86_64_REX_GOTPCRELX (even if the relocation may be optimized out by the linker). #60116 Why they need this isn't so clear to me. --- Add module flag "direct-access-external-data" and set the dso_local property of the stack protector symbol. The module flag can benefit other LLVMCodeGen synthesized symbols that are not represented in LLVM IR. Nowadays, with `-fno-pic` being uncommon, ideally we should set "direct-access-external-data" when it is true. However, doing so would require ~90 clang/test tests to be updated, which are too much. As a compromise, we set "direct-access-external-data" only when it's different from the implied default value. Reviewed By: nickdesaulniers Differential Revision: https://reviews.llvm.org/D150841
1 parent 7140050 commit e018cbf

20 files changed

+109
-17
lines changed

clang/lib/CodeGen/CodeGenModule.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -908,6 +908,12 @@ void CodeGenModule::Release() {
908908

909909
if (CodeGenOpts.NoPLT)
910910
getModule().setRtLibUseGOT();
911+
if (getTriple().isOSBinFormatELF() &&
912+
CodeGenOpts.DirectAccessExternalData !=
913+
getModule().getDirectAccessExternalData()) {
914+
getModule().setDirectAccessExternalData(
915+
CodeGenOpts.DirectAccessExternalData);
916+
}
911917
if (CodeGenOpts.UnwindTables)
912918
getModule().setUwtable(llvm::UWTableKind(CodeGenOpts.UnwindTables));
913919

clang/test/CodeGen/dso-local-executable.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636
// STATIC-DAG: define dso_local ptr @zed()
3737
// STATIC-DAG: declare dso_local void @import_func()
3838

39+
// STATIC-NOT: !"direct-access-external-data"
40+
3941
/// If -fno-direct-access-external-data is set, drop dso_local from global variable
4042
/// declarations.
4143
// RUN: %clang_cc1 -triple x86_64 -emit-llvm %s -mrelocation-model static -fno-direct-access-external-data -o - | FileCheck --check-prefix=STATIC-INDIRECT %s
@@ -49,6 +51,8 @@
4951
// STATIC-INDIRECT-DAG: define dso_local ptr @zed()
5052
// STATIC-INDIRECT-DAG: declare void @foo()
5153

54+
// STATIC-INDIRECT: ![[#]] = !{i32 7, !"direct-access-external-data", i32 0}
55+
5256
// RUN: %clang_cc1 -triple x86_64 -emit-llvm -pic-level 1 -pic-is-pie %s -o - | FileCheck --check-prefix=PIE %s
5357
// PIE: @baz = dso_local global i32 42
5458
// PIE-NEXT: @import_var = external global i32
@@ -60,6 +64,8 @@
6064
// PIE-DAG: define dso_local ptr @zed()
6165
// PIE-DAG: declare void @import_func()
6266

67+
// PIE-NOT: !"direct-access-external-data"
68+
6369
// RUN: %clang_cc1 -triple x86_64 -emit-llvm -pic-level 1 -pic-is-pie -fdirect-access-external-data %s -o - | FileCheck --check-prefix=PIE-DIRECT %s
6470
// PIE-DIRECT: @baz = dso_local global i32 42
6571
// PIE-DIRECT-NEXT: @import_var = external dso_local global i32
@@ -71,6 +77,8 @@
7177
// PIE-DIRECT-DAG: define dso_local ptr @zed()
7278
// PIE-DIRECT-DAG: declare void @import_func()
7379

80+
// PIE-DIRECT: ![[#]] = !{i32 7, !"direct-access-external-data", i32 1}
81+
7482
// RUN: %clang_cc1 -triple x86_64 -emit-llvm -mrelocation-model static -fno-plt %s -o - | FileCheck --check-prefix=NOPLT %s
7583
// NOPLT: @baz = dso_local global i32 42
7684
// NOPLT-NEXT: @import_var = external dso_local global i32

llvm/include/llvm/IR/Module.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -945,6 +945,11 @@ class LLVM_EXTERNAL_VISIBILITY Module {
945945
/// Set that PLT should be avoid for RTLib calls.
946946
void setRtLibUseGOT();
947947

948+
/// Get/set whether referencing global variables can use direct access
949+
/// relocations on ELF targets.
950+
bool getDirectAccessExternalData() const;
951+
void setDirectAccessExternalData(bool Value);
952+
948953
/// Get/set whether synthesized functions should get the uwtable attribute.
949954
UWTableKind getUwtable() const;
950955
void setUwtable(UWTableKind Kind);

llvm/lib/CodeGen/TargetLoweringBase.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1977,7 +1977,7 @@ void TargetLoweringBase::insertSSPDeclarations(Module &M) const {
19771977
"__stack_chk_guard");
19781978

19791979
// FreeBSD has "__stack_chk_guard" defined externally on libc.so
1980-
if (TM.getRelocationModel() == Reloc::Static &&
1980+
if (M.getDirectAccessExternalData() &&
19811981
!TM.getTargetTriple().isWindowsGNUEnvironment() &&
19821982
!TM.getTargetTriple().isOSFreeBSD())
19831983
GV->setDSOLocal(true);

llvm/lib/IR/Module.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -672,6 +672,18 @@ void Module::setRtLibUseGOT() {
672672
addModuleFlag(ModFlagBehavior::Max, "RtLibUseGOT", 1);
673673
}
674674

675+
bool Module::getDirectAccessExternalData() const {
676+
auto *Val = cast_or_null<ConstantAsMetadata>(
677+
getModuleFlag("direct-access-external-data"));
678+
if (Val)
679+
return cast<ConstantInt>(Val->getValue())->getZExtValue() > 0;
680+
return getPICLevel() == PICLevel::NotPIC;
681+
}
682+
683+
void Module::setDirectAccessExternalData(bool Value) {
684+
addModuleFlag(ModFlagBehavior::Max, "direct-access-external-data", Value);
685+
}
686+
675687
UWTableKind Module::getUwtable() const {
676688
if (auto *Val = cast_or_null<ConstantAsMetadata>(getModuleFlag("uwtable")))
677689
return UWTableKind(cast<ConstantInt>(Val->getValue())->getZExtValue());

llvm/lib/Target/X86/X86ISelLowering.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3074,6 +3074,7 @@ Value *X86TargetLowering::getIRStackGuard(IRBuilderBase &IRB) const {
30743074
GV = new GlobalVariable(*M, Ty, false, GlobalValue::ExternalLinkage,
30753075
nullptr, GuardSymb, nullptr,
30763076
GlobalValue::NotThreadLocal, AddressSpace);
3077+
GV->setDSOLocal(M->getDirectAccessExternalData());
30773078
}
30783079
return GV;
30793080
}

llvm/test/CodeGen/AArch64/arm64_32.ll

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -759,3 +759,6 @@ define void @test_bzero(i64 %in) {
759759
}
760760

761761
declare void @llvm.memset.p0.i32(ptr nocapture writeonly, i8, i32, i1)
762+
763+
!llvm.module.flags = !{!0}
764+
!0 = !{i32 7, !"PIC Level", i32 2}

llvm/test/CodeGen/AArch64/stack-guard-sve.ll

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,3 +337,6 @@ entry:
337337

338338
attributes #0 = { ssp "frame-pointer"="non-leaf" }
339339
attributes #1 = { sspstrong "frame-pointer"="non-leaf" }
340+
341+
!llvm.module.flags = !{!0}
342+
!0 = !{i32 7, !"direct-access-external-data", i32 1}

llvm/test/CodeGen/AArch64/stack-guard-vaarg.ll

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,6 @@ declare void @llvm.va_end(ptr)
3636
declare void @llvm.lifetime.end(i64, ptr nocapture)
3737

3838
attributes #0 = { noinline nounwind optnone ssp }
39+
40+
!llvm.module.flags = !{!0}
41+
!0 = !{i32 7, !"direct-access-external-data", i32 1}

llvm/test/CodeGen/AArch64/stack_guard_remat.ll

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1-
; RUN: llc < %s -mtriple=arm64-apple-ios -relocation-model=pic -no-integrated-as | FileCheck %s -check-prefix=DARWIN
2-
; RUN: llc < %s -mtriple=arm64-apple-ios -relocation-model=static -no-integrated-as | FileCheck %s -check-prefix=DARWIN
3-
; RUN: llc < %s -mtriple=aarch64-linux-gnu -relocation-model=pic -no-integrated-as | FileCheck %s -check-prefix=PIC-LINUX
4-
; RUN: llc < %s -mtriple=aarch64-linux-gnu -relocation-model=static -code-model=large -no-integrated-as | FileCheck %s -check-prefix=STATIC-LARGE
5-
; RUN: llc < %s -mtriple=aarch64-linux-gnu -relocation-model=static -code-model=small -no-integrated-as | FileCheck %s -check-prefix=STATIC-SMALL
6-
7-
; RUN: llc < %s -global-isel -global-isel-abort=2 -pass-remarks-missed=gisel* -mtriple=arm64-apple-ios -relocation-model=pic -no-integrated-as 2>&1 | FileCheck %s -check-prefixes=DARWIN,FALLBACK
8-
; RUN: llc < %s -global-isel -global-isel-abort=2 -pass-remarks-missed=gisel* -mtriple=arm64-apple-ios -relocation-model=static -no-integrated-as 2>&1 | FileCheck %s -check-prefixes=DARWIN,FALLBACK
9-
; RUN: llc < %s -global-isel -global-isel-abort=2 -pass-remarks-missed=gisel* -mtriple=aarch64-linux-gnu -relocation-model=pic -no-integrated-as 2>&1 | FileCheck %s -check-prefixes=PIC-LINUX,FALLBACK
10-
; RUN: llc < %s -global-isel -global-isel-abort=2 -pass-remarks-missed=gisel* -mtriple=aarch64-linux-gnu -relocation-model=static -code-model=large -no-integrated-as 2>&1 | FileCheck %s -check-prefixes=STATIC-LARGE,FALLBACK
11-
; RUN: llc < %s -global-isel -global-isel-abort=2 -pass-remarks-missed=gisel* -mtriple=aarch64-linux-gnu -relocation-model=static -code-model=small -no-integrated-as 2>&1 | FileCheck %s -check-prefixes=STATIC-SMALL,FALLBACK
1+
; RUN: rm -rf %t && split-file %s %t && cd %t
2+
; RUN: cat a.ll pic.ll > b.ll
3+
; RUN: llc < b.ll -mtriple=arm64-apple-ios -relocation-model=pic -no-integrated-as | FileCheck %s -check-prefix=DARWIN
4+
; RUN: llc < b.ll -mtriple=arm64-apple-ios -relocation-model=static -no-integrated-as | FileCheck %s -check-prefix=DARWIN
5+
; RUN: llc < b.ll -mtriple=aarch64-linux-gnu -relocation-model=pic -no-integrated-as | FileCheck %s -check-prefix=PIC-LINUX
6+
; RUN: llc < a.ll -mtriple=aarch64-linux-gnu -relocation-model=static -code-model=large -no-integrated-as | FileCheck %s -check-prefix=STATIC-LARGE
7+
; RUN: llc < a.ll -mtriple=aarch64-linux-gnu -relocation-model=static -code-model=small -no-integrated-as | FileCheck %s -check-prefix=STATIC-SMALL
8+
9+
; RUN: llc < b.ll -global-isel -global-isel-abort=2 -pass-remarks-missed=gisel* -mtriple=arm64-apple-ios -relocation-model=pic -no-integrated-as 2>&1 | FileCheck %s -check-prefixes=DARWIN,FALLBACK
10+
; RUN: llc < b.ll -global-isel -global-isel-abort=2 -pass-remarks-missed=gisel* -mtriple=arm64-apple-ios -relocation-model=static -no-integrated-as 2>&1 | FileCheck %s -check-prefixes=DARWIN,FALLBACK
11+
; RUN: llc < b.ll -global-isel -global-isel-abort=2 -pass-remarks-missed=gisel* -mtriple=aarch64-linux-gnu -relocation-model=pic -no-integrated-as 2>&1 | FileCheck %s -check-prefixes=PIC-LINUX,FALLBACK
12+
; RUN: llc < a.ll -global-isel -global-isel-abort=2 -pass-remarks-missed=gisel* -mtriple=aarch64-linux-gnu -relocation-model=static -code-model=large -no-integrated-as 2>&1 | FileCheck %s -check-prefixes=STATIC-LARGE,FALLBACK
13+
; RUN: llc < a.ll -global-isel -global-isel-abort=2 -pass-remarks-missed=gisel* -mtriple=aarch64-linux-gnu -relocation-model=static -code-model=small -no-integrated-as 2>&1 | FileCheck %s -check-prefixes=STATIC-SMALL,FALLBACK
1214

1315
; DARWIN: foo2
1416
; DARWIN: adrp [[R0:x[0-9]+]], ___stack_chk_guard@GOTPAGE
@@ -33,6 +35,7 @@
3335

3436
; FALLBACK-NOT: remark:{{.*}}llvm.lifetime.end
3537
; FALLBACK-NOT: remark:{{.*}}llvm.lifetime.start
38+
;--- a.ll
3639
define i32 @test_stack_guard_remat() #0 {
3740
entry:
3841
%a1 = alloca [256 x i32], align 4
@@ -52,3 +55,7 @@ declare void @foo3(ptr)
5255
declare void @llvm.lifetime.end.p0(i64, ptr nocapture)
5356

5457
attributes #0 = { nounwind sspstrong "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
58+
59+
;--- pic.ll
60+
!llvm.module.flags = !{!0}
61+
!0 = !{i32 8, !"PIC Level", i32 2}

llvm/test/CodeGen/ARM/expand-pseudos.ll

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,6 @@ define void @_ZN2v88internal4wasm16LiftoffAssembler13emit_i32_addiENS0_8Register
2828
}
2929

3030
attributes #0 = { ssp }
31+
32+
!llvm.module.flags = !{!0}
33+
!0 = !{i32 7, !"PIC Level", i32 2}

llvm/test/CodeGen/ARM/stack-guard-rwpi.ll

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,6 @@ entry:
2626
}
2727

2828
declare dso_local i32 @baz(ptr)
29+
30+
!llvm.module.flags = !{!0}
31+
!0 = !{i32 7, !"PIC Level", i32 2}

llvm/test/CodeGen/ARM/stack_guard_remat.ll

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,6 @@ declare void @foo3(ptr)
6666
declare void @llvm.lifetime.end.p0(i64, ptr nocapture)
6767

6868
attributes #0 = { nounwind ssp "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
69+
70+
!llvm.module.flags = !{!0}
71+
!0 = !{i32 7, !"PIC Level", i32 2}

llvm/test/CodeGen/Inputs/stack-guard-reassign.ll

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,6 @@ declare i8* @strcpy(i8*, i8*)
1919
declare i32 @puts(i8*)
2020

2121
attributes #0 = { noinline nounwind optnone ssp }
22+
23+
!llvm.module.flags = !{!0}
24+
!0 = !{i32 7, !"direct-access-external-data", i32 1}

llvm/test/CodeGen/PowerPC/stack-guard-oob.ll

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,3 +419,6 @@ define i32 @multi_dimensional_array() #0 {
419419
}
420420

421421
attributes #0 = { sspstrong }
422+
423+
!llvm.module.flags = !{!0}
424+
!0 = !{i32 7, !"direct-access-external-data", i32 1}

llvm/test/CodeGen/Thumb/stack_guard_remat.ll

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,6 @@ declare void @foo3(ptr)
5757
declare void @llvm.lifetime.end.p0(i64, ptr nocapture)
5858

5959
attributes #0 = { nounwind ssp "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
60+
61+
!llvm.module.flags = !{!0}
62+
!0 = !{i32 7, !"PIC Level", i32 2}

llvm/test/CodeGen/Thumb2/stack_guard_remat.ll

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,6 @@ declare void @foo3(ptr)
3939
declare void @llvm.lifetime.end.p0(i64, ptr nocapture)
4040

4141
attributes #0 = { nounwind ssp "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
42+
43+
!llvm.module.flags = !{!0}
44+
!0 = !{i32 7, !"PIC Level", i32 2}

llvm/test/CodeGen/X86/2009-04-14-IllegalRegs.ll

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,6 @@ return: ; preds = %entry
8181
}
8282

8383
declare i32 @f(ptr byval(%struct.X) align 4, ptr byval(%struct.X) align 4) nounwind ssp
84+
85+
!llvm.module.flags = !{!0}
86+
!0 = !{i32 7, !"PIC Level", i32 2}

llvm/test/CodeGen/X86/2010-09-17-SideEffectsInChain.ll

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,6 @@ entry:
4949
store i8 %e, ptr %c, align 8
5050
ret i32 0
5151
}
52+
53+
!llvm.module.flags = !{!0}
54+
!0 = !{i32 7, !"direct-access-external-data", i32 1}

llvm/test/CodeGen/X86/stack-protector-3.ll

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
; RUN: cat %t/main.ll %t/f.ll > %t/f2.ll
88
; RUN: cat %t/main.ll %t/g.ll > %t/g2.ll
99
; RUN: cat %t/main.ll %t/h.ll > %t/h2.ll
10-
; RUN: cat %t/existedGV.ll %t/main.ll %t/h.ll > %t/i2.ll
10+
; RUN: cat %t/existedGV.ll %t/main.ll %t/h.ll > %t/h3.ll
11+
; RUN: cat %t/main.ll %t/i.ll > %t/i2.ll
1112
; RUN: llc -mtriple=x86_64-pc-linux-gnu -o - < %t/a2.ll | FileCheck --check-prefix=CHECK-TLS-FS-40 %s
1213
; RUN: llc -mtriple=x86_64-pc-linux-gnu -o - < %t/b2.ll | FileCheck --check-prefix=CHECK-TLS-FS-40 %s
1314
; RUN: llc -mtriple=x86_64-pc-linux-gnu -o - < %t/c2.ll | FileCheck --check-prefix=CHECK-GLOBAL %s
@@ -16,7 +17,8 @@
1617
; RUN: llc -mtriple=x86_64-pc-linux-gnu -o - < %t/f2.ll | FileCheck --check-prefix=CHECK-OFFSET %s
1718
; RUN: llc -mtriple=x86_64-pc-linux-gnu -o - < %t/g2.ll | FileCheck --check-prefix=CHECK-NEGATIVE-OFFSET %s
1819
; RUN: llc -mtriple=x86_64-pc-linux-gnu -o - < %t/h2.ll | FileCheck --check-prefix=CHECK-SYM %s
19-
; RUN: llc -mtriple=x86_64-pc-linux-gnu -o - < %t/i2.ll | FileCheck --check-prefix=CHECK-SYMGV %s
20+
; RUN: llc -mtriple=x86_64-pc-linux-gnu -o - < %t/h3.ll | FileCheck --check-prefix=CHECK-SYMGV %s
21+
; RUN: llc -mtriple=x86_64-pc-linux-gnu -o - < %t/i2.ll | FileCheck --check-prefix=CHECK-SYM2 %s
2022

2123
; CHECK-TLS-FS-40: movq %fs:40, %rax
2224
; CHECK-TLS-FS-40: movq %fs:40, %rax
@@ -67,7 +69,7 @@
6769
; CHECK-SYM-NEXT: jne .LBB0_2
6870
; CHECK-SYM: .LBB0_2:
6971
; CHECK-SYM-NEXT: .cfi_def_cfa_offset 32
70-
; CHECK-SYM-NEXT: callq __stack_chk_fai
72+
; CHECK-SYM-NEXT: callq __stack_chk_fail
7173

7274
; CHECK-SYMGV: movq __woof(%rip), %rax
7375
; CHECK-SYMGV-NEXT: movq %rax, 16(%rsp)
@@ -77,6 +79,15 @@
7779
; CHECK-SYMGV-NEXT: .cfi_def_cfa_offset 32
7880
; CHECK-SYMGV-NEXT: callq __stack_chk_fail
7981

82+
; CHECK-SYM2: movq %fs:__woof(%rip), %rax
83+
; CHECK-SYM2-NEXT: movq %rax, 16(%rsp)
84+
; CHECK-SYM2: movq %fs:__woof(%rip), %rax
85+
; CHECK-SYM2-NEXT: cmpq 16(%rsp), %rax
86+
; CHECK-SYM2-NEXT: jne .LBB0_2
87+
; CHECK-SYM2: .LBB0_2:
88+
; CHECK-SYM2-NEXT: .cfi_def_cfa_offset 32
89+
; CHECK-SYM2-NEXT: callq __stack_chk_fai
90+
8091
; ModuleID = 't.c'
8192
;--- existedGV.ll
8293

@@ -116,7 +127,8 @@ attributes #2 = { nounwind }
116127
!llvm.module.flags = !{!1}
117128
!1 = !{i32 2, !"stack-protector-guard", !"tls"}
118129
;--- c.ll
119-
!llvm.module.flags = !{!1}
130+
!llvm.module.flags = !{!0,!1}
131+
!0 = !{i32 7, !"direct-access-external-data", i32 1}
120132
!1 = !{i32 2, !"stack-protector-guard", !"global"}
121133
;--- d.ll
122134
!llvm.module.flags = !{!1}
@@ -131,5 +143,10 @@ attributes #2 = { nounwind }
131143
!llvm.module.flags = !{!1}
132144
!1 = !{i32 2, !"stack-protector-guard-offset", i32 -20}
133145
;--- h.ll
134-
!llvm.module.flags = !{!1}
146+
!llvm.module.flags = !{!0,!1}
147+
!0 = !{i32 7, !"direct-access-external-data", i32 0}
148+
!1 = !{i32 2, !"stack-protector-guard-symbol", !"__woof"}
149+
;--- i.ll
150+
!llvm.module.flags = !{!0,!1}
151+
!0 = !{i32 7, !"direct-access-external-data", i32 1}
135152
!1 = !{i32 2, !"stack-protector-guard-symbol", !"__woof"}

0 commit comments

Comments
 (0)