File: aarch64-gnu-ifunc2.s

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (48 lines) | stat: -rw-r--r-- 1,361 bytes parent folder | download | duplicates (15)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# REQUIRES: aarch64
# RUN: llvm-mc -filetype=obj -triple=aarch64-none-linux-gnu %s -o %t.o
# RUN: ld.lld %t.o -o %t
# RUN: llvm-objdump -d --no-show-raw-insn --print-imm-hex %t | FileCheck %s
# RUN: llvm-readelf -S %t | FileCheck %s --check-prefix=SEC
# RUN: llvm-readobj -r %t | FileCheck %s --check-prefix=RELOC

# CHECK:      Disassembly of section .text:
# CHECK-EMPTY:
# CHECK-NEXT: <myfunc>:
# CHECK-NEXT:   210170:

# CHECK:      <main>:
# .got.plt - page(0x210174) = 0x220190 - 0x210000 = 0x10190
# CHECK-NEXT:   210174: adrp    x8, 0x220000
# CHECK-NEXT:   210178: ldr     x8, [x8, #0x190]
# CHECK-NEXT:   21017c: ret

# CHECK:      Disassembly of section .iplt:
# CHECK-EMPTY:
# CHECK-NEXT: <.iplt>:
# .got.plt - page(0x210180) = 0x220190 - 0x210000 = 0x10190
# CHECK-NEXT:   210180: adrp    x16, 0x220000
# CHECK-NEXT:   210184: ldr     x17, [x16, #0x190]
# CHECK-NEXT:   210188: add     x16, x16, #0x190
# CHECK-NEXT:   21018c: br      x17

# SEC: .got.plt PROGBITS 0000000000220190 000190 000008 00 WA 0 0 8

# RELOC:      Relocations [
# RELOC-NEXT:   Section {{.*}} .rela.dyn {
# RELOC-NEXT:     0x220190 R_AARCH64_IRELATIVE - 0x210170
# RELOC-NEXT:   }
# RELOC-NEXT: ]

.text
.globl myfunc
.type myfunc,@gnu_indirect_function
myfunc:
 ret

.text
.globl main
.type main,@function
main:
 adrp x8, :got:myfunc
 ldr  x8, [x8, :got_lo12:myfunc]
 ret