aboutsummaryrefslogtreecommitdiffstats
path: root/test/MC/MachO
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-03-13 02:38:00 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-03-13 02:38:00 +0000
commitda3e9f760ce2328f6dfe69663c2b17da02ece2db (patch)
tree3da1536ebe72c69d6f21f7d57082073e7bbd863f /test/MC/MachO
parent5e6a7a248b980dd2a98a3613c72b75ba9d01d162 (diff)
downloadexternal_llvm-da3e9f760ce2328f6dfe69663c2b17da02ece2db.zip
external_llvm-da3e9f760ce2328f6dfe69663c2b17da02ece2db.tar.gz
external_llvm-da3e9f760ce2328f6dfe69663c2b17da02ece2db.tar.bz2
MC/Mach-O: PCrel relocations weren't using the right base address, they are
relative to the fragment address, not its offset. This was masked by the text section normally being at address 0. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98420 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/MC/MachO')
-rw-r--r--test/MC/MachO/reloc-pcrel-offset.s14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/MC/MachO/reloc-pcrel-offset.s b/test/MC/MachO/reloc-pcrel-offset.s
new file mode 100644
index 0000000..46dc3a9
--- /dev/null
+++ b/test/MC/MachO/reloc-pcrel-offset.s
@@ -0,0 +1,14 @@
+// RUN: llvm-mc -n -triple i386-apple-darwin9 %s -filetype=obj -o - | macho-dump --dump-section-data | FileCheck %s
+
+// CHECK: # Relocation 0
+// CHECK: (('word-0', 0x1),
+// CHECK: ('word-1', 0x5000002)),
+// CHECK-NEXT: ])
+// CHECK: ('_section_data', '\xe8\xfb\xff\xff\xff')
+
+ .data
+ .long 0
+
+ .text
+_a:
+ call _a