llvm-6502/lib/MC
Saleem Abdulrasool 42ad510d31 MC: check machine magic when applying offset adjustments
The values for the relocation type can (and do) overlap across various
architectures.  When performing an adjustment of the emitted relocation in the
final object file, check that the file magic matches the target for which the
relocation type is valid (e.g. a I386 relocation is only applied to an X86
object file, and an AMD64 relocation is only applied to an X86_64 object file).
This was noticed while adding support for ARM WinCOFF object file emission.

A test case for this is not really possible as the values for REL32 do not
overlap on I386 and AMD64, which is why this was never noticed in practice.  The
ARM WinCOFF emission is not yet ready to merge into the tree.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206138 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-13 20:47:55 +00:00
..
MCDisassembler Remove redundant symbolization support from MCDisassembler interface. 2014-04-11 20:07:58 +00:00
MCParser DebugInfo: Emit relocation to debug_line section when emitting asm for asm 2014-04-01 07:35:52 +00:00
CMakeLists.txt MachO: Add linker-optimisation hint framework to MC. 2014-03-29 07:34:53 +00:00
ELFObjectWriter.cpp [C++11] More 'nullptr' conversion or in some cases just using a boolean check instead of comparing to nullptr. 2014-04-13 04:57:38 +00:00
LLVMBuild.txt
MachObjectWriter.cpp [C++11] More 'nullptr' conversion or in some cases just using a boolean check instead of comparing to nullptr. 2014-04-13 04:57:38 +00:00
Makefile
MCAsmBackend.cpp Simplify a really complicated check for Arch == X86_64. 2014-03-11 21:22:57 +00:00
MCAsmInfo.cpp [C++11] More 'nullptr' conversion or in some cases just using a boolean check instead of comparing to nullptr. 2014-04-13 04:57:38 +00:00
MCAsmInfoCOFF.cpp Re-commit: Demote EmitRawText call in AsmPrinter::EmitInlineAsm() and remove hasRawTextSupport() call 2014-02-13 14:44:26 +00:00
MCAsmInfoDarwin.cpp MachO: actually set linker-private prefix at MC level. 2014-03-29 07:33:24 +00:00
MCAsmInfoELF.cpp Refactor the setting of PrivateGlobalPrefix. 2013-12-02 23:39:26 +00:00
MCAsmStreamer.cpp [C++11] More 'nullptr' conversion or in some cases just using a boolean check instead of comparing to nullptr. 2014-04-13 04:57:38 +00:00
MCAssembler.cpp [C++11] More 'nullptr' conversion or in some cases just using a boolean check instead of comparing to nullptr. 2014-04-13 04:57:38 +00:00
MCAtom.cpp [weak vtables] Remove a bunch of weak vtables 2013-11-19 00:57:56 +00:00
MCCodeEmitter.cpp
MCCodeGenInfo.cpp
MCContext.cpp [C++11] More 'nullptr' conversion or in some cases just using a boolean check instead of comparing to nullptr. 2014-04-13 04:57:38 +00:00
MCDisassembler.cpp Remove redundant symbolization support from MCDisassembler interface. 2014-04-11 20:07:58 +00:00
MCDwarf.cpp [C++11] More 'nullptr' conversion or in some cases just using a boolean check instead of comparing to nullptr. 2014-04-13 04:57:38 +00:00
MCELF.cpp [mc] Fix ELF st_other flag. 2013-12-05 00:34:11 +00:00
MCELFObjectTargetWriter.cpp Completely rewrite ELFObjectWriter::RecordRelocation. 2014-03-29 06:26:49 +00:00
MCELFStreamer.cpp [C++11] More 'nullptr' conversion or in some cases just using a boolean check instead of comparing to nullptr. 2014-04-13 04:57:38 +00:00
MCExpr.cpp [C++11] More 'nullptr' conversion or in some cases just using a boolean check instead of comparing to nullptr. 2014-04-13 04:57:38 +00:00
MCExternalSymbolizer.cpp [C++11] More 'nullptr' conversion or in some cases just using a boolean check instead of comparing to nullptr. 2014-04-13 04:57:38 +00:00
MCFixup.cpp Add llvm_unreachable after fully-covered switches to appease GCC 2014-03-20 07:30:40 +00:00
MCFunction.cpp [C++11] More 'nullptr' conversion or in some cases just using a boolean check instead of comparing to nullptr. 2014-04-13 04:57:38 +00:00
MCInst.cpp [C++11] More 'nullptr' conversion or in some cases just using a boolean check instead of comparing to nullptr. 2014-04-13 04:57:38 +00:00
MCInstPrinter.cpp [MC] When MCInstPrint::printAnnotation uses a comment stream, it has to ensure 2013-10-01 19:21:24 +00:00
MCInstrAnalysis.cpp
MCLabel.cpp
MCLinkerOptimizationHint.cpp [ARM64][CollectLOH] Add some comments to explain how the LOHs 2014-04-02 01:02:28 +00:00
MCMachObjectTargetWriter.cpp
MCMachOStreamer.cpp [C++11] More 'nullptr' conversion or in some cases just using a boolean check instead of comparing to nullptr. 2014-04-13 04:57:38 +00:00
MCModule.cpp [C++11] More 'nullptr' conversion or in some cases just using a boolean check instead of comparing to nullptr. 2014-04-13 04:57:38 +00:00
MCModuleYAML.cpp YAMLIO: Allow scalars to dictate quotation rules 2014-04-10 07:37:33 +00:00
MCNullStreamer.cpp [C++11] More 'nullptr' conversion or in some cases just using a boolean check instead of comparing to nullptr. 2014-04-13 04:57:38 +00:00
MCObjectDisassembler.cpp [C++11] More 'nullptr' conversion or in some cases just using a boolean check instead of comparing to nullptr. 2014-04-13 04:57:38 +00:00
MCObjectFileInfo.cpp [C++11] More 'nullptr' conversion or in some cases just using a boolean check instead of comparing to nullptr. 2014-04-13 04:57:38 +00:00
MCObjectStreamer.cpp [C++11] More 'nullptr' conversion or in some cases just using a boolean check instead of comparing to nullptr. 2014-04-13 04:57:38 +00:00
MCObjectSymbolizer.cpp [C++11] More 'nullptr' conversion or in some cases just using a boolean check instead of comparing to nullptr. 2014-04-13 04:57:38 +00:00
MCObjectWriter.cpp
MCRegisterInfo.cpp
MCRelocationInfo.cpp [C++11] More 'nullptr' conversion or in some cases just using a boolean check instead of comparing to nullptr. 2014-04-13 04:57:38 +00:00
MCSection.cpp
MCSectionCOFF.cpp [C++11] More 'nullptr' conversion or in some cases just using a boolean check instead of comparing to nullptr. 2014-04-13 04:57:38 +00:00
MCSectionELF.cpp Remove AllowQuotesInName and friends from MCAsmInfo. 2013-11-13 14:01:59 +00:00
MCSectionMachO.cpp [C++11] More 'nullptr' conversion or in some cases just using a boolean check instead of comparing to nullptr. 2014-04-13 04:57:38 +00:00
MCStreamer.cpp [C++11] More 'nullptr' conversion or in some cases just using a boolean check instead of comparing to nullptr. 2014-04-13 04:57:38 +00:00
MCSubtargetInfo.cpp Reverting r199886 (Prevent repetitive warnings for unrecognized processors and features) 2014-01-25 16:56:18 +00:00
MCSymbol.cpp Revert "Add back r203962, r204028 and r204059." 2014-03-19 00:13:43 +00:00
MCSymbolizer.cpp Move MCSymbolizer's constructor into header. It's trivial - there's no need for 2014-03-27 02:42:52 +00:00
MCValue.cpp [C++11] More 'nullptr' conversion or in some cases just using a boolean check instead of comparing to nullptr. 2014-04-13 04:57:38 +00:00
MCWin64EH.cpp
SubtargetFeature.cpp [C++11] More 'nullptr' conversion or in some cases just using a boolean check instead of comparing to nullptr. 2014-04-13 04:57:38 +00:00
WinCOFFObjectWriter.cpp MC: check machine magic when applying offset adjustments 2014-04-13 20:47:55 +00:00
WinCOFFStreamer.cpp [C++11] More 'nullptr' conversion or in some cases just using a boolean check instead of comparing to nullptr. 2014-04-13 04:57:38 +00:00