64 lines · plain
1## If the operand references a symbol that differs from the jump table label,2## no reference updating is required even if its target address resides within3## the jump table's range.4## In this test case, consider the second instruction within the main function,5## where the address resulting from 'c + 17' corresponds to one byte beyond the6## address of the .LJTI2_0 jump table label. However, this operand represents7## an offset calculation related to the global variable 'c' and should remain8## unaffected by the jump table.9 10# REQUIRES: system-linux11 12# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %s -o %t.o13# RUN: %clang %cflags -no-pie %t.o -o %t.exe -Wl,-q14# RUN: llvm-bolt --funcs=main,foo/1 %t.exe -o %t.exe.bolt --print-normalized \15# RUN: 2>&1 | FileCheck %s16 17 .text18 .globl main19 .type main,@function20main:21# CHECK: Binary Function "main22 pushq %rbp23 movq %rsp, %rbp24 movq $-16, %rax25 movl c+17(%rax), %edx26# CHECK: movl c+17(%rax), %edx27 cmpl $255, %edx28 je .LCorrect29 movl $1, %eax30 popq %rbp31 ret32.LCorrect:33 movl $0, %eax34 popq %rbp35 ret36 37 .p2align 4, 0x9038 .type foo,@function39foo:40# CHECK: Binary Function "foo41 movq $0, %rax42 jmpq *.LJTI2_0(,%rax,8)43# CHECK: jmpq *{{.*}} # JUMPTABLE44 addl $-36, %eax45.LBB2_2:46 addl $-16, %eax47 retq48 .section .rodata,"a",@progbits49 .type c,@object50 .data51 .globl c52 .p2align 4, 0x053c:54 .byte 155 .byte 0xff56 .zero 1457 .size c, 1658.LJTI2_0:59 .quad .LBB2_260 .quad .LBB2_261 .quad .LBB2_262 .quad .LBB2_263 64