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 Fixed a crash in the enhanced disassembler where 2010-09-23 02:14:12 +00:00
MCParser This is the last major patch to implement support for the .loc directive 2010-09-30 16:52:03 +00:00
CMakeLists.txt Add ELF ObjectWriter and Streamer support. 2010-08-16 18:35:43 +00:00
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 start straightening out libedis's dependencies and make it fit 2010-07-20 18:25:19 +00:00
MCAsmInfo.cpp allow target-specific label suffixes, patch by Yuri Gribov! 2010-09-22 22:19:53 +00:00
MCAsmInfoCOFF.cpp Revert part of my last commit. the mingw32 build bot doesn't seem to like it. 2010-08-23 05:25:23 +00:00
MCAsmInfoDarwin.cpp Fix .debug_range for linux. Patch by Krister Wombell. 2010-09-02 16:43:44 +00:00
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 MCCodeEmitter: Add target independent fixup flag for is-pc-relative. 2010-03-19 10:43:23 +00:00
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 MC: Change MCInst::dump_pretty to not include a trailing newline. 2010-05-26 15:18:13 +00:00
MCInstPrinter.cpp add a new MCInstPrinter::getOpcodeName interface, when it is 2010-02-11 22:39:10 +00:00
MCLabel.cpp Added support in MC for Directional Local Labels. 2010-05-17 23:08:19 +00:00
MCLoggingStreamer.cpp Add a InitSections method to the streamer interface. 2010-09-15 21:48:40 +00:00
MCMachOStreamer.cpp This adds a Darwin x86_64 relocation encoding for a subtraction expression 2010-10-02 00:13:41 +00:00
MCNullStreamer.cpp Add a InitSections method to the streamer interface. 2010-09-15 21:48:40 +00:00
MCObjectStreamer.cpp Avoid some Mach-O specific alignment being done on ELF. 2010-09-22 22:27:05 +00:00
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 switch MCSectionCOFF from a syntactic to semantic representation, 2010-05-07 17:17:41 +00:00
MCSectionCOFF.cpp MC: Move COFF enumeration constants to llvm/Support/COFF.h, patch by Michael 2010-07-01 20:07:24 +00:00
MCSectionELF.cpp Move logic of determining ELF entsize from the .s printer to initialization 2010-09-30 05:59:22 +00:00
MCSectionMachO.cpp Fix section attribute name. 2010-05-21 21:08:52 +00:00
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 MC/Mach-O: Mark absolute variable's appropriately, and add Mach-O support for 2010-05-05 19:01:05 +00:00
MCValue.cpp MCValue: Change to holding MCSymbolRefExprs instead of MCSymbols, we will need this for accessing to symbol modifiers. 2010-03-18 00:59:10 +00:00
TargetAsmBackend.cpp MC/Darwin: Add a new target hook for whether the target uses "reliable" symbol differences, basically whether the assembler should attempt to understand atoms when using scattered symbols. 2010-03-18 00:58:53 +00:00
WinCOFFObjectWriter.cpp Correctly produce R_X86_64_32 or R_X86_64_32S. 2010-09-30 03:11:42 +00:00
WinCOFFStreamer.cpp Avoid some Mach-O specific alignment being done on ELF. 2010-09-22 22:27:05 +00:00