[LLVMdev] elf direct object emission

reed kotler rkotler at mips.com
Tue Nov 29 20:21:09 PST 2011


With the MIPS compiler, when we have static constants, in the .s file we 
get something like:

     .type    $.str33, at object         # @.str33
     .section    .rodata.str1.1,"aMS", at progbits,1
$.str33:
     .asciz     "//"
     .size    $.str33, 3


Currently when we create direct object code we are referencing the 
symbol as an offset in .rodata and not directly using the symbol with an 
offset of 0.

It's useful for us when testing and debugging the direct object emitter 
to end up with the same .o's essentially from the direct and not direct 
object emitter paths , so that we can objdump and then diff them.

So I'm trying to figure out how to force $.str33 into the elf local 
symbol table and then to reference it directly instead of the offset 
from rodata. This is how gas ends up doing it from the .s file.

If anyone knows how to do this I'd appreciate knowing too.

Tia.

Reed




More information about the llvm-dev mailing list