[LLVMdev] Adding support to LLVM for data & code layout (needed by GHC)

Andrew Lenharth andrewl at lenharth.org
Wed Jun 16 05:58:24 PDT 2010


On Wed, Jun 16, 2010 at 7:45 AM, Anton Korobeynikov
<anton at korobeynikov.info> wrote:
>> There is one complication though. LLVM (and GCC as well) don't support
>> subsections. While you can define what section globals and functions
>> are in, this doesn't support defining the subsection. If you say to
>> LLVM, put function f in section "text 12", it produces assembly like:
>>
>> .section text 12,"rw" @progbits
> This seems easy to fix during the asmprinting. E.g. if section name is
> an integer from 0 till 8192 => emit as an subsection. Side q: what
> will you do when you run out of subsections?

It seems easy to fix for functions, but for globals you already have
to overwrite their section in LLVM so the section won't be just an
integer.

Andrew

> --
> With best regards, Anton Korobeynikov
> Faculty of Mathematics and Mechanics, Saint Petersburg State University
>



More information about the llvm-dev mailing list