llvm-6502/lib/MC
David Majnemer 16d8031f94 MC, COFF: Use relocations for function references inside the section
Referencing one symbol from another in the same section does not
generally require a relocation.  However, the MS linker has a feature
called /INCREMENTAL which enables incremental links.  It achieves this
by creating thunks to the actual function and redirecting all
relocations to point to the thunk.

This breaks down with the old scheme if you have a function which
references, say, itself.  On x86_64, we would use %rip relative
addressing to reference the start of the function from out current
position.  This would lead to miscompiles because other references might
reference the thunk instead, breaking function pointer equality.

This fixes PR21520.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221678 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-11 08:43:57 +00:00
..
MCDisassembler Use a StringRefMemoryObject. NFC. 2014-11-07 01:09:51 +00:00
MCParser Add const. NFC. 2014-11-11 05:11:47 +00:00
CMakeLists.txt Nuke MCAnalysis. 2014-09-02 22:32:20 +00:00
ConstantPools.cpp Fix build failure on windows 2014-07-18 16:41:58 +00:00
ELFObjectWriter.cpp Add back commits r219835 and a fixed version of r219829. 2014-10-17 01:48:58 +00:00
LLVMBuild.txt Nuke MCAnalysis. 2014-09-02 22:32:20 +00:00
MachObjectWriter.cpp Don't produce relocations for a difference in a section with no symbols. 2014-11-04 22:10:33 +00:00
Makefile Nuke MCAnalysis. 2014-09-02 22:32:20 +00:00
MCAsmBackend.cpp
MCAsmInfo.cpp Drop support for an old version of ld64 (from darwin 9). 2014-10-21 18:31:09 +00:00
MCAsmInfoCOFF.cpp Remove HasLEB128. 2014-08-15 14:01:07 +00:00
MCAsmInfoDarwin.cpp Drop support for an old version of ld64 (from darwin 9). 2014-10-21 18:31:09 +00:00
MCAsmInfoELF.cpp Move getNonexecutableStackSection up to the base ELF class. 2014-10-15 15:44:16 +00:00
MCAsmStreamer.cpp Revert r221150, as it broke sanitizer tests 2014-11-03 12:19:03 +00:00
MCAssembler.cpp [MC] Make bundle alignment mode setting idempotent and support nested bundles 2014-10-15 17:10:04 +00:00
MCCodeEmitter.cpp
MCCodeGenInfo.cpp
MCContext.cpp Add back commits r219835 and a fixed version of r219829. 2014-10-17 01:48:58 +00:00
MCDwarf.cpp Drop support for an old version of ld64 (from darwin 9). 2014-10-21 18:31:09 +00:00
MCELF.cpp [MC] Constify MCELF::GetVisibility and MCELF::getOther 2014-07-11 17:34:44 +00:00
MCELFObjectTargetWriter.cpp [MC] Pass MCSymbolData to needsRelocateWithSymbol 2014-07-20 23:15:06 +00:00
MCELFStreamer.cpp Add back commits r219835 and a fixed version of r219829. 2014-10-17 01:48:58 +00:00
MCExpr.cpp MC: Shrink MCSymbolRefExpr by only storing the bits we need. 2014-10-11 17:57:27 +00:00
MCInst.cpp
MCInstPrinter.cpp
MCInstrAnalysis.cpp
MCLabel.cpp
MCLinkerOptimizationHint.cpp
MCMachObjectTargetWriter.cpp
MCMachOStreamer.cpp Add and update reset() and doInitialization() methods to MC* and passes. 2014-09-17 09:25:36 +00:00
MCNullStreamer.cpp Remove method that is identical to the base class one. 2014-10-14 17:38:38 +00:00
MCObjectFileInfo.cpp [mips64] Fix MIPS64 exception personality encoding 2014-11-05 22:42:31 +00:00
MCObjectStreamer.cpp Revert r221150, as it broke sanitizer tests 2014-11-03 12:19:03 +00:00
MCObjectWriter.cpp
MCRegisterInfo.cpp
MCSection.cpp
MCSectionCOFF.cpp MC: Fix MCSectionCOFF::PrintSwitchToSection 2014-09-20 20:40:50 +00:00
MCSectionELF.cpp delete function name from comment 2014-10-09 21:23:39 +00:00
MCSectionMachO.cpp
MCStreamer.cpp Revert r221150, as it broke sanitizer tests 2014-11-03 12:19:03 +00:00
MCSubtargetInfo.cpp Change MCSchedModel to be a struct of statically initialized data. 2014-09-02 17:43:54 +00:00
MCSymbol.cpp
MCSymbolizer.cpp
MCTargetOptions.cpp Convert MC command line option for fatal assembler warnings into a 2014-08-26 18:39:50 +00:00
MCValue.cpp
MCWin64EH.cpp MC Win64: Put unwind info for COMDAT code into the same COMDAT group 2014-09-04 17:42:03 +00:00
MCWinEH.cpp MC Win64: Put unwind info for COMDAT code into the same COMDAT group 2014-09-04 17:42:03 +00:00
StringTableBuilder.cpp MachObjectWriter: optimize the string table for common suffices 2014-10-06 17:05:19 +00:00
SubtargetFeature.cpp Fix some cases where StringRef was being passed by const reference. Remove const from some other StringRefs since its implicitly const already. 2014-08-30 16:48:02 +00:00
WinCOFFObjectWriter.cpp MC, COFF: Use relocations for function references inside the section 2014-11-11 08:43:57 +00:00
WinCOFFStreamer.cpp MC, COFF: Use relocations for function references inside the section 2014-11-11 08:43:57 +00:00
YAML.cpp Invert the MC -> Object dependency. 2014-07-03 02:01:39 +00:00