Have one version of libSystem for each arch. NFC.
authorPete Cooper <peter_cooper@apple.com>
Thu, 11 Aug 2016 18:08:59 +0000 (18:08 +0000)
committerPete Cooper <peter_cooper@apple.com>
Thu, 11 Aug 2016 18:08:59 +0000 (18:08 +0000)
An upcoming commit will change how we choose to reference a dylib.  Currently
dylibs are only given an LC_LOAD_DYLIB in the final image if an atom is used.
This is different from ld64 which adds the load command when the dylib is referenced
on the cmdline.

In order to change this behaviour, we need libSystem.yaml to actually contain a mach header
so that it is parsed as a dylib, instead of currently being parsed as a normalised file.

To get a mach header, we also require an arch, so now we have one libsystem per arch and
all the tests have been updated to choose the correct one.

llvm-svn: 278372

48 files changed:
lld/test/mach-o/Inputs/arm64/libSystem.yaml [moved from lld/test/mach-o/Inputs/libSystem.yaml with 98% similarity]
lld/test/mach-o/Inputs/armv7/libSystem.yaml [new file with mode: 0644]
lld/test/mach-o/Inputs/x86/libSystem.yaml [new file with mode: 0644]
lld/test/mach-o/Inputs/x86_64/libSystem.yaml [new file with mode: 0644]
lld/test/mach-o/arm-interworking-movw.yaml
lld/test/mach-o/arm-interworking.yaml
lld/test/mach-o/arm-shims.yaml
lld/test/mach-o/data-in-code-load-command.yaml
lld/test/mach-o/data-only-dylib.yaml
lld/test/mach-o/dead-strip-globals.yaml
lld/test/mach-o/debug-syms.yaml
lld/test/mach-o/demangle.yaml
lld/test/mach-o/dso_handle.yaml
lld/test/mach-o/dylib-install-names.yaml
lld/test/mach-o/exe-offsets.yaml
lld/test/mach-o/exe-segment-overlap.yaml
lld/test/mach-o/executable-exports.yaml
lld/test/mach-o/exported_symbols_list-dylib.yaml
lld/test/mach-o/exported_symbols_list-undef.yaml
lld/test/mach-o/fat-archive.yaml
lld/test/mach-o/flat_namespace_undef_error.yaml
lld/test/mach-o/flat_namespace_undef_suppress.yaml
lld/test/mach-o/force_load-dylib.yaml
lld/test/mach-o/force_load-x86_64.yaml
lld/test/mach-o/function-starts-load-command.yaml
lld/test/mach-o/gcc_except_tab-got-arm64.yaml
lld/test/mach-o/got-order.yaml
lld/test/mach-o/image-base.yaml
lld/test/mach-o/interposing-section.yaml
lld/test/mach-o/lazy-bind-x86_64.yaml
lld/test/mach-o/library-order.yaml
lld/test/mach-o/library-rescan.yaml
lld/test/mach-o/mh_bundle_header.yaml
lld/test/mach-o/mh_dylib_header.yaml
lld/test/mach-o/objc_export_list.yaml
lld/test/mach-o/order_file-basic.yaml
lld/test/mach-o/parse-data-in-code-armv7.yaml
lld/test/mach-o/rpath.yaml
lld/test/mach-o/sectalign.yaml
lld/test/mach-o/sectattrs.yaml
lld/test/mach-o/source-version.yaml
lld/test/mach-o/stack-size.yaml
lld/test/mach-o/twolevel_namespace_undef_dynamic_lookup.yaml
lld/test/mach-o/twolevel_namespace_undef_warning_suppress.yaml
lld/test/mach-o/unwind-info-simple-arm64.yaml
lld/test/mach-o/unwind-info-simple-x86_64.yaml
lld/test/mach-o/upward-dylib-load-command.yaml
lld/test/mach-o/version-min-load-command.yaml

similarity index 98%
rename from lld/test/mach-o/Inputs/libSystem.yaml
rename to lld/test/mach-o/Inputs/arm64/libSystem.yaml
index 2a7f463..ab95403 100644 (file)
@@ -3,7 +3,6 @@
 # and therefore will need a dylib definition of dyld_stub_binder.
 #
 
----
 shared-library-atoms:
     - name:              dyld_stub_binder
       load-name:         /usr/lib/libSystem.B.dylib
diff --git a/lld/test/mach-o/Inputs/armv7/libSystem.yaml b/lld/test/mach-o/Inputs/armv7/libSystem.yaml
new file mode 100644 (file)
index 0000000..ab95403
--- /dev/null
@@ -0,0 +1,12 @@
+#
+# For use by test cases that create dynamic output types which may needs stubs
+# and therefore will need a dylib definition of dyld_stub_binder.
+#
+
+shared-library-atoms:
+    - name:              dyld_stub_binder
+      load-name:         /usr/lib/libSystem.B.dylib
+      type:              code
+      size:              0
+
+...
diff --git a/lld/test/mach-o/Inputs/x86/libSystem.yaml b/lld/test/mach-o/Inputs/x86/libSystem.yaml
new file mode 100644 (file)
index 0000000..ab95403
--- /dev/null
@@ -0,0 +1,12 @@
+#
+# For use by test cases that create dynamic output types which may needs stubs
+# and therefore will need a dylib definition of dyld_stub_binder.
+#
+
+shared-library-atoms:
+    - name:              dyld_stub_binder
+      load-name:         /usr/lib/libSystem.B.dylib
+      type:              code
+      size:              0
+
+...
diff --git a/lld/test/mach-o/Inputs/x86_64/libSystem.yaml b/lld/test/mach-o/Inputs/x86_64/libSystem.yaml
new file mode 100644 (file)
index 0000000..ab95403
--- /dev/null
@@ -0,0 +1,12 @@
+#
+# For use by test cases that create dynamic output types which may needs stubs
+# and therefore will need a dylib definition of dyld_stub_binder.
+#
+
+shared-library-atoms:
+    - name:              dyld_stub_binder
+      load-name:         /usr/lib/libSystem.B.dylib
+      type:              code
+      size:              0
+
+...
index 0423ed6..b555112 100644 (file)
@@ -1,7 +1,7 @@
 # REQUIRES: arm
 # RUN: lld -flavor darwin -arch armv7 -r -print_atoms %s -o %t  | FileCheck %s
 # RUN: lld -flavor darwin -arch armv7 -dylib -print_atoms %t -o %t2 \
