2020-07-31 05:28:41 +08:00
|
|
|
# REQUIRES: x86
|
|
|
|
# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.o
|
|
|
|
|
2021-03-13 06:26:12 +08:00
|
|
|
# RUN: %lld -lSystem %t.o -o %t
|
2020-07-31 05:28:41 +08:00
|
|
|
# RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck %s
|
2021-06-28 15:24:39 +08:00
|
|
|
# CHECK: leaq {{.*}} ## 0x100000000
|
|
|
|
# CHECK-NEXT: leaq {{.*}} ## 0x100000000
|
2020-07-31 05:28:41 +08:00
|
|
|
|
2020-09-19 12:40:12 +08:00
|
|
|
# RUN: %lld -dylib %t.o -o %t.dylib
|
2021-03-13 06:26:12 +08:00
|
|
|
# RUN: llvm-objdump -d --no-show-raw-insn --rebase --section-headers %t.dylib | FileCheck %s --check-prefix=DYLIB-CHECK
|
2021-06-28 15:24:39 +08:00
|
|
|
# DYLIB-CHECK: leaq {{.*}} ## 0x0
|
|
|
|
# DYLIB-CHECK-NEXT: leaq {{.*}} ## 0x0
|
2020-07-31 05:28:41 +08:00
|
|
|
|
2021-03-13 06:26:12 +08:00
|
|
|
# DYLIB-LABEL: Sections:
|
|
|
|
# DYLIB: __data 00000008 [[#%x,DATA:]] DATA
|
|
|
|
# DYLIB-LABEL: Rebase table:
|
|
|
|
# DYLIB-NEXT: segment section address type
|
|
|
|
# DYLIB-NEXT: __DATA __data 0x{{0*}}[[#DATA]] pointer
|
|
|
|
|
|
|
|
# RUN: llvm-objdump --syms %t.dylib | FileCheck %s --check-prefix=SYMS
|
|
|
|
# SYMS-NOT: ___dso_handle
|
|
|
|
|
2020-07-31 05:28:41 +08:00
|
|
|
.globl _main
|
|
|
|
.text
|
|
|
|
_main:
|
|
|
|
leaq ___dso_handle(%rip), %rdx
|
2020-08-28 06:59:48 +08:00
|
|
|
movq ___dso_handle@GOTPCREL(%rip), %rdx
|
2020-07-31 05:28:41 +08:00
|
|
|
ret
|
2021-03-13 06:26:12 +08:00
|
|
|
|
|
|
|
.data
|
|
|
|
.quad ___dso_handle
|