llvm-project/lld/test/mach-o/dylib-install-names.yaml

50 lines
1.8 KiB
YAML

# Check we accept -install_name correctly:
# RUN: lld -flavor darwin -arch x86_64 -install_name libwibble.dylib -dylib %s -o %t.dylib
# RUN: macho-dump %t.dylib | FileCheck %s --check-prefix=CHECK-BINARY-WRITE
# Check we read LC_ID_DYLIB correctly:
# RUN: lld -flavor darwin -arch x86_64 %p/Inputs/use-dylib-install-names.yaml %t.dylib -r -print_atoms | FileCheck %s --check-prefix=CHECK-BINARY-READ
# Check we default the install-name to the output file:
# RUN: lld -flavor darwin -arch x86_64 -dylib %s -o libwibble.dylib
# RUN: macho-dump libwibble.dylib | FileCheck %s --check-prefix=CHECK-BINARY-WRITE
# RUN: rm -f libwibble.dylib
--- !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')
# CHECK-BINARY-READ: shared-library-atoms:
# CHECK-BINARY-READ: - name: _myGlobal
# CHECK-BINARY-READ: load-name: libwibble.dylib