File: wrap.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 (42 lines) | stat: -rw-r--r-- 1,327 bytes parent folder | download | duplicates (23)
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
// REQUIRES: x86
// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t
// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %p/Inputs/wrap.s -o %t2

// RUN: ld.lld -o %t3 %t %t2 -wrap foo -wrap nosuchsym
// RUN: llvm-objdump -d --print-imm-hex %t3 | FileCheck %s
// RUN: ld.lld -o %t3 %t %t2 --wrap foo -wrap=nosuchsym
// RUN: llvm-objdump -d --print-imm-hex %t3 | FileCheck %s
// RUN: ld.lld -o %t3 %t %t2 --wrap foo --wrap foo -wrap=nosuchsym
// RUN: llvm-objdump -d --print-imm-hex %t3 | FileCheck %s

// CHECK: <_start>:
// CHECK-NEXT: movl $0x11010, %edx
// CHECK-NEXT: movl $0x11010, %edx
// CHECK-NEXT: movl $0x11000, %edx

// RUN: llvm-readobj --symbols %t3 > %t4.dump
// RUN: FileCheck --check-prefix=SYM1 %s < %t4.dump
// RUN: FileCheck --check-prefix=SYM2 %s < %t4.dump
// RUN: FileCheck --check-prefix=SYM3 %s < %t4.dump

// SYM1:      Name: foo
// SYM1-NEXT: Value: 0x11000
// SYM1-NEXT: Size:
// SYM1-NEXT: Binding: Global
// SYM1-NEXT: Type:    None
// SYM1-NEXT: Other:   0
// SYM2:      Name: __wrap_foo
// SYM2-NEXT: Value: 0x11010
// SYM2-NEXT: Size:
// SYM2-NEXT: Binding: Weak
// SYM2-NEXT: Type:    None
// SYM2-NEXT: Other [
// SYM2-NEXT:   STV_PROTECTED
// SYM2-NEXT: ]
// SYM3-NOT:  Name: __real_foo

.global _start
_start:
  movl $foo, %edx
  movl $__wrap_foo, %edx
  movl $__real_foo, %edx