1 # Test that obj2yaml + yaml2obj can round-trip mach-o library simple export trie entries.
3 # RUN: rm -rf %t && mkdir -p %t
4 # RUN: yaml2obj %s -o %t/libfoo.dylib | FileCheck %s --allow-empty --implicit-check-not warning: --implicit-check-not error:
5 # RUN: llvm-nm --dyldinfo-only %t/libfoo.dylib | FileCheck %s --check-prefix=NM
8 # RUN: obj2yaml %t/libfoo.dylib | FileCheck %s --check-prefix=YAML
10 # YAML-NEXT: ExportTrie:
12 #YAML-NEXT: - TerminalSize: 3
13 #YAML-NEXT: NodeOffset: 8
14 #YAML-NEXT: Name: _foo
15 #YAML-NEXT: Flags: 0x0
16 #YAML-NEXT: Address: 0x3FB0
17 #YAML-NEXT: Other: 0x0
18 #YAML-NEXT: ImportName: ''
23 # This file was produced using:
24 # int foo() {return 1;} > tmp.c
25 # xcrun clang -Wl,-ld64 -isysroot `xcrun --show-sdk-path -sdk macosx` --target=arm64-apple-macos11.3 -dynamiclib -o libfoo.dylib -install_name @rpath/libfoo.dylib tmp.c
62 content: 20008052C0035FD6
63 - sectname: __unwind_info
75 content: 010000001C000000000000001C000000000000001C00000002000000B03F00003400000034000000B93F00000000000034000000030000000C000100100001000000000000000002
93 compatibility_version: 0
94 Content: '@rpath/libfoo.dylib'
96 - cmd: LC_DYLD_INFO_ONLY
136 uuid: A2CF51D8-828B-3E0F-B8FA-0DF9C5D1C91A
137 - cmd: LC_BUILD_VERSION
146 - cmd: LC_SOURCE_VERSION
154 current_version: 87556096
155 compatibility_version: 65536
156 Content: '/usr/lib/libSystem.B.dylib'
158 - cmd: LC_FUNCTION_STARTS
162 - cmd: LC_DATA_IN_CODE
166 - cmd: LC_CODE_SIGNATURE
202 FunctionStarts: [ 0x3FB0 ]