[LLVMdev] cross-section differences in MC generation

Justin Hibbits jrh29 at alumni.cwru.edu
Thu Jun 26 09:33:30 PDT 2014


I'm working on Position-independent code for 32-bit PowerPC, but
running into a problem.  At the beginning of each function, there's a
pre-word that's the difference between the PICBase (.L1$pb) and the
GOT.  This works fine when generating assembly output, but it fails
when generating ELF output, with the error "Cannot represent a
difference across sections" (line 847, lib/MC/ELFObjectWriter.cpp).

Roman Divacky suggested I try something with 'let EncoderMethod = ...'
similar to how the TOC entries are done for ppc64.  However, I'm not
sure if that would work, given that the TOC on ppc64 is handled
differently from the GOT on ppc32, and I'm not sure how to represent
that if it could work.

Any ideas on how a cross-section diff and relocation could be
represented for this?

Thanks,
Justin



More information about the llvm-dev mailing list