llvm-6502/test/MC/MachO
Rafael Espindola a23cc6a1ea Add r224985 back with fixes.
The fixes are to note that AArch64 has additional restrictions on when local
relocations can be used. In particular, ld64 requires that relocations to
cstring/cfstrings use linker visible symbols.

Original message:

In an assembly expression like

bar:
  .long L0 + 1

the intended semantics is that bar will contain a pointer one byte past L0.

In sections that are merged by content (strings, 4 byte constants, etc), a
single position in the section doesn't give the linker enough information.
For example, it would not be able to tell a relocation must point to the
end of a string, since that would look just like the start of the next.

The solution used in ELF to use relocation with symbols if there is a non-zero
addend.

In MachO before this patch we would just keep all symbols in some sections.

This would miss some cases (only cstrings on x86_64 were implemented) and was
inefficient since most relocations have an addend of 0 and can be represented
without the symbol.

This patch implements the non-zero addend logic for MachO too.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226503 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-19 21:11:14 +00:00
..
AArch64 Add r224985 back with fixes. 2015-01-19 21:11:14 +00:00
ARM Convert test to llvm-readobj. NFC. 2014-12-29 22:14:35 +00:00
absolute.s MachObjectWriter: optimize the string table for common suffices 2014-10-06 17:05:19 +00:00
absolutize.s MachObjectWriter: optimize the string table for common suffices 2014-10-06 17:05:19 +00:00
bad-darwin-x86_64-32-bit-abs-addr.s
bad-darwin-x86_64-diff-relocs.s
bad-darwin-x86_64-reloc-expr1.s Fix a Mach-O assembler segfault for a subtraction expression with an undefined symbol. 2014-10-24 22:39:40 +00:00
bad-darwin-x86_64-reloc-expr2.s Fix a Mach-O assembler segfault for a subtraction expression with an undefined symbol. 2014-10-24 22:39:40 +00:00
bad-darwin-x86_64-reloc-expr.s
bad-dollar.s
bad-indirect-symbols.s
bad-macro.s
bss.s
comm-1.s MachObjectWriter: optimize the string table for common suffices 2014-10-06 17:05:19 +00:00
darwin-complex-difference.s MachObjectWriter: optimize the string table for common suffices 2014-10-06 17:05:19 +00:00
darwin-x86_64-diff-reloc-assign-2.s Don't produce relocations for a difference in a section with no symbols. 2014-11-04 22:10:33 +00:00
darwin-x86_64-diff-reloc-assign.s
darwin-x86_64-diff-relocs.s MachObjectWriter: optimize the string table for common suffices 2014-10-06 17:05:19 +00:00
darwin-x86_64-nobase-relocs.s
darwin-x86_64-reloc-offsets.s
darwin-x86_64-reloc.s Convert test to llvm-readobj. NFC. 2014-12-26 22:47:39 +00:00
data.s
debug_frame.s
diff-with-two-sections.s
direction_labels.s
eh_symbol.s Change the default input for llvm-nm to be a.out instead of standard input 2014-06-23 20:27:53 +00:00
eh-frame-reloc.s X86: drop relocations on __eh_frame sections globally. 2014-07-22 15:47:09 +00:00
file.s Drop support for an old version of ld64 (from darwin 9). 2014-10-21 18:31:09 +00:00
gen-dwarf-cpp.s
gen-dwarf-macro-cpp.s
gen-dwarf-producer.s
gen-dwarf.s [dwarfdump] Dump full filenames as DW_AT_(decl|call)_file attribute values 2014-09-22 12:36:04 +00:00
i386-large-relocations.s
indirect-symbols.s MachObjectWriter: optimize the string table for common suffices 2014-10-06 17:05:19 +00:00
jcc.s
lcomm-attributes.s MachObjectWriter: optimize the string table for common suffices 2014-10-06 17:05:19 +00:00
linker-option-1.s
linker-option-2.s
linker-options.ll IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
lit.local.cfg
loc.s
osx-version-min-load-command.s Adds the next bit of support for llvm-objdump’s -private-headers for executable Mach-O files. 2014-09-04 16:54:47 +00:00
pcrel-to-other-section.s
pr19185.s
previous.s
pushsection.s
relax-jumps.s
relax-recompute-align.s
reloc-diff.s
reloc-pcrel-offset.s
reloc-pcrel.s
reloc.s Use llvm-readobj. NFC. 2014-12-26 18:22:05 +00:00
section-align-1.s
section-align-2.s MachObjectWriter: optimize the string table for common suffices 2014-10-06 17:05:19 +00:00
section-attributes.s
section-flags.s
string-table.s MachObjectWriter: optimize the string table for common suffices 2014-10-06 17:05:19 +00:00
symbol-diff.s MachObjectWriter: optimize the string table for common suffices 2014-10-06 17:05:19 +00:00
symbol-flags.s MachObjectWriter: optimize the string table for common suffices 2014-10-06 17:05:19 +00:00
symbol-indirect.s MachObjectWriter: optimize the string table for common suffices 2014-10-06 17:05:19 +00:00
symbols-1.s MachObjectWriter: optimize the string table for common suffices 2014-10-06 17:05:19 +00:00
tbss.s MachObjectWriter: optimize the string table for common suffices 2014-10-06 17:05:19 +00:00
tdata.s
temp-labels.s
thread_init_func.s
tls.s MachObjectWriter: optimize the string table for common suffices 2014-10-06 17:05:19 +00:00
tlv-bss.ll
tlv-reloc.s MachObjectWriter: optimize the string table for common suffices 2014-10-06 17:05:19 +00:00
tlv.s
values.s
variable-errors.s
variable-exprs.s MachObjectWriter: optimize the string table for common suffices 2014-10-06 17:05:19 +00:00
weakdef.s
x86_32-optimal_nop.s
x86_32-scattered-reloc-fallback.s
x86_32-sections.s
x86_32-symbols.s MachObjectWriter: optimize the string table for common suffices 2014-10-06 17:05:19 +00:00
x86_64-mergeable.s Add r224985 back with fixes. 2015-01-19 21:11:14 +00:00
x86_64-reloc-arithmetic.s
x86_64-sections.s
x86_64-symbols.s Add r224985 back with fixes. 2015-01-19 21:11:14 +00:00
x86-data-in-code.ll
zerofill-1.s
zerofill-2.s
zerofill-3.s MachObjectWriter: optimize the string table for common suffices 2014-10-06 17:05:19 +00:00
zerofill-4.s
zerofill-5.s
zerofill-sect-align.s