-# RUN:     %p/Inputs/libSystem.yaml -sectalign __TEXT __text 0x1000  | FileCheck %s
+# RUN:     %p/Inputs/armv7/libSystem.yaml -sectalign __TEXT __text 0x1000  | FileCheck %s
 # RUN: llvm-objdump -d -macho -no-symbolic-operands %t2 | FileCheck -check-prefix=CODE %s
 #
 # Test thumb and arm branches round trip through -r.
index 59c4605..3988a19 100644 (file)
@@ -1,7 +1,7 @@
 # RUN: lld -flavor darwin -arch armv7 -r -print_atoms %s \
 # RUN: %p/Inputs/arm-interworking.yaml -o %t  | FileCheck %s \
 # RUN: && lld -flavor darwin -arch armv7 -dylib -print_atoms \
-# RUN:         %p/Inputs/libSystem.yaml %t -o %t2  | FileCheck %s \
+# RUN:         %p/Inputs/armv7/libSystem.yaml %t -o %t2  | FileCheck %s \
 # RUN: && llvm-readobj -s -sd %t2 | FileCheck -check-prefix=CODE %s
 #
 # Test thumb and arm branches round trip through -r.
index 62739c9..1b54de4 100644 (file)
@@ -1,5 +1,5 @@
 # RUN: lld -flavor darwin -arch armv7 %s %p/Inputs/arm-shims.yaml \
-# RUN: -dylib %p/Inputs/libSystem.yaml -o %t
+# RUN: -dylib %p/Inputs/armv7/libSystem.yaml -o %t
 # RUN: llvm-readobj -s -sd %t | FileCheck %s
 #
 # Test b from arm to thumb or vice versa has shims added.s
index 604592a..0c84bd4 100644 (file)
@@ -1,11 +1,11 @@
-# RUN: lld -flavor darwin -arch x86_64 -macosx_version_min 10.8 %s -o %t -dylib %p/Inputs/libSystem.yaml && llvm-objdump -private-headers %t | FileCheck %s
-# RUN: lld -flavor darwin -arch x86_64 -macosx_version_min 10.8 %s -o %t -dylib %p/Inputs/libSystem.yaml -static -data_in_code_info && llvm-objdump -private-headers %t | FileCheck %s
-# RUN: lld -flavor darwin -arch x86_64 -macosx_version_min 10.8 %s -o %t -dylib %p/Inputs/libSystem.yaml -no_data_in_code_info && llvm-objdump -private-headers %t | FileCheck %s --check-prefix=NO_DATA_IN_CODE_INFO
-# RUN: lld -flavor darwin -arch x86_64 -macosx_version_min 10.8 %s -o %t -dylib %p/Inputs/libSystem.yaml -static -data_in_code_info -no_data_in_code_info && llvm-objdump -private-headers %t | FileCheck %s --check-prefix=NO_DATA_IN_CODE_INFO
-# RUN: lld -flavor darwin -arch x86_64 -macosx_version_min 10.8 %s -o %t -dylib %p/Inputs/libSystem.yaml -static && llvm-objdump -private-headers %t | FileCheck %s --check-prefix=NO_DATA_IN_CODE_INFO
-# RUN: lld -flavor darwin -arch x86_64 -macosx_version_min 10.8 %s -o %t -dylib %p/Inputs/libSystem.yaml -r && llvm-objdump -private-headers %t | FileCheck %s
-# RUN: lld -flavor darwin -arch x86_64 -macosx_version_min 10.8 %s -o %t -dylib %p/Inputs/libSystem.yaml -r -data_in_code_info && llvm-objdump -private-headers %t | FileCheck %s
-# RUN: lld -flavor darwin -arch x86_64 -macosx_version_min 10.8 %s -o %t -dylib %p/Inputs/libSystem.yaml -r -no_data_in_code_info && llvm-objdump -private-headers %t | FileCheck %s --check-prefix=NO_DATA_IN_CODE_INFO
+# RUN: lld -flavor darwin -arch x86_64 -macosx_version_min 10.8 %s -o %t -dylib %p/Inputs/x86_64/libSystem.yaml && llvm-objdump -private-headers %t | FileCheck %s
+# RUN: lld -flavor darwin -arch x86_64 -macosx_version_min 10.8 %s -o %t -dylib %p/Inputs/x86_64/libSystem.yaml -static -data_in_code_info && llvm-objdump -private-headers %t | FileCheck %s
+# RUN: lld -flavor darwin -arch x86_64 -macosx_version_min 10.8 %s -o %t -dylib %p/Inputs/x86_64/libSystem.yaml -no_data_in_code_info && llvm-objdump -private-headers %t | FileCheck %s --check-prefix=NO_DATA_IN_CODE_INFO
+# RUN: lld -flavor darwin -arch x86_64 -macosx_version_min 10.8 %s -o %t -dylib %p/Inputs/x86_64/libSystem.yaml -static -data_in_code_info -no_data_in_code_info && llvm-objdump -private-headers %t | FileCheck %s --check-prefix=NO_DATA_IN_CODE_INFO
+# RUN: lld -flavor darwin -arch x86_64 -macosx_version_min 10.8 %s -o %t -dylib %p/Inputs/x86_64/libSystem.yaml -static && llvm-objdump -private-headers %t | FileCheck %s --check-prefix=NO_DATA_IN_CODE_INFO
+# RUN: lld -flavor darwin -arch x86_64 -macosx_version_min 10.8 %s -o %t -dylib %p/Inputs/x86_64/libSystem.yaml -r && llvm-objdump -private-headers %t | FileCheck %s
+# RUN: lld -flavor darwin -arch x86_64 -macosx_version_min 10.8 %s -o %t -dylib %p/Inputs/x86_64/libSystem.yaml -r -data_in_code_info && llvm-objdump -private-headers %t | FileCheck %s
+# RUN: lld -flavor darwin -arch x86_64 -macosx_version_min 10.8 %s -o %t -dylib %p/Inputs/x86_64/libSystem.yaml -r -no_data_in_code_info && llvm-objdump -private-headers %t | FileCheck %s --check-prefix=NO_DATA_IN_CODE_INFO
 
 --- !mach-o
 arch:            x86_64
