File: ifunc-asm.ll

package info (click to toggle)
llvm-toolchain-20 1%3A20.1.6-1~exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,111,304 kB
  • sloc: cpp: 7,438,677; ansic: 1,393,822; asm: 1,012,926; python: 241,650; f90: 86,635; objc: 75,479; lisp: 42,144; pascal: 17,286; sh: 10,027; ml: 5,082; perl: 4,730; awk: 3,523; makefile: 3,349; javascript: 2,251; xml: 892; fortran: 672
file content (70 lines) | stat: -rw-r--r-- 2,853 bytes parent folder | download | duplicates (7)
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
; RUN: llc -mtriple=arm64-unknown-linux-gnu %s -o - | FileCheck %s --check-prefixes=ELF
; RUN: llc -mtriple=arm64-apple-darwin %s -o - | FileCheck %s --check-prefix=MACHO
; RUN: llc -mtriple=arm64-apple-darwin %s -global-isel -o - | FileCheck %s --check-prefix=MACHO

define internal ptr @the_resolver() {
entry:
  ret ptr null
}
; ELF:             .type the_resolver,@function
; ELF-NEXT:    the_resolver:

; MACHO:           .p2align 2
; MACHO-NEXT:  _the_resolver:


@global_ifunc = ifunc i32 (i32), ptr @the_resolver
; ELF:             .globl global_ifunc
; ELF-NEXT:        .type global_ifunc,@gnu_indirect_function
; ELF-NEXT:        .set global_ifunc, the_resolver

; MACHO:           .section __DATA,__data
; MACHO-NEXT:      .p2align 3, 0x0
; MACHO-NEXT:  _global_ifunc.lazy_pointer:
; MACHO-NEXT:      .quad _global_ifunc.stub_helper

; MACHO:           .section __TEXT,__text,regular,pure_instructions
; MACHO-NEXT:      .globl _global_ifunc
; MACHO-NEXT:      .p2align 2
; MACHO-NEXT:  _global_ifunc:
; MACHO-NEXT:      adrp    x16, _global_ifunc.lazy_pointer@GOTPAGE
; MACHO-NEXT:      ldr     x16, [x16, _global_ifunc.lazy_pointer@GOTPAGEOFF]
; MACHO-NEXT:      ldr     x16, [x16]
; MACHO-NEXT:      br      x16
; MACHO-NEXT:      .p2align        2
; MACHO-NEXT:  _global_ifunc.stub_helper:
; MACHO-NEXT:      stp     x29, x30, [sp, #-16]!
; MACHO-NEXT:      mov     x29, sp
; MACHO-NEXT:      stp     x1, x0, [sp, #-16]!
; MACHO-NEXT:      stp     x3, x2, [sp, #-16]!
; MACHO-NEXT:      stp     x5, x4, [sp, #-16]!
; MACHO-NEXT:      stp     x7, x6, [sp, #-16]!
; MACHO-NEXT:      stp     d1, d0, [sp, #-16]!
; MACHO-NEXT:      stp     d3, d2, [sp, #-16]!
; MACHO-NEXT:      stp     d5, d4, [sp, #-16]!
; MACHO-NEXT:      stp     d7, d6, [sp, #-16]!
; MACHO-NEXT:      bl      _the_resolver
; MACHO-NEXT:      adrp    x16, _global_ifunc.lazy_pointer@GOTPAGE
; MACHO-NEXT:      ldr     x16, [x16, _global_ifunc.lazy_pointer@GOTPAGEOFF]
; MACHO-NEXT:      str     x0, [x16]
; MACHO-NEXT:      add     x16, x0, #0
; MACHO-NEXT:      ldp     d7, d6, [sp], #16
; MACHO-NEXT:      ldp     d5, d4, [sp], #16
; MACHO-NEXT:      ldp     d3, d2, [sp], #16
; MACHO-NEXT:      ldp     d1, d0, [sp], #16
; MACHO-NEXT:      ldp     x7, x6, [sp], #16
; MACHO-NEXT:      ldp     x5, x4, [sp], #16
; MACHO-NEXT:      ldp     x3, x2, [sp], #16
; MACHO-NEXT:      ldp     x1, x0, [sp], #16
; MACHO-NEXT:      ldp     x29, x30, [sp], #16
; MACHO-NEXT:      br      x16


@weak_ifunc = weak ifunc i32 (i32), ptr @the_resolver
; ELF:             .type weak_ifunc,@gnu_indirect_function
; MACHO-NOT:       .weak_reference _weak_ifunc.lazy_pointer
; MACHO:       _weak_ifunc.lazy_pointer:
; MACHO:           .weak_reference _weak_ifunc
; MACHO:       _weak_ifunc:
; MACHO-NOT:       .weak_reference _weak_ifunc.stub_helper
; MACHO:       _weak_ifunc.stub_helper: