2016-01-08 01:20:07 +08:00
|
|
|
// 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
|
2020-03-16 08:47:44 +08:00
|
|
|
// RUN: llvm-objdump -d --print-imm-hex %t3 | FileCheck %s
|
2016-01-08 01:20:07 +08:00
|
|
|
// RUN: ld.lld -o %t3 %t %t2 --wrap foo -wrap=nosuchsym
|
2020-03-16 08:47:44 +08:00
|
|
|
// RUN: llvm-objdump -d --print-imm-hex %t3 | FileCheck %s
|
2018-06-19 06:32:15 +08:00
|
|
|
// RUN: ld.lld -o %t3 %t %t2 --wrap foo --wrap foo -wrap=nosuchsym
|
2020-03-16 08:47:44 +08:00
|
|
|
// RUN: llvm-objdump -d --print-imm-hex %t3 | FileCheck %s
|
2016-01-08 01:20:07 +08:00
|
|
|
|
2020-03-06 06:18:38 +08:00
|
|
|
// CHECK: <_start>:
|
2016-01-08 01:20:07 +08:00
|
|
|
// CHECK-NEXT: movl $0x11010, %edx
|
|
|
|
// CHECK-NEXT: movl $0x11010, %edx
|
|
|
|
// CHECK-NEXT: movl $0x11000, %edx
|
|
|
|
|
2019-05-01 13:49:01 +08:00
|
|
|
// RUN: llvm-readobj --symbols %t3 > %t4.dump
|
2017-11-29 07:03:14 +08:00
|
|
|
// 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
|
2017-11-29 07:06:09 +08:00
|
|
|
// SYM2-NEXT: Other [
|
|
|
|
// SYM2-NEXT: STV_PROTECTED
|
|
|
|
// SYM2-NEXT: ]
|
2020-05-28 07:18:55 +08:00
|
|
|
// SYM3-NOT: Name: __real_foo
|
2017-06-23 01:30:19 +08:00
|
|
|
|
2016-01-08 01:20:07 +08:00
|
|
|
.global _start
|
|
|
|
_start:
|
|
|
|
movl $foo, %edx
|
|
|
|
movl $__wrap_foo, %edx
|
|
|
|
movl $__real_foo, %edx
|