index 8d21430..541e02f 100644 (file)
@@ -1,4 +1,4 @@
-# RUN: lld -flavor darwin -arch x86_64 -dylib %s -o %t %p/Inputs/libSystem.yaml
+# RUN: lld -flavor darwin -arch x86_64 -dylib %s -o %t %p/Inputs/x86_64/libSystem.yaml
 # RUN: llvm-nm %t | FileCheck %s
 #
 # Test that a data-only dylib can be built.
index df5ff73..6cb8164 100644 (file)
@@ -1,6 +1,6 @@
-# RUN: lld -flavor darwin -arch x86_64 -dead_strip -export_dynamic %s -dylib %p/Inputs/libSystem.yaml -o %t.dylib -print_atoms | FileCheck -check-prefix=CHECK1 %s
-# RUN: lld -flavor darwin -arch x86_64 -export_dynamic -dead_strip %s -dylib %p/Inputs/libSystem.yaml -o %t.dylib -print_atoms | FileCheck -check-prefix=CHECK1 %s
-# RUN: lld -flavor darwin -arch x86_64 -dead_strip %s -dylib %p/Inputs/libSystem.yaml -o %t2.dylib -print_atoms | FileCheck -check-prefix=CHECK2 %s
+# RUN: lld -flavor darwin -arch x86_64 -dead_strip -export_dynamic %s -dylib %p/Inputs/x86_64/libSystem.yaml -o %t.dylib -print_atoms | FileCheck -check-prefix=CHECK1 %s
+# RUN: lld -flavor darwin -arch x86_64 -export_dynamic -dead_strip %s -dylib %p/Inputs/x86_64/libSystem.yaml -o %t.dylib -print_atoms | FileCheck -check-prefix=CHECK1 %s
+# RUN: lld -flavor darwin -arch x86_64 -dead_strip %s -dylib %p/Inputs/x86_64/libSystem.yaml -o %t2.dylib -print_atoms | FileCheck -check-prefix=CHECK2 %s
 
 #
 # Test that -export_dynamic -dead-strip from removing globals.
index 0365e34..bd2eb5c 100644 (file)
@@ -1,4 +1,4 @@
-# RUN: lld -flavor darwin -arch x86_64 -o %t %s -dylib %p/Inputs/libSystem.yaml && \
+# RUN: lld -flavor darwin -arch x86_64 -o %t %s -dylib %p/Inputs/x86_64/libSystem.yaml && \
 # RUN:   llvm-nm -no-sort -debug-syms %t | FileCheck %s
 
 # CHECK:      0000000000000000 - 00 0000    SO /Users/lhames/Projects/lld/lld-svn-tot/scratch/
index f8a76cd..333a59e 100644 (file)
@@ -1,11 +1,11 @@
 # REQUIRES: system-linker-mach-o
 #
 # RUN: not lld -flavor darwin -arch x86_64 -macosx_version_min 10.8 %s  \
-# RUN:     -dylib -o %t %p/Inputs/libSystem.yaml  2> %t.err
+# RUN:     -dylib -o %t %p/Inputs/x86_64/libSystem.yaml  2> %t.err
 # RUN: FileCheck %s < %t.err
 #
 # RUN: not lld -flavor darwin -arch x86_64 -macosx_version_min 10.8 %s \
-# RUN:     -dylib -o %t %p/Inputs/libSystem.yaml -demangle 2> %t.err2
+# RUN:     -dylib -o %t %p/Inputs/x86_64/libSystem.yaml -demangle 2> %t.err2
 # RUN: FileCheck %s --check-prefix=DCHECK < %t.err2
 #
 # Test -demangle option works on undefined symbol errors.
index 400e2c8..0796c2e 100644 (file)
@@ -1,13 +1,13 @@
-# RUN: lld -flavor darwin -arch x86_64  %s  %p/Inputs/libSystem.yaml -o %t1
+# RUN: lld -flavor darwin -arch x86_64  %s  %p/Inputs/x86_64/libSystem.yaml -o %t1
 # RUN: llvm-nm -m -n %t1 | FileCheck %s
 #
-# RUN: lld -flavor darwin -arch x86_64  %s %p/Inputs/libSystem.yaml -dead_strip -o %t2
+# RUN: lld -flavor darwin -arch x86_64  %s %p/Inputs/x86_64/libSystem.yaml -dead_strip -o %t2
 # RUN: llvm-nm -m -n %t2 | FileCheck %s
 #
-# RUN: lld -flavor darwin -arch x86_64  %s %p/Inputs/libSystem.yaml -dylib -o %t3
+# RUN: lld -flavor darwin -arch x86_64  %s %p/Inputs/x86_64/libSystem.yaml -dylib -o %t3
 # RUN: llvm-nm -m -n %t3 | FileCheck %s
 #
-# RUN: lld -flavor darwin -arch x86_64  %s %p/Inputs/libSystem.yaml -bundle -o %t4
+# RUN: lld -flavor darwin -arch x86_64  %s %p/Inputs/x86_64/libSystem.yaml -bundle -o %t4
 # RUN: llvm-nm -m -n %t4 | FileCheck %s
 #
 # Test that ___dso_handle symbol is available for executables, bundles, and dylibs
index 845085b..a5a801c 100644 (file)
@@ -1,25 +1,25 @@
 # Check we accept -install_name correctly:
 # RUN: lld -flavor darwin -arch x86_64 -install_name libwibble.dylib -dylib \
 # RUN:     -compatibility_version 2.0 -current_version 5.3 \
