llvm-6502/lib/MC/MCParser
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
..
AsmLexer.cpp Support C99 hexadecimal floating-point literals in assembly 2013-08-14 14:23:31 +00:00
AsmParser.cpp The integrated darwin assembler can hang in an infinite loop (or get an assert 2013-08-28 17:50:59 +00:00
CMakeLists.txt build/CMake: Finish removal of add_llvm_library_dependencies. 2011-11-29 19:25:30 +00:00
COFFAsmParser.cpp MC: Implement COFF .linkonce directive 2013-07-06 12:13:10 +00:00
DarwinAsmParser.cpp The integrated darwin assembler can hang in an infinite loop (or get an assert 2013-08-28 17:50:59 +00:00
ELFAsmParser.cpp Add support for subsections to the ELF assembler. Fixes PR8717. 2013-04-17 21:18:16 +00:00
LLVMBuild.txt LLVMBuild: Remove trailing newline, which irked me. 2011-12-12 19:48:00 +00:00
Makefile
MCAsmLexer.cpp Change SMRange to be half-open (exclusive end) instead of closed (inclusive) 2013-01-07 19:00:49 +00:00
MCAsmParser.cpp MCParser: Update method names per coding guidelines. 2013-02-20 22:21:35 +00:00
MCAsmParserExtension.cpp Restore r125595 (reverted in r126336) with modifications: 2011-02-24 21:59:22 +00:00
MCTargetAsmParser.cpp [ms-inline asm] Add the isParsingInlineAsm() function to the MCAsmTargetParser. 2012-10-19 17:57:49 +00:00