[LLVMdev] ARM mapping symbols

Jim Grosbach grosbach at apple.com
Tue Mar 29 10:04:23 PDT 2011


On Mar 29, 2011, at 8:44 AM, Renato Golin wrote:

> Hi there,
> 
> I've created a bug on llvm:
> 
> http://www.llvm.org/bugs/show_bug.cgi?id=9582
> 
> Basically, ARM, Thumb and data mapping symbols should have been
> exported in the ELF file, so the linker can work correctly.
> 
> I can do the change and create some test cases, but I haven't been
> paying much attention to recent MC developments. Is ArmAsmPrinter the
> place to change for that, or is there an MC equivalent that would be a
> better fit?

The increasingly misnamed ARMAsmPrinter.cpp is the MC lowering pass. There is no non-MC based printer anymore, so you'll only have to change one place.

In particular, have a look at ARMAsmPrinter::EmitInstruction(). There's a big switch statement there for instructions that need any sorts of special handling. From the sounds of things, you'll be interested in the ARM::*_JT (jump table branch) instructions and ARM::CONSTPOOL_ENTRY.

These mapping symbols sound very similar to special-purpose assembler directives. Off the cuff, it makes sense to me to do something similar to the MCStreamer::EmitAssemblerFlag() routine.

-Jim



More information about the llvm-dev mailing list