aboutsummaryrefslogtreecommitdiffstats
path: root/test/MC/MachO
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-05-14 18:53:40 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-05-14 18:53:40 +0000
commitf0f6cdb6b40bdf799a806efca05f44081bb154d3 (patch)
treece651950e2c3bb36e29f912d27f20d70b384d78b /test/MC/MachO
parent4ed10826833701b14064f55b6514289e0a7ff5ef (diff)
downloadexternal_llvm-f0f6cdb6b40bdf799a806efca05f44081bb154d3.zip
external_llvm-f0f6cdb6b40bdf799a806efca05f44081bb154d3.tar.gz
external_llvm-f0f6cdb6b40bdf799a806efca05f44081bb154d3.tar.bz2
MC/Mach-O/x86_64: Darwin's special "signed_N" relocation types should only be
used to replace a normal relocation, not a reference to a GOT entry. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103789 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/MC/MachO')
-rw-r--r--test/MC/MachO/darwin-x86_64-reloc.s98
1 files changed, 52 insertions, 46 deletions
diff --git a/test/MC/MachO/darwin-x86_64-reloc.s b/test/MC/MachO/darwin-x86_64-reloc.s
index 248c507..19b4345 100644
--- a/test/MC/MachO/darwin-x86_64-reloc.s
+++ b/test/MC/MachO/darwin-x86_64-reloc.s
@@ -84,6 +84,9 @@ L6:
.quad f6
.quad L6
+ .text
+ cmpq $0, _foo@GOTPCREL(%rip)
+
// CHECK: ('cputype', 16777223)
// CHECK: ('cpusubtype', 3)
// CHECK: ('filetype', 1)
@@ -97,9 +100,9 @@ L6:
// CHECK: ('size', 392)
// 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', 303)
+// CHECK: ('vm_size', 311)
// CHECK: ('file_offset', 528)
-// CHECK: ('file_size', 303)
+// CHECK: ('file_size', 311)
// CHECK: ('maxprot', 7)
// CHECK: ('initprot', 7)
// CHECK: ('num_sections', 4)
@@ -112,7 +115,7 @@ L6:
// CHECK: ('size', 40)
// CHECK: ('offset', 528)
// CHECK: ('alignment', 0)
-// CHECK: ('reloc_offset', 832)
+// CHECK: ('reloc_offset', 840)
// CHECK: ('num_reloc', 5)
// CHECK: ('flags', 0x0)
// CHECK: ('reserved1', 0)
@@ -136,16 +139,16 @@ L6:
// CHECK: (('word-0', 0x4),
// CHECK: ('word-1', 0x4d000008)),
// CHECK: ])
-// CHECK: ('_section_data', "\x00\x00\x00\x00\x04\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x17\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\x01\x00\x00\x00\x00\x00\x00")
+// CHECK: ('_section_data', '\x00\x00\x00\x00\x04\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x1f\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00/\x01\x00\x00\x00\x00\x00\x00')
// CHECK: # Section 1
// 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', 40)
-// CHECK: ('size', 215)
+// CHECK: ('size', 223)
// CHECK: ('offset', 568)
// CHECK: ('alignment', 0)
-// CHECK: ('reloc_offset', 872)
-// CHECK: ('num_reloc', 31)
+// CHECK: ('reloc_offset', 880)
+// CHECK: ('num_reloc', 32)
// CHECK: ('flags', 0x80000400)
// CHECK: ('reserved1', 0)
// CHECK: ('reserved2', 0)
@@ -153,108 +156,111 @@ L6:
// CHECK: ),
// CHECK: ('_relocations', [
// CHECK: # Relocation 0
+// CHECK: (('word-0', 0xda),
+// CHECK: ('word-1', 0x4d000000)),
+// CHECK: # Relocation 1
// CHECK: (('word-0', 0xd3),
// CHECK: ('word-1', 0x15000004)),
-// CHECK: # Relocation 1
+// CHECK: # Relocation 2
// CHECK: (('word-0', 0xcd),
// CHECK: ('word-1', 0x1d000006)),
-// CHECK: # Relocation 2
+// CHECK: # Relocation 3
// CHECK: (('word-0', 0xc7),
// CHECK: ('word-1', 0x15000004)),
-// CHECK: # Relocation 3
+// CHECK: # Relocation 4
// CHECK: (('word-0', 0xc1),
// CHECK: ('word-1', 0x15000001)),
-// CHECK: # Relocation 4
+// CHECK: # Relocation 5
// CHECK: (('word-0', 0xa5),
// CHECK: ('word-1', 0x5e000003)),
-// CHECK: # Relocation 5
+// CHECK: # Relocation 6
// CHECK: (('word-0', 0xa5),
// CHECK: ('word-1', 0xe000000)),
-// CHECK: # Relocation 6
+// CHECK: # Relocation 7
// CHECK: (('word-0', 0x9d),
// CHECK: ('word-1', 0x5e000003)),
-// CHECK: # Relocation 7
+// CHECK: # Relocation 8
// CHECK: (('word-0', 0x9d),
// CHECK: ('word-1', 0xe000000)),
-// CHECK: # Relocation 8
+// CHECK: # Relocation 9
// CHECK: (('word-0', 0x95),
// CHECK: ('word-1', 0xe000003)),
-// CHECK: # Relocation 9
+// CHECK: # Relocation 10
// CHECK: (('word-0', 0x8d),
// CHECK: ('word-1', 0xe000003)),
-// CHECK: # Relocation 10
+// CHECK: # Relocation 11
// CHECK: (('word-0', 0x79),
// CHECK: ('word-1', 0x8d000003)),
-// CHECK: # Relocation 11
+// CHECK: # Relocation 12
// CHECK: (('word-0', 0x71),
// CHECK: ('word-1', 0x7d000003)),
-// CHECK: # Relocation 12
+// CHECK: # Relocation 13
// CHECK: (('word-0', 0x69),
// CHECK: ('word-1', 0x6d000003)),
-// CHECK: # Relocation 13
+// CHECK: # Relocation 14
// CHECK: (('word-0', 0x63),
// CHECK: ('word-1', 0x1d000003)),
-// CHECK: # Relocation 14
+// CHECK: # Relocation 15
// CHECK: (('word-0', 0x5c),
// CHECK: ('word-1', 0x1d000003)),
-// CHECK: # Relocation 15
+// CHECK: # Relocation 16
// CHECK: (('word-0', 0x55),
// CHECK: ('word-1', 0x5c000002)),
-// CHECK: # Relocation 16
+// CHECK: # Relocation 17
// CHECK: (('word-0', 0x55),
// CHECK: ('word-1', 0xc000000)),
-// CHECK: # Relocation 17
+// CHECK: # Relocation 18
// CHECK: (('word-0', 0x4d),
// CHECK: ('word-1', 0x5e000002)),
-// CHECK: # Relocation 18
+// CHECK: # Relocation 19
// CHECK: (('word-0', 0x4d),
// CHECK: ('word-1', 0xe000000)),
-// CHECK: # Relocation 19
+// CHECK: # Relocation 20
// CHECK: (('word-0', 0x45),
// CHECK: ('word-1', 0x5e000002)),
-// CHECK: # Relocation 20
+// CHECK: # Relocation 21
// CHECK: (('word-0', 0x45),
// CHECK: ('word-1', 0xe000000)),
-// CHECK: # Relocation 21
+// CHECK: # Relocation 22
// CHECK: (('word-0', 0x3d),
// CHECK: ('word-1', 0xe000000)),
-// CHECK: # Relocation 22
+// CHECK: # Relocation 23
// CHECK: (('word-0', 0x35),
// CHECK: ('word-1', 0xe000000)),
-// CHECK: # Relocation 23
+// CHECK: # Relocation 24
// CHECK: (('word-0', 0x2d),
// CHECK: ('word-1', 0x8d000000)),
-// CHECK: # Relocation 24
+// CHECK: # Relocation 25
// CHECK: (('word-0', 0x26),
// CHECK: ('word-1', 0x6d000000)),
-// CHECK: # Relocation 25
+// CHECK: # Relocation 26
// CHECK: (('word-0', 0x20),
// CHECK: ('word-1', 0x1d000000)),
-// CHECK: # Relocation 26
+// CHECK: # Relocation 27
// CHECK: (('word-0', 0x1a),
// CHECK: ('word-1', 0x1d000000)),
-// CHECK: # Relocation 27
+// CHECK: # Relocation 28
// CHECK: (('word-0', 0x14),
// CHECK: ('word-1', 0x4d000000)),
-// CHECK: # Relocation 28
+// CHECK: # Relocation 29
// CHECK: (('word-0', 0xe),
// CHECK: ('word-1', 0x3d000000)),
-// CHECK: # Relocation 29
+// CHECK: # Relocation 30
// CHECK: (('word-0', 0x7),
// CHECK: ('word-1', 0x2d000000)),
-// CHECK: # Relocation 30
+// CHECK: # Relocation 31
// CHECK: (('word-0', 0x2),
// CHECK: ('word-1', 0x2d000000)),
// CHECK: ])
-// CHECK: ('_section_data', '\xc3\xe8\x00\x00\x00\x00\xe8\x04\x00\x00\x00H\x8b\x05\x00\x00\x00\x00\xff5\x00\x00\x00\x00\x8b\x05\x00\x00\x00\x00\x8b\x05\x04\x00\x00\x00\xc6\x05\xff\xff\xff\xff\x12\xc7\x05\xfc\xff\xff\xffxV4\x12\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00H\x8d\x05,\x00\x00\x00H\x8d\x05\x14\x00\x00\x00\x83\x05\x13\x00\x00\x00\x06f\x81\x05\x12\x00\x00\x00\xf4\x01\x81\x05\x10\x00\x00\x00\xf4\x01\x00\x00\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90,\x00\x00\x00\x00\x00\x00\x00\x14\x00\x00\x00\x00\x00\x00\x00\xe4\xff\xff\xff\xff\xff\xff\xff\xd4\xff\xff\xff\xff\xff\xff\xff,\x00\x00\x00\x00\x00\x00\x00\x83\xc0\x00\x03\x04%\x03\x00\x00\x00\x8b\x05\x1f\xff\xff\xff\x8b\x05$\x00\x00\x00\x8b\x05\x00\x00\x00\x00\x8b\x05(\x00\x00\x00')
+// CHECK: ('_section_data', '\xc3\xe8\x00\x00\x00\x00\xe8\x04\x00\x00\x00H\x8b\x05\x00\x00\x00\x00\xff5\x00\x00\x00\x00\x8b\x05\x00\x00\x00\x00\x8b\x05\x04\x00\x00\x00\xc6\x05\xff\xff\xff\xff\x12\xc7\x05\xfc\xff\xff\xffxV4\x12\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00H\x8d\x05,\x00\x00\x00H\x8d\x05\x14\x00\x00\x00\x83\x05\x13\x00\x00\x00\x06f\x81\x05\x12\x00\x00\x00\xf4\x01\x81\x05\x10\x00\x00\x00\xf4\x01\x00\x00\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90,\x00\x00\x00\x00\x00\x00\x00\x14\x00\x00\x00\x00\x00\x00\x00\xe4\xff\xff\xff\xff\xff\xff\xff\xd4\xff\xff\xff\xff\xff\xff\xff,\x00\x00\x00\x00\x00\x00\x00\x83\xc0\x00\x03\x04%\x03\x00\x00\x00\x8b\x05\x1f\xff\xff\xff\x8b\x05,\x00\x00\x00\x8b\x05\x00\x00\x00\x00\x8b\x050\x00\x00\x00H\x83=\xff\xff\xff\xff\x00')
// CHECK: # Section 2
// CHECK: (('section_name', '__debug_frame\x00\x00\x00')
// CHECK: ('segment_name', '__DWARF\x00\x00\x00\x00\x00\x00\x00\x00\x00')
-// CHECK: ('address', 255)
+// CHECK: ('address', 263)
// CHECK: ('size', 16)
-// CHECK: ('offset', 783)
+// CHECK: ('offset', 791)
// CHECK: ('alignment', 0)
-// CHECK: ('reloc_offset', 1120)
+// CHECK: ('reloc_offset', 1136)
// CHECK: ('num_reloc', 2)
// CHECK: ('flags', 0x2000000)
// CHECK: ('reserved1', 0)
@@ -273,9 +279,9 @@ L6:
// CHECK: # Section 3
// CHECK: (('section_name', '__literal8\x00\x00\x00\x00\x00\x00')
// CHECK: ('segment_name', '__TEXT\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
-// CHECK: ('address', 271)
+// CHECK: ('address', 279)
// CHECK: ('size', 32)
-// CHECK: ('offset', 799)
+// CHECK: ('offset', 807)
// CHECK: ('alignment', 0)
// CHECK: ('reloc_offset', 0)
// CHECK: ('num_reloc', 0)
@@ -292,9 +298,9 @@ L6:
// CHECK: # Load Command 1
// CHECK: (('command', 2)
// CHECK: ('size', 24)
-// CHECK: ('symoff', 1136)
+// CHECK: ('symoff', 1152)
// CHECK: ('nsyms', 9)
-// CHECK: ('stroff', 1280)
+// CHECK: ('stroff', 1296)
// CHECK: ('strsize', 52)
// CHECK: ('_string_data', '\x00_foobar\x00_ext_foo\x00_foo\x00_baz\x00_bar\x00_prev\x00_f2\x00_f3\x00f6\x00\x00\x00')
// CHECK: ('_symbols', [
@@ -351,7 +357,7 @@ L6:
// CHECK: ('n_type', 0xe)
// CHECK: ('n_sect', 4)
// CHECK: ('n_desc', 0)
-// CHECK: ('n_value', 287)
+// CHECK: ('n_value', 295)
// CHECK: ('_string', 'f6')
// CHECK: ),
// CHECK: # Symbol 7