File tree Expand file tree Collapse file tree 2 files changed +27
-2
lines changed Expand file tree Collapse file tree 2 files changed +27
-2
lines changed Original file line number Diff line number Diff line change @@ -1055,10 +1055,11 @@ void RewriteInstance::discoverFileObjects() {
10551055 continue ;
10561056 }
10571057
1058- if (!Section->isText ()) {
1058+ if (!Section->isText () || Section-> isVirtual () ) {
10591059 assert (SymbolType != SymbolRef::ST_Function &&
10601060 " unexpected function inside non-code section" );
1061- LLVM_DEBUG (dbgs () << " BOLT-DEBUG: rejecting as symbol is not in code\n " );
1061+ LLVM_DEBUG (dbgs () << " BOLT-DEBUG: rejecting as symbol is not in code or "
1062+ " is in nobits section\n " );
10621063 registerName (SymbolSize);
10631064 continue ;
10641065 }
Original file line number Diff line number Diff line change 1+ ## Check that llvm-bolt doesn't choke on symbols defined in nobits sections.
2+
3+ # RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %s -o %t.o
4+ # RUN: %clang %cflags %t.o -o %t.exe
5+ # RUN: llvm-bolt %t.exe -o %t
6+ #
7+
8+ .type symbol_in_nobits,@object
9+ .section .my.nobits.section,"awx" ,@nobits
10+ .globl symbol_in_nobits
11+ .p2align 4 , 0x0
12+ symbol_in_nobits:
13+ .zero 0x100000
14+ .size symbol_in_nobits, 0x100000
15+
16+ .text
17+ .globl main
18+ .type main, %function
19+ main:
20+ .cfi_startproc
21+ .LBB06:
22+ retq
23+ .cfi_endproc
24+ .size main, .-main
You can’t perform that action at this time.
0 commit comments