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

Eugene Toder eltoder at gmail.com
Wed Jun 16 13:23:06 PDT 2010


I have no idea how gnu toolchain works on Mach-O platforms. My guess
is that it goes via COFF path here, because the other path is
ELF-specific.

As Andrew already said, for the table we need both section and
subsection. To solve the problem with running out, we can put each
function into a separate section (C++ compilers were doing this for a
while) and only use 2 subsections per section: 0 for the table and 1
for function.

Eugene

On Wed, Jun 16, 2010 at 1:45 PM, 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?
>
> --
> With best regards, Anton Korobeynikov
> Faculty of Mathematics and Mechanics, Saint Petersburg State University
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>




More information about the llvm-dev mailing list