brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.4 KiB · bf31af3 Raw
32 lines · plain
1## Checking crashes against injected binary functions created by patch2## entries pass and debug info turned on. In these cases, we were3## trying to fetch input to output maps on injected functions and4## crashing.5 6REQUIRES: system-linux7 8RUN: %clang %cflags -no-pie -g %p/Inputs/patch-entries.c -fuse-ld=lld -o %t.exe \9RUN:   -Wl,-q -I%p/../Inputs10RUN: llvm-bolt -relocs %t.exe -o %t.out --update-debug-sections --force-patch \11RUN:   --enable-bat12 13## Check that patched functions can be disassembled (override FDE from the14## original function)15# PREAGG: B X:0 #foo.org.0# 1 016RUN: link_fdata %s %t.out %t.preagg PREAGG17RUN: perf2bolt %t.out -p %t.preagg --pa -o %t.yaml --profile-format=yaml \18RUN:   -print-disasm -print-only=foo.org.0/1 2>&1 | FileCheck %s19CHECK-NOT: BOLT-WARNING: sizes differ for function foo.org.0/120CHECK: Binary Function "foo.org.0/1(*2)" after disassembly {21 22## Check the expected eh_frame contents23RUN: llvm-nm --print-size %t.out > %t.foo24RUN: llvm-objdump %t.out --dwarf=frames >> %t.foo25RUN: FileCheck %s --input-file %t.foo --check-prefix=CHECK-FOO26CHECK-FOO: 0000000000[[#%x,FOO:]] [[#%x,OPTSIZE:]] t foo27CHECK-FOO: 0000000000[[#%x,ORG:]] [[#%x,ORGSIZE:]] t foo.org.028## patched FDE comes first29CHECK-FOO: FDE {{.*}} pc=00[[#%x,ORG]]...00[[#%x,ORG+ORGSIZE]]30## original FDE comes second31CHECK-FOO: FDE {{.*}} pc=00[[#%x,ORG]]...00[[#%x,ORG+OPTSIZE]]32