-# RUN:     %p/Inputs/libSystem.yaml %s -o %t.dylib
+# RUN:     %p/Inputs/x86_64/libSystem.yaml %s -o %t.dylib
 # RUN: llvm-objdump -private-headers %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 \
-# RUN:      %p/Inputs/libSystem.yaml %t.dylib -dylib -o %t2.dylib
+# RUN:      %p/Inputs/x86_64/libSystem.yaml %t.dylib -dylib -o %t2.dylib
 # RUN: llvm-objdump -private-headers %t2.dylib | 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:     -compatibility_version 2.0 -current_version 5.3 \
-# RUN:     %p/Inputs/libSystem.yaml
+# RUN:     %p/Inputs/x86_64/libSystem.yaml
 # RUN: llvm-objdump -private-headers libwibble.dylib | FileCheck %s --check-prefix=CHECK-BINARY-WRITE
 # RUN: rm -f libwibble.dylib
 
 # Check -single_module does nothing
 # RUN: lld -flavor darwin -arch x86_64 -dylib %s -install_name libwibble.dylib \
 # RUN:     -compatibility_version 2.0 -current_version 5.3 \
-# RUN:     -single_module -o %t2.dylib %p/Inputs/libSystem.yaml
+# RUN:     -single_module -o %t2.dylib %p/Inputs/x86_64/libSystem.yaml
 # RUN: llvm-objdump -private-headers %t2.dylib | FileCheck %s --check-prefix=CHECK-BINARY-WRITE
 
 --- !mach-o
index a751507..6a0e35c 100644 (file)
@@ -1,4 +1,4 @@
-# RUN: lld -flavor darwin -arch x86_64 %s -o %t -e start %p/Inputs/libSystem.yaml
+# RUN: lld -flavor darwin -arch x86_64 %s -o %t -e start %p/Inputs/x86_64/libSystem.yaml
 # RUN: llvm-readobj -sections %t | FileCheck %s
 
 # Make sure data gets put at offset
index a416ee3..47f0214 100644 (file)
@@ -1,4 +1,4 @@
-# RUN: lld -flavor darwin -arch x86_64 %s -o %t %p/Inputs/libSystem.yaml
+# RUN: lld -flavor darwin -arch x86_64 %s -o %t %p/Inputs/x86_64/libSystem.yaml
 # RUN: llvm-readobj -sections -section-data %t | FileCheck %s
 
 --- !native
index b14e2d2..0b8717e 100644 (file)
@@ -1,5 +1,5 @@
 # RUN: lld -flavor darwin -arch x86_64 -macosx_version_min 10.8 \
-# RUN:      %s %p/Inputs/libSystem.yaml -o %t  && \
+# RUN:      %s %p/Inputs/x86_64/libSystem.yaml -o %t  && \
 # RUN: llvm-objdump -exports-trie %t | FileCheck %s
 #
 #
index f526140..f9de5fe 100644 (file)
@@ -1,20 +1,20 @@
 # RUN: lld -flavor darwin -arch x86_64 -macosx_version_min 10.8 -dylib \
-# RUN:      %s %p/Inputs/libSystem.yaml -o %t \
+# RUN:      %s %p/Inputs/x86_64/libSystem.yaml -o %t \
 # RUN:      -exported_symbols_list %p/Inputs/exported_symbols_list.exp && \
 # RUN: llvm-nm -m %t | FileCheck %s
 #
 # RUN: lld -flavor darwin -arch x86_64 -macosx_version_min 10.8 -dylib \
-# RUN:      %s %p/Inputs/libSystem.yaml -o %t2 \
+# RUN:      %s %p/Inputs/x86_64/libSystem.yaml -o %t2 \
 # RUN:      -exported_symbol _foo -exported_symbol _b  && \
 # RUN: llvm-nm -m %t2 | FileCheck %s
 #
 # RUN: lld -flavor darwin -arch x86_64 -macosx_version_min 10.8 -dylib \
-# RUN:      %s %p/Inputs/libSystem.yaml -o %t3 \
+# RUN:      %s %p/Inputs/x86_64/libSystem.yaml -o %t3 \
 # RUN:      -unexported_symbol _bar -unexported_symbol _a  && \
 # RUN: llvm-nm -m %t3 | FileCheck %s
 #
 # RUN: lld -flavor darwin -arch x86_64 -macosx_version_min 10.8 -dylib \
-# RUN:      %s %p/Inputs/libSystem.yaml -dead_strip -o %t \
+# RUN:      %s %p/Inputs/x86_64/libSystem.yaml -dead_strip -o %t \
 # RUN:      -exported_symbols_list %p/Inputs/exported_symbols_list.exp && \
 # RUN: llvm-nm -m %t | FileCheck -check-prefix=CHECK_DEAD %s
 #
index 1e2fc82..377282f 100644 (file)
@@ -1,5 +1,5 @@
 # RUN: not lld -flavor darwin -arch x86_64 -macosx_version_min 10.8 -dylib \
-# RUN:      %s %p/Inputs/libSystem.yaml -o %t -exported_symbol _foobar 2> %t2
+# RUN:      %s %p/Inputs/x86_64/libSystem.yaml -o %t -exported_symbol _foobar 2> %t2
 #
 # Test -exported_symbol fails if exported symbol not found.
 #
index 86828d6..979ede3 100644 (file)
@@ -1,5 +1,5 @@
 # RUN: lld -flavor darwin -arch x86_64 -macosx_version_min 10.8 %s -o %t \
-# RUN:    -L %p/Inputs -lfoo %p/Inputs/libSystem.yaml
+# RUN:    -L %p/Inputs -lfoo %p/Inputs/x86_64/libSystem.yaml
 # RUN: llvm-nm -m -n %t | FileCheck %s
 #
 # Test that fat archives are handled.
