[llvm-commits] [llvm] r61484 - in /llvm/trunk: include/llvm/Target/TargetAsmInfo.h lib/CodeGen/AsmPrinter/DwarfWriter.cpp lib/Target/TargetAsmInfo.cpp lib/Target/X86/X86TargetAsmInfo.cpp

Duncan Sands baldrick at free.fr
Tue Dec 30 00:03:38 PST 2008


Hi Bill,

> Linux wants the FDE initial location and address range to be forced to 32-bit.
> Darwin doesn't. Make this optional for platforms.

linux wants the address 32 bit, because we told it that the address is 32 bit!
It's the sdata4:

        Asm->EmitInt8(DW_EH_PE_pcrel | DW_EH_PE_sdata4);
        Asm->EOL("FDE Encoding (pcrel sdata4)");

As far as I can see, the reason darwin now needs 64 bit on 64 bit platforms
is because of your change yesterday, in which you told it to use the default
platform size:

        Asm->EmitInt8(DW_EH_PE_pcrel);
        Asm->EOL("FDE Encoding (pcrel)");

It makes no sense to introduce a new option Force32BitFDEReference,
because it determined by the existing option doesFDEEncodingRequireSData4.

In fact, it seems to me that these changes and your FDE change of
yesterday could all be reverted - I don't see how they can be the real
cause of the problem you are trying to solve.  Most likely some value
is being output in a special way on darwin, and was being output as
64 bit rather than 32 bit.  Note that 32 bit has the advantage of
taking up less space while being big enough to hold all values
produced in this context.  So better to revert your changes and
correct that place to output a 32 bit value.

However there is something to be said for expressing the dependency
between the specification of the FDE encoding and the output of FDE
values.  So how about keeping Force32BitFDEEncoding, and use it in
place of doesFDEEncodingRequireSData4.  Note that all FDE values
should refer to this flag to determine how to write values.  Even
better would be to specify the encoding, and have some wonder
mechanism for outputting values according to the encoding, rather
than using EmitReference and friends.

Ciao,

Duncan.



More information about the llvm-commits mailing list