llvm-6502/lib/MC
Kevin Enderby 8c9aa922a9 This adds a Darwin x86_64 relocation encoding for a subtraction expression
where both symbols are "local", that is non-external symbols, and there is
no "base" for the symbols used in the expression, that is the section has
no non-temporary symbols.  This case looks like this:

% cat local_reloc_A-B.s
	.long 0
LB:	.long 1
	.long LA - LB - 4
	.long 2
LA:	.long 3

which llvm-mc will not encode without this patch, generates a "unsupported
local relocations in difference" error, but the Darwin assembler will
encode with relocation entries like this:

% otool -rv a.out l.out 
a.out:
Relocation information (__TEXT,__text) 2 entries
address  pcrel length extern type    scattered symbolnum/value
00000008 False long   False  SUB     False     1 (__TEXT,__text)
00000008 False long   False  UNSIGND False     1 (__TEXT,__text)

which is very similar to what is encoded when the symbols don't have the
leading 'L' and they are not temporary symbols.  Which llvm-mc and the
Darwin assembler will encoded like this:

Relocation information (__TEXT,__text) 2 entries
address  pcrel length extern type    scattered symbolnum/value
00000008 False long   True   SUB     False     B
00000008 False long   True   UNSIGND False     A

This is the missing relocation encoding needed to allow the Mach-O x86
Dwarf file and line table to be emitted.  So this patch also removes the
TODO from the if() statement in MCMachOStreamer::Finish() that didn't 
call MCDwarfFileTable::Emit() for 64-bit targets.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115389 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-02 00:13:41 +00:00
..
MCDisassembler
MCParser This is the last major patch to implement support for the .loc directive 2010-09-30 16:52:03 +00:00
CMakeLists.txt
ELFObjectWriter.cpp Factor some logic into ShouldRelocOnSymbol. This simplifies the code and 2010-09-30 20:18:35 +00:00
MachObjectWriter.cpp This adds a Darwin x86_64 relocation encoding for a subtraction expression 2010-10-02 00:13:41 +00:00
Makefile
MCAsmInfo.cpp
MCAsmInfoCOFF.cpp
MCAsmInfoDarwin.cpp
MCAsmStreamer.cpp Tiny patch for proof-of-concept cleanup of ARMAsmPrinter::EmitStartOfAsmFile() 2010-09-30 02:45:56 +00:00
MCAssembler.cpp This is the last major patch to implement support for the .loc directive 2010-09-30 16:52:03 +00:00
MCCodeEmitter.cpp
MCContext.cpp Move logic of determining ELF entsize from the .s printer to initialization 2010-09-30 05:59:22 +00:00
MCDisassembler.cpp
MCDwarf.cpp This is the last major patch to implement support for the .loc directive 2010-09-30 16:52:03 +00:00
MCELFStreamer.cpp Tiny patch for proof-of-concept cleanup of ARMAsmPrinter::EmitStartOfAsmFile() 2010-09-30 02:45:56 +00:00
MCExpr.cpp Changes EvaluateAsAbsolute() to return the "current value" of the expression 2010-09-30 16:42:21 +00:00
MCInst.cpp
MCInstPrinter.cpp
MCLabel.cpp
MCLoggingStreamer.cpp
MCMachOStreamer.cpp This adds a Darwin x86_64 relocation encoding for a subtraction expression 2010-10-02 00:13:41 +00:00
MCNullStreamer.cpp
MCObjectStreamer.cpp
MCObjectWriter.cpp This is the last major patch to implement support for the .loc directive 2010-09-30 16:52:03 +00:00
MCSection.cpp
MCSectionCOFF.cpp
MCSectionELF.cpp Move logic of determining ELF entsize from the .s printer to initialization 2010-09-30 05:59:22 +00:00
MCSectionMachO.cpp
MCStreamer.cpp This is the last major patch to implement support for the .loc directive 2010-09-30 16:52:03 +00:00
MCSymbol.cpp
MCValue.cpp
TargetAsmBackend.cpp
WinCOFFObjectWriter.cpp Correctly produce R_X86_64_32 or R_X86_64_32S. 2010-09-30 03:11:42 +00:00
WinCOFFStreamer.cpp