index 904b9c7..af84608 100644 (file)
@@ -1,4 +1,4 @@
-# RUN: not lld -flavor darwin -arch x86_64 -macosx_version_min 10.9 -flat_namespace -undefined error %s -o %t %p/Inputs/libSystem.yaml 2>&1 | FileCheck %s
+# RUN: not lld -flavor darwin -arch x86_64 -macosx_version_min 10.9 -flat_namespace -undefined error %s -o %t %p/Inputs/x86_64/libSystem.yaml 2>&1 | FileCheck %s
 
 --- !native
 defined-atoms:
index 5152a1c..e68fd99 100644 (file)
@@ -1,4 +1,4 @@
-# RUN: lld -flavor darwin -arch x86_64 -macosx_version_min 10.9 -flat_namespace -undefined suppress %s -o %t %p/Inputs/libSystem.yaml
+# RUN: lld -flavor darwin -arch x86_64 -macosx_version_min 10.9 -flat_namespace -undefined suppress %s -o %t %p/Inputs/x86_64/libSystem.yaml
 #
 # Sanity check '-flat_namespace -undefined suppress'.
 # This should pass without error, even though '_bar' is undefined.
index c8f559b..d32c63e 100644 (file)
@@ -1,7 +1,7 @@
 # RUN: lld -flavor darwin -arch x86_64 -dylib %p/Inputs/bar.yaml \
-# RUN:     -install_name /usr/lib/libbar.dylib %p/Inputs/libSystem.yaml -o %t1.dylib
+# RUN:     -install_name /usr/lib/libbar.dylib %p/Inputs/x86_64/libSystem.yaml -o %t1.dylib
 # RUN: lld -flavor darwin -arch x86_64 -dylib %s -all_load %t1.dylib \
-# RUN:      -install_name /usr/lib/libfoo.dylib %p/Inputs/libSystem.yaml -o %t
+# RUN:      -install_name /usr/lib/libfoo.dylib %p/Inputs/x86_64/libSystem.yaml -o %t
 # RUN: llvm-nm -m %t | FileCheck %s
 #
 #
index 1be216c..5b37f47 100644 (file)
@@ -1,8 +1,8 @@
-# RUN: lld -flavor darwin -arch x86_64  %s %p/Inputs/libSystem.yaml \
+# RUN: lld -flavor darwin -arch x86_64  %s %p/Inputs/x86_64/libSystem.yaml \
 # RUN:      %p/Inputs/libfoo.a %p/Inputs/libbar.a -o %t1
 # RUN: llvm-nm -m -n %t1 | FileCheck %s
 #
-# RUN: lld -flavor darwin -arch x86_64  %s %p/Inputs/libSystem.yaml \
+# RUN: lld -flavor darwin -arch x86_64  %s %p/Inputs/x86_64/libSystem.yaml \
 # RUN:      -force_load %p/Inputs/libfoo.a %p/Inputs/libbar.a -o %t2
 # RUN: llvm-nm -m -n %t2 | FileCheck --check-prefix=CHECKF %s
 #
index 9f25189..5cfe9dc 100644 (file)
@@ -1,8 +1,8 @@
-# RUN: lld -flavor darwin -arch x86_64 -macosx_version_min 10.8 %s -o %t -dylib %p/Inputs/libSystem.yaml && llvm-objdump -private-headers %t | FileCheck %s
-# RUN: lld -flavor darwin -arch x86_64 -macosx_version_min 10.8 %s -o %t -dylib %p/Inputs/libSystem.yaml -static -function_starts && llvm-objdump -private-headers %t | FileCheck %s
-# RUN: lld -flavor darwin -arch x86_64 -macosx_version_min 10.8 %s -o %t -dylib %p/Inputs/libSystem.yaml -no_function_starts && llvm-objdump -private-headers %t | FileCheck %s --check-prefix=NO_FUNCTION_STARTS
-# RUN: lld -flavor darwin -arch x86_64 -macosx_version_min 10.8 %s -o %t -dylib %p/Inputs/libSystem.yaml -static -function_starts -no_function_starts && llvm-objdump -private-headers %t | FileCheck %s --check-prefix=NO_FUNCTION_STARTS
-# RUN: lld -flavor darwin -arch x86_64 -macosx_version_min 10.8 %s -o %t -dylib %p/Inputs/libSystem.yaml -static && llvm-objdump -private-headers %t | FileCheck %s --check-prefix=NO_FUNCTION_STARTS
+# RUN: lld -flavor darwin -arch x86_64 -macosx_version_min 10.8 %s -o %t -dylib %p/Inputs/x86_64/libSystem.yaml && llvm-objdump -private-headers %t | FileCheck %s
+# RUN: lld -flavor darwin -arch x86_64 -macosx_version_min 10.8 %s -o %t -dylib %p/Inputs/x86_64/libSystem.yaml -static -function_starts && llvm-objdump -private-headers %t | FileCheck %s
+# RUN: lld -flavor darwin -arch x86_64 -macosx_version_min 10.8 %s -o %t -dylib %p/Inputs/x86_64/libSystem.yaml -no_function_starts && llvm-objdump -private-headers %t | FileCheck %s --check-prefix=NO_FUNCTION_STARTS
+# RUN: lld -flavor darwin -arch x86_64 -macosx_version_min 10.8 %s -o %t -dylib %p/Inputs/x86_64/libSystem.yaml -static -function_starts -no_function_starts && llvm-objdump -private-headers %t | FileCheck %s --check-prefix=NO_FUNCTION_STARTS
+# RUN: lld -flavor darwin -arch x86_64 -macosx_version_min 10.8 %s -o %t -dylib %p/Inputs/x86_64/libSystem.yaml -static && llvm-objdump -private-headers %t | FileCheck %s --check-prefix=NO_FUNCTION_STARTS
 
 --- !mach-o
 arch:            x86_64
index 7d105ec..9645f41 100644 (file)
@@ -1,5 +1,5 @@
 # RUN: lld -flavor darwin -arch arm64 %s \
-# RUN: -dylib %p/Inputs/libSystem.yaml -o %t
+# RUN: -dylib %p/Inputs/arm64/libSystem.yaml -o %t
 # RUN: llvm-objdump -section-headers %t | FileCheck %s
 
 # Make sure that the GOT relocation from gcc_except_tab to the data
