Skip to content

Commit e982032

Browse files
authored
[BOLT,RISCV] Remove empty name special case from #68977
The special case is unneeded after #89693. Pull Request: #90004
1 parent 2de0bed commit e982032

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

bolt/lib/Rewrite/RewriteInstance.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1725,12 +1725,6 @@ void RewriteInstance::adjustFunctionBoundaries() {
17251725
if (!Function.isSymbolValidInScope(Symbol, SymbolSize))
17261726
break;
17271727

1728-
// Ignore unnamed symbols. Used, for example, by debugging info on RISC-V.
1729-
if (BC->isRISCV() && cantFail(Symbol.getName()).empty()) {
1730-
++NextSymRefI;
1731-
continue;
1732-
}
1733-
17341728
// Skip basic block labels. This happens on RISC-V with linker relaxation
17351729
// enabled because every branch needs a relocation and corresponding
17361730
// symbol. We don't want to add such symbols as entry points.

bolt/test/RISCV/unnamed-sym-no-entry.c renamed to bolt/test/RISCV/fake-label-no-entry.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55

66
// RUN: %clang %cflags -g -Wl,-q -o %t %s
77

8-
/// Verify that the binary indeed contains an unnamed symbol at _start
8+
/// Verify that the binary indeed contains a fake label ".L0 " at _start.
99
// RUN: llvm-readelf -s %t | FileCheck %s --check-prefix=CHECK-ELF
1010
// CHECK-ELF-DAG: [[#%x,START:]] {{.*}} FUNC GLOBAL DEFAULT [[#%d,SECTION:]] _start{{$}}
1111
// CHECK-ELF-DAG: [[#%x,START]] {{.*}} NOTYPE LOCAL DEFAULT [[#SECTION]] .L0 {{$}}
1212

13-
/// Verify that BOLT did not create an extra entry point for the unnamed symbol
13+
/// Verify that BOLT did not create an extra entry point for the fake label.
1414
// RUN: llvm-bolt -o %t.bolt %t --print-cfg | FileCheck %s
1515
// CHECK: Binary Function "_start" after building cfg {
1616
// CHECK: IsMultiEntry: 0

0 commit comments

Comments
 (0)