xref: /llvm-project/lld/test/ELF/linkerscript/emit-reloc-section-names.s (revision b8dface221f4490933b0d39deb769e97ca134e5f)
1# REQUIRES: x86
2# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
3# RUN: echo "SECTIONS { .text.zed : { *(.text.foo) } .text.qux : { *(.text.bar) } }" > %t.script
4# RUN: ld.lld -T %t.script --emit-relocs %t.o -o %t
5# RUN: llvm-objdump --section-headers %t | FileCheck %s
6# RUN: ld.lld -T %t.script -r %t.o -o %t.ro
7# RUN: llvm-readelf -S %t.ro | FileCheck %s
8
9## Check we name relocation sections in according to
10## their target sections names.
11
12# CHECK: .text.zed
13# CHECK: .text.qux
14# CHECK: .rela.text.zed
15# CHECK: .rela.text.qux
16
17.section .text.foo,"ax"
18foo:
19 mov $bar, %rax
20
21.section .text.bar,"ax"
22bar:
23 mov $foo, %rax
24