index b69877e..2e8579c 100644 (file)
@@ -1,5 +1,5 @@
 # RUN: lld -flavor darwin -arch x86_64  %s %p/Inputs/got-order.yaml \
-# RUN: %p/Inputs/got-order2.yaml -o %t %p/Inputs/libSystem.yaml
+# RUN: %p/Inputs/got-order2.yaml -o %t %p/Inputs/x86_64/libSystem.yaml
 # RUN: llvm-objdump -bind %t | FileCheck %s
 #
 # Test that GOT slots are sorted by name
index d274621..aa78fea 100644 (file)
@@ -1,4 +1,4 @@
-# RUN: lld -flavor darwin -arch x86_64 -macosx_version_min 10.9 %s -o %t -image_base 31415926000 %p/Inputs/libSystem.yaml
+# RUN: lld -flavor darwin -arch x86_64 -macosx_version_min 10.9 %s -o %t -image_base 31415926000 %p/Inputs/x86_64/libSystem.yaml
 # RUN: llvm-readobj -macho-segment %t | FileCheck %s
 # RUN: not lld -flavor darwin -arch x86_64 -image_base 0x31415926530 %s >/dev/null 2> %t
 # RUN: FileCheck < %t %s --check-prefix=CHECK-ERROR-MISPAGED
index 4f6bafc..ec4eaa3 100644 (file)
@@ -1,5 +1,5 @@
 # RUN: lld -flavor darwin -arch x86_64  %s %p/Inputs/interposing-section.yaml \
-# RUN: -dylib -o %t %p/Inputs/libSystem.yaml
+# RUN: -dylib -o %t %p/Inputs/x86_64/libSystem.yaml
 # RUN: llvm-objdump -private-headers %t | FileCheck %s
 #
 # RUN: lld -flavor darwin -arch x86_64  %s -r -o %t1
index ee3e227..5c588c5 100644 (file)
@@ -3,7 +3,7 @@
 # RUN: lld -flavor darwin -arch x86_64 -macosx_version_min 10.8 %s \
 # RUN: %p/Inputs/lazy-bind-x86_64.yaml  %p/Inputs/lazy-bind-x86_64-2.yaml \
 # RUN: %p/Inputs/lazy-bind-x86_64-3.yaml -o %t  \
-# RUN:   %p/Inputs/libSystem.yaml
+# RUN:   %p/Inputs/x86_64/libSystem.yaml
 # RUN: llvm-objdump -lazy-bind %t | FileCheck %s
 # RUN: llvm-nm -m %t | FileCheck --check-prefix=CHECK-NM %s
 # RUN: llvm-objdump -disassemble %t | FileCheck --check-prefix=CHECK-HELPERS %s
index f9cd5a6..b53232d 100644 (file)
@@ -1,5 +1,5 @@
 # RUN: lld -flavor darwin -arch x86_64 %p/Inputs/libfoo.a %s -o %t \
-# RUN:    %p/Inputs/libSystem.yaml
+# RUN:    %p/Inputs/x86_64/libSystem.yaml
 # RUN: llvm-nm -m -n %t | FileCheck %s
 #
 # Test that if library is before object file on command line, it still is used.
index a8a0ca8..99c7b88 100644 (file)
@@ -1,5 +1,5 @@
 # RUN: lld -flavor darwin -arch x86_64 %p/Inputs/libfoo.a %p/Inputs/libbar.a \
-# RUN:    %s -o %t  %p/Inputs/libSystem.yaml
+# RUN:    %s -o %t  %p/Inputs/x86_64/libSystem.yaml
 # RUN: llvm-nm -m -n %t | FileCheck %s
 #
 # Test that static libraries are automatically rescanned (bar needs foo).
index e440141..d1b7d9a 100644 (file)
@@ -1,5 +1,5 @@
-# RUN: lld -flavor darwin -arch x86_64  %s -bundle -o %t %p/Inputs/libSystem.yaml && llvm-nm -m -n %t | FileCheck %s
-# RUN: lld -flavor darwin -arch x86_64  %s -bundle -dead_strip -o %t %p/Inputs/libSystem.yaml && llvm-nm -m -n %t | FileCheck %s
+# RUN: lld -flavor darwin -arch x86_64  %s -bundle -o %t %p/Inputs/x86_64/libSystem.yaml && llvm-nm -m -n %t | FileCheck %s
+# RUN: lld -flavor darwin -arch x86_64  %s -bundle -dead_strip -o %t %p/Inputs/x86_64/libSystem.yaml && llvm-nm -m -n %t | FileCheck %s
 #
 # Test that __mh_bundle_header symbol is available for bundles
 #
index 96b67aa..8222063 100644 (file)
@@ -1,4 +1,4 @@
-# RUN: lld -flavor darwin -arch x86_64  %s -dylib -o %t %p/Inputs/libSystem.yaml
+# RUN: lld -flavor darwin -arch x86_64  %s -dylib -o %t %p/Inputs/x86_64/libSystem.yaml
 # RUN: llvm-nm -m -n %t | FileCheck %s
 #
 # Test that __mh_dylib_header symbol is available for dylibs
index e67a4c7..a2fcfa2 100644 (file)
@@ -1,5 +1,5 @@
 # RUN: lld -flavor darwin -arch x86_64 -dylib %s -o %t \
-# RUN:     -exported_symbol .objc_class_name_Foo %p/Inputs/libSystem.yaml
+# RUN:     -exported_symbol .objc_class_name_Foo %p/Inputs/x86_64/libSystem.yaml
 # RUN: llvm-nm -m %t | FileCheck %s
 #
 # Test that exported objc classes can be specificed using old naming
index 3fea9be..f4d29fa 100644 (file)
@@ -1,4 +1,4 @@
-# RUN: lld -flavor darwin -arch x86_64 %s %p/Inputs/libSystem.yaml \
+# RUN: lld -flavor darwin -arch x86_64 %s %p/Inputs/x86_64/libSystem.yaml \
 # RUN:     -order_file %p/Inputs/order_file-basic.order \
 # RUN:     -force_load %p/Inputs/libfoo.a -o %t
 # RUN: llvm-nm -m -n %t | FileCheck %s
