diff options
author | Jim Grosbach <grosbach@apple.com> | 2012-01-17 22:14:39 +0000 |
---|---|---|
committer | Jim Grosbach <grosbach@apple.com> | 2012-01-17 22:14:39 +0000 |
commit | 8b9300b972745a6d89b482cbcd4206c01359f7df (patch) | |
tree | 071c86c422c7148217e4bc75b6849d8b5227d38b /test/MC/MachO | |
parent | 283f1fff47db3a483ab94e4b49cc39eb39dd48ea (diff) | |
download | external_llvm-8b9300b972745a6d89b482cbcd4206c01359f7df.zip external_llvm-8b9300b972745a6d89b482cbcd4206c01359f7df.tar.gz external_llvm-8b9300b972745a6d89b482cbcd4206c01359f7df.tar.bz2 |
MC tweak symbol difference resolution for non-local symbols.
When the non-local symbol in the expression is in the same fragment
as the second symbol, the assembler can still evaluate the expression
without needing a relocation.
For example, on ARM:
_foo:
ldr lr, (_foo - 4)
rdar://10348687
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148341 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/MC/MachO')
-rw-r--r-- | test/MC/MachO/ARM/darwin-ARM-reloc.s | 4 | ||||
-rw-r--r-- | test/MC/MachO/reloc-pcrel-offset.s | 1 | ||||
-rw-r--r-- | test/MC/MachO/reloc-pcrel.s | 7 |
3 files changed, 7 insertions, 5 deletions
diff --git a/test/MC/MachO/ARM/darwin-ARM-reloc.s b/test/MC/MachO/ARM/darwin-ARM-reloc.s index fe69a94..b98c80c 100644 --- a/test/MC/MachO/ARM/darwin-ARM-reloc.s +++ b/test/MC/MachO/ARM/darwin-ARM-reloc.s @@ -12,9 +12,9 @@ _f1: .data _d0: -Ld0_0: +Ld0_0: .long Lsc0_0 - Ld0_0 - + .section __TEXT,__cstring,cstring_literals Lsc0_0: .long 0 diff --git a/test/MC/MachO/reloc-pcrel-offset.s b/test/MC/MachO/reloc-pcrel-offset.s index bc611d7..e113e96 100644 --- a/test/MC/MachO/reloc-pcrel-offset.s +++ b/test/MC/MachO/reloc-pcrel-offset.s @@ -11,6 +11,7 @@ .text _a: +_b: call _a .subsections_via_symbols diff --git a/test/MC/MachO/reloc-pcrel.s b/test/MC/MachO/reloc-pcrel.s index b6d4be6..1133415 100644 --- a/test/MC/MachO/reloc-pcrel.s +++ b/test/MC/MachO/reloc-pcrel.s @@ -8,13 +8,13 @@ // CHECK: ('word-1', 0x6)), // CHECK: # Relocation 2 // CHECK: (('word-0', 0x40), -// CHECK: ('word-1', 0xd000002)), +// CHECK: ('word-1', 0xd000003)), // CHECK: # Relocation 3 // CHECK: (('word-0', 0x3b), -// CHECK: ('word-1', 0xd000002)), +// CHECK: ('word-1', 0xd000003)), // CHECK: # Relocation 4 // CHECK: (('word-0', 0x36), -// CHECK: ('word-1', 0xd000002)), +// CHECK: ('word-1', 0xd000003)), // CHECK: # Relocation 5 // CHECK: (('word-0', 0xe0000031), // CHECK: ('word-1', 0x4)), @@ -41,6 +41,7 @@ _a: xorl %eax,%eax _b: +_d: xorl %eax,%eax L0: xorl %eax,%eax |