39 lines · plain
1## Check that llvm-bolt avoids optimization of functions referenced from2## __rseq_cs section, i.e. containing critical sections and abort handlers used3## by restartable sequences in tcmalloc.4 5# RUN: %clang %cflags %s -o %t -nostdlib -no-pie -Wl,-q6# RUN: llvm-bolt %t -o %t.bolt --print-cfg 2>&1 | FileCheck %s7# RUN: %clang %cflags %s -o %t.pie -nostdlib -pie -Wl,-q8# RUN: llvm-bolt %t.pie -o %t.pie.bolt 2>&1 | FileCheck %s9 10# CHECK: restartable sequence reference detected in _start11# CHECK: restartable sequence reference detected in __rseq_abort12 13## Force relocations against .text14 .text15.reloc 0, R_X86_64_NONE16 17 .global _start18 .type _start, %function19_start:20 pushq %rbp21 mov %rsp, %rbp22.L1:23 pop %rbp24.L2:25 retq26 .size _start, .-_start27 28 .section __rseq_abort, "ax"29## Signature for rseq abort IP. Unmarked in the symbol table.30 .byte 0x0f, 0x1f, 0x0531 .long 0x4242424232.L3:33 jmp .L234 35.section __rseq_cs, "aw"36.balign 3237 .quad .L138 .quad .L339