index 720f24d..6c66f40 100644 (file)
@@ -1,6 +1,6 @@
 # RUN: lld -flavor darwin -arch armv7 -r -print_atoms %s -o %t  | FileCheck %s
 # RUN: lld -flavor darwin -arch armv7 -r -print_atoms %t -o %t2  | FileCheck %s
-# RUN: lld -flavor darwin -arch armv7 -dylib %s -o %t3.dylib %p/Inputs/libSystem.yaml \
+# RUN: lld -flavor darwin -arch armv7 -dylib %s -o %t3.dylib %p/Inputs/x86_64/libSystem.yaml \
 # RUN:   && llvm-objdump -macho -private-headers %t3.dylib | FileCheck --check-prefix=CHECK2 %s
 #
 # Test parsing LC_DATA_IN_CODE
index ce1234d..6391493 100644 (file)
@@ -1,6 +1,6 @@
 # Check we handle -rpath correctly:
 # RUN: lld -flavor darwin -arch x86_64 -rpath @loader_path/../Frameworks \
-# RUN:     %p/Inputs/libSystem.yaml %s -o %t
+# RUN:     %p/Inputs/x86_64/libSystem.yaml %s -o %t
 # RUN: llvm-objdump -private-headers %t | FileCheck %s --check-prefix=CHECK-BINARY-WRITE
 
 --- !mach-o
index 556fd52..f0df9f9 100644 (file)
@@ -1,6 +1,6 @@
 # RUN: lld -flavor darwin -arch x86_64 -macosx_version_min 10.8 %s -dylib \
 # RUN:    -sectalign __DATA __custom 0x800 -sectalign __TEXT __text 0x400 \
-# RUN:    %p/Inputs/libSystem.yaml -o %t \
+# RUN:    %p/Inputs/x86_64/libSystem.yaml -o %t \
 # RUN: && llvm-readobj -sections %t | FileCheck %s
 #
 # Test -sectalign option on __text and a custom section.
index 800ba55..21113dc 100644 (file)
@@ -1,5 +1,5 @@
 # RUN: lld -flavor darwin -arch x86_64 -macosx_version_min 10.8 %s -dylib \
-# RUN:    %p/Inputs/libSystem.yaml -o %t \
+# RUN:    %p/Inputs/x86_64/libSystem.yaml -o %t \
 # RUN: && llvm-objdump -private-headers %t | FileCheck %s
 #
 
index 169e975..4e0eaee 100644 (file)
@@ -1,5 +1,5 @@
 # RUN: not lld -flavor darwin -arch x86_64 -source_version 10.blah %s -o %t 2>&1 | FileCheck %s --check-prefix=ERROR
-# RUN: lld -flavor darwin -arch x86_64 -source_version 10.1.2.3.4 %s -o %t -dylib %p/Inputs/libSystem.yaml && llvm-objdump -private-headers %t | FileCheck %s
+# RUN: lld -flavor darwin -arch x86_64 -source_version 10.1.2.3.4 %s -o %t -dylib %p/Inputs/x86_64/libSystem.yaml && llvm-objdump -private-headers %t | FileCheck %s
 
 --- !mach-o
 arch:            x86_64
index 0e8edb2..048282c 100644 (file)
@@ -1,6 +1,6 @@
-# RUN: lld -flavor darwin -arch x86_64 -macosx_version_min 10.9 %s -o %t %p/Inputs/libSystem.yaml
+# RUN: lld -flavor darwin -arch x86_64 -macosx_version_min 10.9 %s -o %t %p/Inputs/x86_64/libSystem.yaml
 # RUN: llvm-objdump -private-headers %t | FileCheck --check-prefix=CHECK-DEFAULT %s
-# RUN: lld -flavor darwin -arch x86_64 -macosx_version_min 10.9 %s -o %t -stack_size 31415926000 %p/Inputs/libSystem.yaml
+# RUN: lld -flavor darwin -arch x86_64 -macosx_version_min 10.9 %s -o %t -stack_size 31415926000 %p/Inputs/x86_64/libSystem.yaml
 # RUN: llvm-objdump -private-headers %t | FileCheck --check-prefix=CHECK-EXPLICIT %s
 # RUN: not lld -flavor darwin -arch x86_64 -stack_size 0x31415926530 %s >/dev/null 2> %t
 # RUN: FileCheck < %t %s --check-prefix=CHECK-ERROR-MISPAGED
index a39a3e7..b402ae3 100644 (file)
@@ -1,4 +1,4 @@
-# RUN: lld -flavor darwin -arch x86_64 -macosx_version_min 10.9 -twolevel_namespace -undefined dynamic_lookup %s -o %t %p/Inputs/libSystem.yaml
+# RUN: lld -flavor darwin -arch x86_64 -macosx_version_min 10.9 -twolevel_namespace -undefined dynamic_lookup %s -o %t %p/Inputs/x86_64/libSystem.yaml
 #
 # Sanity check '-twolevel_namespace -undefined dynamic_lookup'.
 # This should pass without error, even though '_bar' is undefined.
index eeb01de..1ac704c 100644 (file)
@@ -1,6 +1,6 @@
-# RUN: not lld -flavor darwin -arch x86_64 -macosx_version_min 10.9 -twolevel_namespace -undefined warning %s -o %t %p/Inputs/libSystem.yaml 2>&1 | \
+# RUN: not lld -flavor darwin -arch x86_64 -macosx_version_min 10.9 -twolevel_namespace -undefined warning %s -o %t %p/Inputs/x86_64/libSystem.yaml 2>&1 | \
 # RUN:   FileCheck --check-prefix=CHECK-WARNING %s
-# RUN: not lld -flavor darwin -arch x86_64 -macosx_version_min 10.9 -twolevel_namespace -undefined suppress %s -o %t %p/Inputs/libSystem.yaml 2>&1 | \
+# RUN: not lld -flavor darwin -arch x86_64 -macosx_version_min 10.9 -twolevel_namespace -undefined suppress %s -o %t %p/Inputs/x86_64/libSystem.yaml 2>&1 | \
 # RUN:   FileCheck --check-prefix=CHECK-SUPPRESS %s
 
 --- !native
