llvm-6502/test/MC
Kevin Enderby 4f066b6db8 The integrated darwin assembler can hang in an infinite loop (or get an assert
with a debug build) with this buggy .indirect_symbol directive usage:

% cat test.s
x: .indirect_symbol _y

The assertion is because it is trying to get the symbol index for the
symbol _y when it is writing out the indirect symbol table. This line of
code in MachObjectWriter::WriteObject() :

        Write32(Asm.getSymbolData(*it->Symbol).getIndex());

And while there is a symbol _y it does not have any getSymbolData set which
is only done in MachObjectWriter::BindIndirectSymbols() for pointer sections
or stub sections.  I added a check and an error in there to catch this in case
something slips through.

But to get a better error the parser should detect when a .indirect_symbol
directive is used and it is not in a pointer section or stub section.  To make
that work I moved the handling of the indirect symbol out of the target
independent AsmParser code into the DarwinAsmParser code that can check
for the proper Mach-O section types.

rdar://14825505


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189497 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-28 17:50:59 +00:00
..
AArch64
ARM [ARMv8] 2013-08-28 16:39:20 +00:00
AsmParser
COFF Fix wrong code offset for unwind code SET_FPREG. 2013-08-27 04:16:16 +00:00
Disassembler [SystemZ] Add support for TMHH, TMHL, TMLH and TMLL 2013-08-28 10:31:43 +00:00
ELF
MachO The integrated darwin assembler can hang in an infinite loop (or get an assert 2013-08-28 17:50:59 +00:00
Markup
Mips [mips] Use ptr_rc to simplify definitions of base+index load/store instructions. 2013-08-28 00:55:15 +00:00
PowerPC Given target assembler parsers a chance to handle variant expressions 2013-08-27 20:23:19 +00:00
SystemZ [SystemZ] Add support for TMHH, TMHL, TMLH and TMLL 2013-08-28 10:31:43 +00:00
X86 [ms-inline asm] Support offsets after segment registers 2013-08-27 21:56:17 +00:00