llvm-6502/lib/MC
Kevin Enderby 527d783837 Tweak the MCExternalSymbolizer to not use the SymbolLookUp() call back
to not guess at a symbol name in some cases.

The problem is that in object files assembled starting at address 0, when
trying to symbolicate something that starts like this:

% cat x.s
_t1:
	vpshufd	$0x0, %xmm1, %xmm0

the symbolic disassembly can end up like this:

% otool -tV x.o 
x.o:
(__TEXT,__text) section
_t1:
0000000000000000	vpshufd	$_t1, %xmm1, %xmm0

Which is in this case produced incorrect symbolication.

But it is useful in some cases to use the SymbolLookUp() call back
to guess at some immediate values.  For example one like this
that does not have an external relocation entry:

% cat y.s
_t1:
	movl	$_d1, %eax
.data
_d1:	.long	0

% clang -c -arch i386 y.s

% otool -tV y.o 
y.o:
(__TEXT,__text) section
_t1:
0000000000000000	movl	$_d1, %eax

% otool -rv y.o 
y.o:
Relocation information (__TEXT,__text) 1 entries
address  pcrel length extern type    scattered symbolnum/value
00000001 False long   False  VANILLA False     2 (__DATA,__data)

So the change is based on it is not likely that an immediate Value
coming from an instruction field of a width of 1 byte, other than branches
and items with relocation, are not likely symbol addresses.

With the change the first case above simply becomes:

% otool -tV x.o 
x.o:
(__TEXT,__text) section
_t1:
0000000000000000	vpshufd	$0x0, %xmm1, %xmm0

and the second case continues to work as expected.

rdar://14863405


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199698 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-21 00:23:17 +00:00
..
MCDisassembler For the 'C' disassembler API, add a new ReferenceType for the 2014-01-06 22:08:08 +00:00
MCParser Fix parsing of .symver directive on ARM 2014-01-15 22:40:02 +00:00
CMakeLists.txt
ELFObjectWriter.cpp Force emit a relocation for @gnu_indirect_function symbols so that the indirect 2014-01-08 18:50:32 +00:00
LLVMBuild.txt
MachObjectWriter.cpp
Makefile
MCAsmBackend.cpp
MCAsmInfo.cpp CommentColumn is always 40. Simplify. 2014-01-16 07:04:11 +00:00
MCAsmInfoCOFF.cpp
MCAsmInfoDarwin.cpp
MCAsmInfoELF.cpp
MCAsmStreamer.cpp Add an emitRawComment function and use it to simplify some uses of EmitRawText. 2014-01-16 16:28:37 +00:00
MCAssembler.cpp Fix indentation. 2014-01-13 15:50:36 +00:00
MCAtom.cpp
MCCodeEmitter.cpp
MCCodeGenInfo.cpp
MCContext.cpp Re-sort all of the includes with ./utils/sort_includes.py so that 2014-01-07 11:48:04 +00:00
MCDisassembler.cpp
MCDwarf.cpp [patch] Adjust behavior of FDE cross-section relocs for targets that don't support abs-differences. 2014-01-08 10:22:54 +00:00
MCELF.cpp
MCELFObjectTargetWriter.cpp
MCELFStreamer.cpp Re-sort all of the includes with ./utils/sort_includes.py so that 2014-01-07 11:48:04 +00:00
MCExpr.cpp ARM: add tlsldo relocation 2014-01-20 11:00:40 +00:00
MCExternalSymbolizer.cpp Tweak the MCExternalSymbolizer to not use the SymbolLookUp() call back 2014-01-21 00:23:17 +00:00
MCFunction.cpp
MCInst.cpp
MCInstPrinter.cpp
MCInstrAnalysis.cpp
MCLabel.cpp
MCMachObjectTargetWriter.cpp
MCMachOStreamer.cpp
MCModule.cpp
MCModuleYAML.cpp
MCNullStreamer.cpp
MCObjectDisassembler.cpp
MCObjectFileInfo.cpp Revert "Revert r198851, "Prototype of skeleton type units for fission"" 2014-01-10 01:38:41 +00:00
MCObjectStreamer.cpp Re-sort all of the includes with ./utils/sort_includes.py so that 2014-01-07 11:48:04 +00:00
MCObjectSymbolizer.cpp Re-sort all of the includes with ./utils/sort_includes.py so that 2014-01-07 11:48:04 +00:00
MCObjectWriter.cpp
MCPureStreamer.cpp
MCRegisterInfo.cpp
MCRelocationInfo.cpp Re-sort all of the includes with ./utils/sort_includes.py so that 2014-01-07 11:48:04 +00:00
MCSection.cpp
MCSectionCOFF.cpp
MCSectionELF.cpp
MCSectionMachO.cpp
MCStreamer.cpp Add an emitRawComment function and use it to simplify some uses of EmitRawText. 2014-01-16 16:28:37 +00:00
MCSubtargetInfo.cpp
MCSymbol.cpp
MCSymbolizer.cpp
MCValue.cpp
MCWin64EH.cpp
SubtargetFeature.cpp
WinCOFFObjectWriter.cpp
WinCOFFStreamer.cpp