[LLVMdev] Help needed about code & data mixing when emit object files

zan jyu Wong zyfwong at gmail.com
Mon Aug 3 19:03:12 PDT 2015

  I'm building a new backend which can only load very limited range of imm.
So I decided to use constant pool, and place constant pool entries close
enough to instructions use the entries (we have very limited range
PC-relative memory load). However, lld & llc output the object files that
gather all constant pool entries into one section. How can I make them mix
these entries into code section ?
  By the way, I have read the ARM backend, and know how it place
CONSTPOOL_ENTRY in basic block islands. However, I could not understand how
to make it when emitting obj file. And when the code & data are mixed, the
disassembler will failed to parse the binary properly. For example, if we
place a CONSTPOOL_ENTRY in .text section and it will confused the
disassembler. I wonder if is possible to emit subsections (of .text
section) in *MCCodeEmitter to mix data into code and avoid confusing
disassembler, like this [1]?
  Any Ideas? Thanks.

[1] http://lists.cs.uiuc.edu/pipermail/llvmdev/2010-June/032263.html

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150804/4225b180/attachment.html>

More information about the llvm-dev mailing list