1 # In this test case, the symbol that represents the end of a table
2 # in .rodata is being colocated with the start of a jump table from
3 # another function, and BOLT moves that jump table. This should not
4 # cause the symbol representing the end of the table to be moved as
6 # Bug reported in https://github.com/llvm/llvm-project/issues/55004
8 # REQUIRES: system-linux
10 # RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %s -o %t.o
11 # RUN: llvm-strip --strip-unneeded %t.o
12 # RUN: %clang %cflags -no-pie -nostartfiles -nostdlib -lc %t.o -o %t.exe -Wl,-q
14 # RUN: llvm-bolt %t.exe -o %t.exe.bolt --relocs=1 --lite=0 \
15 # RUN: --reorder-blocks=reverse -jump-tables=move
17 # RUN: %t.exe.bolt 1 2 3
19 .file "jt-symbol-disambiguation.s"
23 # Func foo contains a jump table whose start is colocated with a
24 # symbol marking the end of a data table
33 movslq
(%rax
, %rdi
, 4), %rdi
53 # Func _start scans a table using begin/end pointers. End pointer is colocated
54 # with the start of a jump table of function foo. When that jump
55 # table moves, end pointer in _start should not be affected.
58 .type _start, @function
63 leaq
.start_of_table(%rip), %rsi # iterator
64 leaq
.end_of_table(%rip), %rdi # iterator end
69 leaq
8(%rsi
), %rsi
# ++iterator
75 .size _start, .-_start
80 .section .rodata,"a",@progbits