aboutsummaryrefslogtreecommitdiff
path: root/test/mach-o
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2016-01-06 20:07:13 +0000
committerDimitry Andric <dim@FreeBSD.org>2016-01-06 20:07:13 +0000
commitfba2c04f31e119eacf142fcbbaabd5a9e63a39ed (patch)
tree59eba88ea527759edb2c98d294ae369f95f57e33 /test/mach-o
parent5a5c549fe9a3fef595297bd21d36bed8409dc37d (diff)
downloadsrc-fba2c04f31e119eacf142fcbbaabd5a9e63a39ed.tar.gz
src-fba2c04f31e119eacf142fcbbaabd5a9e63a39ed.zip
Vendor import of lld trunk r256945:vendor/lld/lld-trunk-r256945
Notes
Notes: svn path=/vendor/lld/dist/; revision=293258 svn path=/vendor/lld/lld-trunk-r256945/; revision=293259; tag=vendor/lld/lld-trunk-r256945
Diffstat (limited to 'test/mach-o')
-rw-r--r--test/mach-o/arm64-reloc-negDelta32-fixup.yaml10
-rw-r--r--test/mach-o/arm64-section-order.yaml67
-rw-r--r--test/mach-o/parse-data-relocs-x86_64.yaml2
3 files changed, 73 insertions, 6 deletions
diff --git a/test/mach-o/arm64-reloc-negDelta32-fixup.yaml b/test/mach-o/arm64-reloc-negDelta32-fixup.yaml
index 87708a0db12b..8beab2841dc3 100644
--- a/test/mach-o/arm64-reloc-negDelta32-fixup.yaml
+++ b/test/mach-o/arm64-reloc-negDelta32-fixup.yaml
@@ -6,12 +6,12 @@
# The reference from FDE->CIE is implicitly created as a negDelta32.
# We don't emit these in to the binary as relocations, so we need to
# make sure that the offset in the FDE to the CIE is the correct value.
-# CHECK: 0010 10000000 00000000 017a5200 01781e01
-# CHECK: 0020 100c1f00 20000000 18000000 e4ffffff
-# Note, this one that matters ^~~~~~~~
+# CHECK: {{[0-9abcdef]*}} 10000000 00000000 017a5200 01781e01
+# CHECK: {{[0-9abcdef]*}} 100c1f00 20000000 18000000 e4ffffff
+# Note, this one that matters ^~~~~~~~
# It needs to be 0x18 as that is the offset back to 0 where the CIE is.
-# CHECK: 0030 ffffffff 20000000 00000000 00480e10
-# CHECK: 0040 9e019d02 00000000
+# CHECK: {{[0-9abcdef]*}} ffffffff 20000000 00000000 00480e10
+# CHECK: {{[0-9abcdef]*}} 9e019d02 00000000
--- !mach-o
arch: arm64
diff --git a/test/mach-o/arm64-section-order.yaml b/test/mach-o/arm64-section-order.yaml
new file mode 100644
index 000000000000..50d684668a52
--- /dev/null
+++ b/test/mach-o/arm64-section-order.yaml
@@ -0,0 +1,67 @@
+# RUN: lld -flavor darwin -arch arm64 -r -print_atoms %s -o %t
+# RUN: lld -flavor darwin -arch arm64 -r -print_atoms %t -o %t2
+# RUN: llvm-objdump -section-headers %t | FileCheck %s
+# RUN: llvm-objdump -section-headers %t2 | FileCheck %s
+
+# Make sure that the sections are sorted. Currently we want this order:
+# __text, __unwind_info
+
+# CHECK: Sections:
+# CHECK: 0 __text {{.*}} TEXT
+# CHECK: 1 __compact_unwind {{.*}}
+
+
+--- !mach-o
+arch: arm64
+file-type: MH_OBJECT
+flags: [ MH_SUBSECTIONS_VIA_SYMBOLS ]
+compat-version: 0.0
+current-version: 0.0
+has-UUID: false
+OS: unknown
+sections:
+ - segment: __TEXT
+ section: __text
+ type: S_REGULAR
+ attributes: [ S_ATTR_PURE_INSTRUCTIONS, S_ATTR_SOME_INSTRUCTIONS ]
+ alignment: 8
+ address: 0x0000000000000000
+ content: [ 0xC0, 0x03, 0x5F, 0xD6, 0xC0, 0x03, 0x5F, 0xD6 ]
+ - segment: __LD
+ section: __compact_unwind
+ type: S_REGULAR
+ attributes: [ ]
+ alignment: 8
+ address: 0x0000000000000008
+ content: [ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ]
+ relocations:
+ - offset: 0x00000020
+ type: ARM64_RELOC_UNSIGNED
+ length: 3
+ pc-rel: false
+ extern: false
+ symbol: 1
+ - offset: 0x00000000
+ type: ARM64_RELOC_UNSIGNED
+ length: 3
+ pc-rel: false
+ extern: false
+ symbol: 1
+global-symbols:
+ - name: __Z3fooi
+ type: N_SECT
+ scope: [ N_EXT ]
+ sect: 1
+ value: 0x0000000000000000
+ - name: __Z4foo2i
+ type: N_SECT
+ scope: [ N_EXT ]
+ sect: 1
+ value: 0x0000000000000004
diff --git a/test/mach-o/parse-data-relocs-x86_64.yaml b/test/mach-o/parse-data-relocs-x86_64.yaml
index b6f38f5d10e4..6b05e26372b8 100644
--- a/test/mach-o/parse-data-relocs-x86_64.yaml
+++ b/test/mach-o/parse-data-relocs-x86_64.yaml
@@ -268,7 +268,7 @@ page-size: 0x00000000
# CHECK: type: data
# CHECK: content: [ 00, 00, 00, 00, 00, 00, 00, 00, 04, 00, 00, 00,
# CHECK: 00, 00, 00, 00, F0, FF, FF, FF, FF, FF, FF, FF,
-# CHECK: {{..}}, 00, 00, 00, 00, 00, 00, 00, {{..}}, 00, 00, 00,
+# CHECK: {{..}}, {{..}}, 00, 00, 00, 00, 00, 00, {{..}}, {{..}}, 00, 00,
# CHECK: 00, 00, 00, 00, D8, FF, FF, FF, FF, FF, FF, FF,
# CHECK: D4, FF, FF, FF, FF, FF, FF, FF, {{..}}, {{..}}, {{..}}, {{..}},
# CHECK: {{..}}, {{..}}, {{..}}, {{..}}, C0, FF, FF, FF, C0, FF, FF, FF,