[llvm-commits] [PATCH]: sketch of PPC32 ELF writer

Roman Divacky rdivacky at freebsd.org
Mon Aug 1 11:19:41 PDT 2011


Hi,

the attached two patches sketch out PPC32 ELF writer.

1) powerpc-mc-md.patch

        This defines some PPC relocation types and introduces
        PPCELFObjectWriter and ELFPPCAsmBackend. Including ApplyFixup()
        implementation.

        I think this patch is basically committable.

2) powerpc-mc.patch

        This implements PPCELFObjectWriter class including quite wrong
        GetRelocType(). There's a hack in RecordRelocation where
        fixup_ppc_ha16/fixup_ppc_lo16 offset needs to be adjusted by two.
        I don't know how to do this properly.

        I think this needs more work on the GetRelocType() and the fixup
        hack.

With these two patches applied I am able to compile a running hello world on
FreeBSD using clang -integrated-as. It can compile non-running vim. I used
to be able to compile -g version of vim and it went quite far before it
crashed. Debug compilation is not possibly anymore, I suspect some endian
issue (gdb says: Dwarf Error: wrong version in compilation unit header (is
512, should be 2))

What should I do with these patches? The first one seems committable (and
touches only PowerPC code), the second should be ok to commit without the +2
hack and with the GetRelocType() just asserting.

I don't have any tests for this nor I think I'll do any more significant work.

Comments? 

roman
-------------- next part --------------
A non-text attachment was scrubbed...
Name: powerpc-mc-md.patch
Type: text/x-diff
Size: 5099 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20110801/a92ef5db/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: powerpc-mc.patch
Type: text/x-diff
Size: 4032 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20110801/a92ef5db/attachment-0001.patch>


More information about the llvm-commits mailing list