summaryrefslogtreecommitdiff
path: root/test/MC/MachO
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-09-17 15:21:50 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-09-17 15:21:50 +0000
commit23bea41ec68368f9186db2f819dde11efb1d3c83 (patch)
treeb620b1bd42fd20ab236f077e65cd9f84c9877e1b /test/MC/MachO
parent4cec6e2103796697b4988adfb059be0457aadf31 (diff)
downloadllvm-23bea41ec68368f9186db2f819dde11efb1d3c83.tar.gz
llvm-23bea41ec68368f9186db2f819dde11efb1d3c83.tar.bz2
llvm-23bea41ec68368f9186db2f819dde11efb1d3c83.tar.xz
MC/Mach-O/i386: Fix a crash in relocation handling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114176 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/MC/MachO')
-rw-r--r--test/MC/MachO/reloc.s68
1 files changed, 36 insertions, 32 deletions
diff --git a/test/MC/MachO/reloc.s b/test/MC/MachO/reloc.s
index 800dd6de4f..b9520aade4 100644
--- a/test/MC/MachO/reloc.s
+++ b/test/MC/MachO/reloc.s
@@ -37,6 +37,7 @@ L0:
.text
_f0:
L1:
+ jmp 0xbabecafe
jmp L0
jmp L1
ret
@@ -64,9 +65,9 @@ _f1:
// CHECK: ('size', 260)
// CHECK: ('segment_name', '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
// CHECK: ('vm_addr', 0)
-// CHECK: ('vm_size', 71)
+// CHECK: ('vm_size', 76)
// CHECK: ('file_offset', 392)
-// CHECK: ('file_size', 71)
+// CHECK: ('file_size', 76)
// CHECK: ('maxprot', 7)
// CHECK: ('initprot', 7)
// CHECK: ('num_sections', 3)
@@ -76,29 +77,32 @@ _f1:
// CHECK: (('section_name', '__text\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
// CHECK: ('segment_name', '__TEXT\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
// CHECK: ('address', 0)
-// CHECK: ('size', 8)
+// CHECK: ('size', 13)
// CHECK: ('offset', 392)
// CHECK: ('alignment', 0)
-// CHECK: ('reloc_offset', 464)
-// CHECK: ('num_reloc', 1)
+// CHECK: ('reloc_offset', 468)
+// CHECK: ('num_reloc', 2)
// CHECK: ('flags', 0x80000400)
// CHECK: ('reserved1', 0)
// CHECK: ('reserved2', 0)
// CHECK: ),
// CHECK: ('_relocations', [
// CHECK: # Relocation 0
-// CHECK: (('word-0', 0x1),
+// CHECK: (('word-0', 0x6),
// CHECK: ('word-1', 0x5000003)),
+// CHECK: # Relocation 1
+// CHECK: (('word-0', 0x1),
+// CHECK: ('word-1', 0x5000000)),
// CHECK: ])
-// CHECK: ('_section_data', 'e93a0000 00ebf9c3')
+// CHECK: ('_section_data', 'e9f9cabe bae93a00 0000ebf4 c3')
// CHECK: # Section 1
// CHECK: (('section_name', '__data\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
// CHECK: ('segment_name', '__DATA\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
-// CHECK: ('address', 8)
+// CHECK: ('address', 13)
// CHECK: ('size', 51)
-// CHECK: ('offset', 400)
+// CHECK: ('offset', 405)
// CHECK: ('alignment', 0)
-// CHECK: ('reloc_offset', 472)
+// CHECK: ('reloc_offset', 484)
// CHECK: ('num_reloc', 11)
// CHECK: ('flags', 0x0)
// CHECK: ('reserved1', 0)
@@ -113,22 +117,22 @@ _f1:
// CHECK: ('word-1', 0xc000007)),
// CHECK: # Relocation 2
// CHECK: (('word-0', 0x8000002a),
-// CHECK: ('word-1', 0x18)),
+// CHECK: ('word-1', 0x1d)),
// CHECK: # Relocation 3
// CHECK: (('word-0', 0x90000028),
-// CHECK: ('word-1', 0x18)),
+// CHECK: ('word-1', 0x1d)),
// CHECK: # Relocation 4
// CHECK: (('word-0', 0xa0000024),
-// CHECK: ('word-1', 0x18)),
+// CHECK: ('word-1', 0x1d)),
// CHECK: # Relocation 5
// CHECK: (('word-0', 0xa0000020),
-// CHECK: ('word-1', 0x18)),
+// CHECK: ('word-1', 0x1d)),
// CHECK: # Relocation 6
// CHECK: (('word-0', 0xa4000014),
-// CHECK: ('word-1', 0x1c)),
+// CHECK: ('word-1', 0x21)),
// CHECK: # Relocation 7
// CHECK: (('word-0', 0xa1000000),
-// CHECK: ('word-1', 0x24)),
+// CHECK: ('word-1', 0x29)),
// CHECK: # Relocation 8
// CHECK: (('word-0', 0x8),
// CHECK: ('word-1', 0x4000002)),
@@ -139,15 +143,15 @@ _f1:
// CHECK: (('word-0', 0x0),
// CHECK: ('word-1', 0xc000009)),
// CHECK: ])
-// CHECK: ('_section_data', '00000000 04000000 10000000 00000000 00000000 ed000000 00000000 00000000 19000000 22000000 2c007100 00000004 000000')
+// CHECK: ('_section_data', '00000000 04000000 15000000 00000000 00000000 ed000000 00000000 00000000 1e000000 27000000 31007600 00000004 000000')
// CHECK: # Section 2
// CHECK: (('section_name', '__const\x00\x00\x00\x00\x00\x00\x00\x00\x00')
// CHECK: ('segment_name', '__TEXT\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
-// CHECK: ('address', 59)
+// CHECK: ('address', 64)
// CHECK: ('size', 12)
-// CHECK: ('offset', 451)
+// CHECK: ('offset', 456)
// CHECK: ('alignment', 0)
-// CHECK: ('reloc_offset', 560)
+// CHECK: ('reloc_offset', 572)
// CHECK: ('num_reloc', 4)
// CHECK: ('flags', 0x0)
// CHECK: ('reserved1', 0)
@@ -162,20 +166,20 @@ _f1:
// CHECK: ('word-1', 0x4000003)),
// CHECK: # Relocation 2
// CHECK: (('word-0', 0xa4000000),
-// CHECK: ('word-1', 0x18)),
+// CHECK: ('word-1', 0x1d)),
// CHECK: # Relocation 3
// CHECK: (('word-0', 0xa1000000),
-// CHECK: ('word-1', 0x3b)),
+// CHECK: ('word-1', 0x40)),
// CHECK: ])
-// CHECK: ('_section_data', 'feffffff 3f000000 00000000')
+// CHECK: ('_section_data', 'feffffff 44000000 00000000')
// CHECK: ])
// CHECK: ),
// CHECK: # Load Command 1
// CHECK: (('command', 2)
// CHECK: ('size', 24)
-// CHECK: ('symoff', 592)
+// CHECK: ('symoff', 604)
// CHECK: ('nsyms', 10)
-// CHECK: ('stroff', 712)
+// CHECK: ('stroff', 724)
// CHECK: ('strsize', 88)
// CHECK: ('_string_data', '\x00undef\x00local_a_ext\x00.objc_class_name_A\x00_f1\x00local_a\x00local_a_elt\x00local_b\x00local_c\x00bar\x00_f0\x00\x00\x00')
// CHECK: ('_symbols', [
@@ -184,7 +188,7 @@ _f1:
// CHECK: ('n_type', 0xe)
// CHECK: ('n_sect', 2)
// CHECK: ('n_desc', 0)
-// CHECK: ('n_value', 20)
+// CHECK: ('n_value', 25)
// CHECK: ('_string', 'local_a')
// CHECK: ),
// CHECK: # Symbol 1
@@ -192,7 +196,7 @@ _f1:
// CHECK: ('n_type', 0xe)
// CHECK: ('n_sect', 2)
// CHECK: ('n_desc', 0)
-// CHECK: ('n_value', 24)
+// CHECK: ('n_value', 29)
// CHECK: ('_string', 'local_a_elt')
// CHECK: ),
// CHECK: # Symbol 2
@@ -200,7 +204,7 @@ _f1:
// CHECK: ('n_type', 0xe)
// CHECK: ('n_sect', 2)
// CHECK: ('n_desc', 0)
-// CHECK: ('n_value', 28)
+// CHECK: ('n_value', 33)
// CHECK: ('_string', 'local_b')
// CHECK: ),
// CHECK: # Symbol 3
@@ -208,7 +212,7 @@ _f1:
// CHECK: ('n_type', 0xe)
// CHECK: ('n_sect', 2)
// CHECK: ('n_desc', 0)
-// CHECK: ('n_value', 36)
+// CHECK: ('n_value', 41)
// CHECK: ('_string', 'local_c')
// CHECK: ),
// CHECK: # Symbol 4
@@ -216,7 +220,7 @@ _f1:
// CHECK: ('n_type', 0xe)
// CHECK: ('n_sect', 3)
// CHECK: ('n_desc', 0)
-// CHECK: ('n_value', 59)
+// CHECK: ('n_value', 64)
// CHECK: ('_string', 'bar')
// CHECK: ),
// CHECK: # Symbol 5
@@ -240,7 +244,7 @@ _f1:
// CHECK: ('n_type', 0xf)
// CHECK: ('n_sect', 1)
// CHECK: ('n_desc', 128)
-// CHECK: ('n_value', 8)
+// CHECK: ('n_value', 13)
// CHECK: ('_string', '_f1')
// CHECK: ),
// CHECK: # Symbol 8
@@ -248,7 +252,7 @@ _f1:
// CHECK: ('n_type', 0xf)
// CHECK: ('n_sect', 2)
// CHECK: ('n_desc', 0)
-// CHECK: ('n_value', 16)
+// CHECK: ('n_value', 21)
// CHECK: ('_string', 'local_a_ext')
// CHECK: ),
// CHECK: # Symbol 9