blob: 8190730a9f30c0e8a8d0320b9360011913f0a8d1 [file] [log] [blame]
Peter Smith20489ec2017-09-07 16:29:521# REQUIRES: aarch64
2
3# RUN: yaml2obj %s -o %t.o
4# RUN: ld.lld %t.o -o %t.out
Fangrui Songf66b7672019-08-20 08:34:565# RUN: llvm-objdump -d --no-show-raw-insn %t.out | FileCheck %s
Peter Smith20489ec2017-09-07 16:29:526
7# Check that the R_AARCH64_JUMP26 writes the branch opcode as well as the
8# immediate. We use this property to overwrite instructions with a branch.
9
10# CHECK: Disassembly of section .text:
Fangrui Song5387c2c2019-05-01 10:40:4811# CHECK-EMPTY:
Fangrui Song71e2ca62020-03-05 22:18:3812# CHECK-NEXT: <foo>:
Fangrui Song7f36cb12020-04-10 01:46:3513# CHECK-NEXT: 210120: b 0x210124
Fangrui Song71e2ca62020-03-05 22:18:3814# CHECK: <bar>:
Fangrui Song7f36cb12020-04-10 01:46:3515# CHECK-NEXT: 210124: b 0x210120
Peter Smith20489ec2017-09-07 16:29:5216
17!ELF
18FileHeader:
19 Class: ELFCLASS64
20 Data: ELFDATA2LSB
21 Type: ET_REL
22 Machine: EM_AARCH64
23Sections:
24 - Type: SHT_PROGBITS
25 Name: .text
26 Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
27 Content: "0000000000000000"
28 - Type: SHT_RELA
29 Name: .rela.text
30 Link: .symtab
31 Info: .text
32 Relocations:
Georgii Rymare4ceb8f2020-03-04 13:55:1533 - Symbol: bar
Peter Smith20489ec2017-09-07 16:29:5234 Type: R_AARCH64_JUMP26
35 - Offset: 4
36 Symbol: foo
37 Type: R_AARCH64_JUMP26
38
39Symbols:
George Rimarff339722019-04-03 14:54:2240 - Type: STT_FUNC
41 Section: .text
42 Name: foo
43 Value: 0
44 - Type: STT_FUNC
45 Section: .text
46 Name: bar
47 Value: 4