[LLVMdev] eflags and other

reed kotler rkotler at mips.com
Tue Nov 15 19:27:27 PST 2011


Currently it's not possible during elf generation to set eflags properly.

While it's possible to create an override for the virtual function 
WriteEflags, the information needed is that  from the 
TargetSubtargetInfo (or classes derived from that like MipsSubTarget) 
but all there is there is the basic machine type (i.e. MIPS, ARM, x86) 
and endian.

This causes all the direct object emitters to put some fixed default 
into eflags.
Eflags contains detailed information about the subflavor of 
architecture, ABI, other.

One side effect of this problem is the objdump will not disassemble 
instructions in a .o that it things are not part of the specific subflavor.

This is where I noticed the problem originally.

There are various comments to this effect but they are not totally accurate.

// FIXME: get the real EABI Version from the Triple.
void ARMELFObjectWriter::WriteEFlags() {
   Write32(ELF::EF_ARM_EABIMASK & DefaultEABIVersion);
}

The Triple is in general not enough.

Any ideas no how to fix this?

I have some but it will touch several architectures.




More information about the llvm-dev mailing list