brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · 2fc136f Raw
50 lines · plain
1# REQUIRES: system-linux2 3## Check that BOLT correctly parses and updates the Linux kernel .smp_locks4## section.5 6# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %s -o %t.o7# RUN: %clang %cflags -nostdlib %t.o -o %t.exe \8# RUN:   -Wl,--image-base=0xffffffff80000000,--no-dynamic-linker,--no-eh-frame-hdr,--no-pie9# RUN: llvm-bolt %t.exe --print-normalized --keep-nops=0 --bolt-info=0 -o %t.out \10# RUN:   2>&1 | FileCheck %s11 12## Check the output of BOLT with NOPs removed.13 14# RUN: llvm-bolt %t.out -o %t.out.1 --print-normalized 2>&1 | FileCheck %s15 16# CHECK:      BOLT-INFO: Linux kernel binary detected17# CHECK:      BOLT-INFO: parsed 2 SMP lock entries18 19  .text20  .globl _start21  .type _start, %function22_start:23  nop24  nop25.L0:26  lock incl (%rdi)27# CHECK: lock {{.*}} SMPLock28.L1:29  lock orb $0x40, 0x4(%rsi)30# CHECK: lock {{.*}} SMPLock31  ret32  .size _start, .-_start33 34  .section .smp_locks,"a",@progbits35  .long .L0 - .36  .long .L1 - .37 38## Linux kernel version39  .rodata40  .align 1641  .globl linux_banner42  .type  linux_banner, @object43linux_banner:44  .string  "Linux version 6.6.61\n"45  .size  linux_banner, . - linux_banner46 47## Fake Linux Kernel sections.48  .section __ksymtab,"a",@progbits49  .section __ksymtab_gpl,"a",@progbits50