File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -149,6 +149,15 @@ void OutputSection::commitSection(InputSection *isec) {
149
149
error (" incompatible section flags for " + name + " \n >>> " +
150
150
toString (isec) + " : 0x" + utohexstr (isec->flags ) +
151
151
" \n >>> output section " + name + " : 0x" + utohexstr (flags));
152
+ if (config->emachine == EM_X86_64) {
153
+ if ((flags ^ isec->flags ) & SHF_X86_64_LARGE) {
154
+ InputSection *conflictISec = getFirstInputSection (this );
155
+ warn (" incompatible SHF_X86_64_LARGE section flag for '" + name +
156
+ " '\n >>> " + toString (conflictISec) + " : 0x" +
157
+ utohexstr (conflictISec->flags ) + " \n >>> " + toString (isec) +
158
+ " : 0x" + utohexstr (isec->flags ));
159
+ }
160
+ }
152
161
}
153
162
154
163
isec->parent = this ;
Original file line number Diff line number Diff line change
1
+ # REQUIRES: x86
2
+ # RUN: split-file %s %t
3
+ # RUN: llvm-mc -filetype=obj -triple=x86_64 %t/a.s -o %t/a.o
4
+ # RUN: llvm-mc -filetype=obj -triple=x86_64 %t/b.s -o %t/b.o
5
+ # RUN: ld.lld %t/a.o %t/b.o -o /dev/null 2>&1 | FileCheck %s
6
+
7
+ # CHECK: warning: incompatible SHF_X86_64_LARGE section flag for 'foo'
8
+ # CHECK-NEXT: >>> {{.*}}a.o:(foo): 0x10000003
9
+ # CHECK-NEXT: >>> {{.*}}b.o:(foo): 0x3
10
+
11
+ #--- a.s
12
+ .section foo,"awl" ,@progbits
13
+
14
+ #--- b.s
15
+ .section foo,"aw" ,@progbits
16
+
You can’t perform that action at this time.
0 commit comments