File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -1514,6 +1514,12 @@ void RewriteInstance::registerFragments() {
15141514 }
15151515 if (BD) {
15161516 BinaryFunction *BF = BC->getFunctionForSymbol (BD->getSymbol ());
1517+ if (BF == &Function) {
1518+ BC->errs ()
1519+ << " BOLT-WARNING: fragment maps to the same function as parent: "
1520+ << Function << ' \n ' ;
1521+ continue ;
1522+ }
15171523 if (BF) {
15181524 BC->registerFragment (Function, *BF);
15191525 continue ;
Original file line number Diff line number Diff line change 1+ ## This test reproduces the issue where a fragment has the same address as
2+ ## parent function.
3+ # RUN: llvm - mc -- filetype=obj -- triple x86_64 - unknown - unknown %s - o %t.o
4+ # RUN: %clang %cflags %t.o - o %t
5+ # RUN: llvm - bolt %t - o %t. out 2 >& 1 | FileCheck %s
6+ # CHECK: BOLT - WARNING: fragment maps to the same function as parent: main/ 1 ( * 2 )
7+ .type main , @function
8+ .type main.cold , @function
9+ main.cold:
10+ main:
11+ ret
12+ .size main , . - main
13+ .size main.cold , . - main.cold
You can’t perform that action at this time.
0 commit comments