2014-07-01 16:41:45 +08:00
|
|
|
# Check we accept -install_name correctly:
|
2014-08-14 07:31:07 +08:00
|
|
|
# RUN: lld -flavor darwin -arch x86_64 -install_name libwibble.dylib -dylib \
|
2014-11-19 10:21:53 +08:00
|
|
|
# RUN: -compatibility_version 2.0 -current_version 5.3 \
|
2014-08-14 07:31:07 +08:00
|
|
|
# RUN: %p/Inputs/libSystem.yaml %s -o %t.dylib
|
2014-07-01 16:15:41 +08:00
|
|
|
# RUN: macho-dump %t.dylib | FileCheck %s --check-prefix=CHECK-BINARY-WRITE
|
2014-07-01 16:41:45 +08:00
|
|
|
|
|
|
|
# Check we read LC_ID_DYLIB correctly:
|
2014-08-14 07:31:07 +08:00
|
|
|
# RUN: lld -flavor darwin -arch x86_64 %p/Inputs/use-dylib-install-names.yaml \
|
|
|
|
# RUN: %t.dylib -r -print_atoms | FileCheck %s --check-prefix=CHECK-BINARY-READ
|
2014-07-01 16:15:41 +08:00
|
|
|
|
2014-07-01 16:41:45 +08:00
|
|
|
# Check we default the install-name to the output file:
|
2014-08-14 07:31:07 +08:00
|
|
|
# RUN: lld -flavor darwin -arch x86_64 -dylib %s -o libwibble.dylib \
|
2014-11-19 10:21:53 +08:00
|
|
|
# RUN: -compatibility_version 2.0 -current_version 5.3 \
|
2014-08-14 07:31:07 +08:00
|
|
|
# RUN: %p/Inputs/libSystem.yaml
|
2014-07-01 16:41:45 +08:00
|
|
|
# RUN: macho-dump libwibble.dylib | FileCheck %s --check-prefix=CHECK-BINARY-WRITE
|
|
|
|
# RUN: rm -f libwibble.dylib
|
|
|
|
|
2014-09-09 10:20:34 +08:00
|
|
|
# Check -single_module does nothing
|
|
|
|
# RUN: lld -flavor darwin -arch x86_64 -dylib %s -install_name libwibble.dylib \
|
2014-11-19 10:21:53 +08:00
|
|
|
# RUN: -compatibility_version 2.0 -current_version 5.3 \
|
2014-09-09 10:20:34 +08:00
|
|
|
# RUN: -single_module -o %t2.dylib %p/Inputs/libSystem.yaml
|
|
|
|
# RUN: macho-dump %t2.dylib | FileCheck %s --check-prefix=CHECK-BINARY-WRITE
|
|
|
|
|
2014-07-01 16:15:41 +08:00
|
|
|
--- !mach-o
|
|
|
|
arch: x86_64
|
|
|
|
file-type: MH_OBJECT
|
|
|
|
flags: [ MH_SUBSECTIONS_VIA_SYMBOLS ]
|
|
|
|
has-UUID: false
|
|
|
|
OS: unknown
|
|
|
|
sections:
|
|
|
|
- segment: __TEXT
|
|
|
|
section: __text
|
|
|
|
type: S_REGULAR
|
|
|
|
attributes: [ S_ATTR_PURE_INSTRUCTIONS, S_ATTR_SOME_INSTRUCTIONS ]
|
|
|
|
alignment: 4
|
|
|
|
address: 0x0000000000000000
|
|
|
|
content: [ 0xCC, 0xC3, 0x90, 0xC3, 0x90, 0x90, 0xC3, 0x90,
|
|
|
|
0x90, 0x90, 0xC3, 0x90, 0x90, 0x90, 0x90, 0xC3,
|
|
|
|
0x31, 0xC0, 0xC3 ]
|
|
|
|
local-symbols:
|
|
|
|
- name: _myStatic
|
|
|
|
type: N_SECT
|
|
|
|
sect: 1
|
|
|
|
value: 0x000000000000000B
|
|
|
|
global-symbols:
|
|
|
|
- name: _myGlobal
|
|
|
|
type: N_SECT
|
|
|
|
scope: [ N_EXT ]
|
|
|
|
sect: 1
|
|
|
|
value: 0x0000000000000001
|
|
|
|
...
|
|
|
|
|
|
|
|
|
|
|
|
# CHECK-BINARY-WRITE: (('command', 13)
|
|
|
|
# CHECK-BINARY-WRITE-NEXT: ('size', 40)
|
|
|
|
# CHECK-BINARY-WRITE-NEXT: ('install_name', 'libwibble.dylib')
|
2014-11-19 10:21:53 +08:00
|
|
|
# CHECK-BINARY-WRITE-NEXT: ('timestamp,
|
|
|
|
# CHECK-BINARY-WRITE-NEXT: ('cur_version, 328448)
|
|
|
|
# CHECK-BINARY-WRITE-NEXT: ('compat_version, 131072)
|
2014-07-01 16:15:41 +08:00
|
|
|
|
|
|
|
# CHECK-BINARY-READ: shared-library-atoms:
|
|
|
|
# CHECK-BINARY-READ: - name: _myGlobal
|
|
|
|
# CHECK-BINARY-READ: load-name: libwibble.dylib
|