| 1 | // Test bolt instrumentation won't generate a binary with any segment that |
| 2 | // is writable and executable. Basically we want to put `.bolt.instr.counters` |
| 3 | // section into its own segment, separated from its surrounding RX sections. |
| 4 | |
| 5 | // REQUIRES: system-linux |
| 6 | |
| 7 | void foo() {} |
| 8 | void bar() { foo(); } |
| 9 | |
| 10 | // RUN: %clang %cflags -c %s -o %t.o |
| 11 | // RUN: ld.lld -q -o %t.so %t.o -shared --init=foo --fini=foo |
| 12 | // RUN: llvm-bolt --instrument %t.so -o %tt.so |
| 13 | // RUN: llvm-readelf -l %tt.so | FileCheck %s |
| 14 | // CHECK-NOT: RWE |
| 15 | // CHECK: {{[0-9]*}} .bolt.instr.counters {{$}} |
| 16 | |