index 2ef6dda..4caaf35 100644 (file)
@@ -1,5 +1,5 @@
 # RUN: lld -flavor darwin -arch arm64 -o %t %s \
-# RUN: %p/Inputs/unwind-info-simple-arm64.yaml -e _main %p/Inputs/libSystem.yaml
+# RUN: %p/Inputs/unwind-info-simple-arm64.yaml -e _main %p/Inputs/arm64/libSystem.yaml
 # RUN: llvm-objdump -unwind-info %t | FileCheck %s
 
 --- !mach-o
index 7dfae1b..797c5a3 100644 (file)
@@ -1,4 +1,4 @@
-# RUN: lld -flavor darwin -arch x86_64 %s -o %t -e _main %p/Inputs/libSystem.yaml
+# RUN: lld -flavor darwin -arch x86_64 %s -o %t -e _main %p/Inputs/x86_64/libSystem.yaml
 # RUN: llvm-objdump -unwind-info %t | FileCheck %s
 
 # CHECK: Contents of __unwind_info section:
index 1383ad7..54e31f6 100644 (file)
@@ -1,7 +1,7 @@
 # RUN: lld -flavor darwin -arch x86_64 -dylib %p/Inputs/bar.yaml \
-# RUN:     -install_name /usr/lib/libbar.dylib %p/Inputs/libSystem.yaml -o %t1.dylib
+# RUN:     -install_name /usr/lib/libbar.dylib %p/Inputs/x86_64/libSystem.yaml -o %t1.dylib
 # RUN: lld -flavor darwin -arch x86_64 -dylib %s -upward_library  %t1.dylib \
-# RUN:      -install_name /usr/lib/libfoo.dylib %p/Inputs/libSystem.yaml -o %t
+# RUN:      -install_name /usr/lib/libfoo.dylib %p/Inputs/x86_64/libSystem.yaml -o %t
 # RUN: llvm-objdump -private-headers %t | FileCheck %s
 #
 #
index aa378a7..cb5331e 100644 (file)
@@ -1,11 +1,11 @@
-# RUN: lld -flavor darwin -arch x86_64 -macosx_version_min 10.8 %s -o %t -dylib %p/Inputs/libSystem.yaml && llvm-objdump -private-headers %t | FileCheck %s
-# RUN: lld -flavor darwin -arch x86_64 -macosx_version_min 10.8 %s -o %t -dylib %p/Inputs/libSystem.yaml 2>&1 | FileCheck %s --check-prefix=WARNING
-# RUN: lld -flavor darwin -arch x86_64 -macosx_version_min 10.8 %s -o %t -dylib %p/Inputs/libSystem.yaml -static -version_load_command && llvm-objdump -private-headers %t | FileCheck %s
-# RUN: lld -flavor darwin -arch x86_64 -macosx_version_min 10.8 %s -o %t -dylib %p/Inputs/libSystem.yaml -no_version_load_command && llvm-objdump -private-headers %t | FileCheck %s --check-prefix=NO_VERSION_MIN
-# RUN: lld -flavor darwin -arch x86_64 -macosx_version_min 10.8 %s -o %t -dylib %p/Inputs/libSystem.yaml -static -version_load_command -no_version_load_command && llvm-objdump -private-headers %t | FileCheck %s --check-prefix=NO_VERSION_MIN
-# RUN: lld -flavor darwin -arch x86_64 -macosx_version_min 10.8 %s -o %t -dylib %p/Inputs/libSystem.yaml -static && llvm-objdump -private-headers %t | FileCheck %s --check-prefix=NO_VERSION_MIN
+# RUN: lld -flavor darwin -arch x86_64 -macosx_version_min 10.8 %s -o %t -dylib %p/Inputs/x86_64/libSystem.yaml && llvm-objdump -private-headers %t | FileCheck %s
+# RUN: lld -flavor darwin -arch x86_64 -macosx_version_min 10.8 %s -o %t -dylib %p/Inputs/x86_64/libSystem.yaml 2>&1 | FileCheck %s --check-prefix=WARNING
+# RUN: lld -flavor darwin -arch x86_64 -macosx_version_min 10.8 %s -o %t -dylib %p/Inputs/x86_64/libSystem.yaml -static -version_load_command && llvm-objdump -private-headers %t | FileCheck %s
+# RUN: lld -flavor darwin -arch x86_64 -macosx_version_min 10.8 %s -o %t -dylib %p/Inputs/x86_64/libSystem.yaml -no_version_load_command && llvm-objdump -private-headers %t | FileCheck %s --check-prefix=NO_VERSION_MIN
+# RUN: lld -flavor darwin -arch x86_64 -macosx_version_min 10.8 %s -o %t -dylib %p/Inputs/x86_64/libSystem.yaml -static -version_load_command -no_version_load_command && llvm-objdump -private-headers %t | FileCheck %s --check-prefix=NO_VERSION_MIN
+# RUN: lld -flavor darwin -arch x86_64 -macosx_version_min 10.8 %s -o %t -dylib %p/Inputs/x86_64/libSystem.yaml -static && llvm-objdump -private-headers %t | FileCheck %s --check-prefix=NO_VERSION_MIN
 
-# RUN: lld -flavor darwin -arch x86_64 -macosx_version_min 10.8 -sdk_version 10.9 %s -o %t -dylib %p/Inputs/libSystem.yaml && llvm-objdump -private-headers %t | FileCheck %s --check-prefix=SDK_VERSION
+# RUN: lld -flavor darwin -arch x86_64 -macosx_version_min 10.8 -sdk_version 10.9 %s -o %t -dylib %p/Inputs/x86_64/libSystem.yaml && llvm-objdump -private-headers %t | FileCheck %s --check-prefix=SDK_VERSION
 
 --- !mach-o
 arch:            x86_64