File tree Expand file tree Collapse file tree 3 files changed +31
-22
lines changed Expand file tree Collapse file tree 3 files changed +31
-22
lines changed Original file line number Diff line number Diff line change @@ -917,9 +917,6 @@ void RewriteInstance::discoverFileObjects() {
917
917
bool IsData = false ;
918
918
uint64_t LastAddr = 0 ;
919
919
for (const auto &SymInfo : SortedSymbols) {
920
- if (LastAddr == SymInfo.Address ) // don't repeat markers
921
- continue ;
922
-
923
920
MarkerSymType MarkerType = BC->getMarkerType (SymInfo.Symbol );
924
921
925
922
// Treat ST_Function as code.
@@ -929,8 +926,14 @@ void RewriteInstance::discoverFileObjects() {
929
926
if (IsData) {
930
927
Expected<StringRef> NameOrError = SymInfo.Symbol .getName ();
931
928
consumeError (NameOrError.takeError ());
932
- BC->errs () << " BOLT-WARNING: function symbol " << *NameOrError
933
- << " lacks code marker\n " ;
929
+ if (LastAddr == SymInfo.Address ) {
930
+ BC->errs () << " BOLT-WARNING: ignoring data marker conflicting with "
931
+ " function symbol "
932
+ << *NameOrError << ' \n ' ;
933
+ } else {
934
+ BC->errs () << " BOLT-WARNING: function symbol " << *NameOrError
935
+ << " lacks code marker\n " ;
936
+ }
934
937
}
935
938
MarkerType = MarkerSymType::CODE;
936
939
}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ ## Check that if a data marker is present at the start of a function, the
2
+ ## underlying bytes are still treated as code.
3
+
4
+ # RUN: %clang %cflags %s -o %t.exe
5
+ # RUN: llvm-bolt %t.exe -o %t.bolt --print-cfg 2>&1 | FileCheck %s
6
+
7
+ # CHECK: BOLT-WARNING: ignoring data marker conflicting with function symbol _start
8
+
9
+ .text
10
+ .balign 4
11
+
12
+ ## Data marker is emitted because ".long" directive is used instead of ".inst".
13
+ .global _start
14
+ .type _start, %function
15
+ _start:
16
+ .long 0xcec08000 // sha512su0 v0.2d, v0.2d
17
+ ret
18
+ .size _start, .-_start
19
+
20
+ # CHECK-LABEL: Binary Function "_start"
21
+ # CHECK: Entry Point
22
+ # CHECK-NEXT: sha512su0 v0.2d, v0.2d
23
+
You can’t perform that action at this time.
0 commit comments