[LLVMdev] Problem of ELF section attribute

Evan Cheng evan.cheng at apple.com
Wed Feb 13 11:08:03 PST 2008


Please file a bug. We'll move the discussion there.

Thanks,

Evan

On Feb 13, 2008, at 1:10 AM, Haifeng He wrote:

> Hi,
>
> I am having problem of using LLVM on a program which contains
> customized code section.
> In addition to ".text" section for keeping code, the program has
> another code section, called ".init.text".
> The functions in this section are defined as
>   "int foo (int, int) __attribute__ ((section (".init.text")));"
>
> If I compile the program with gcc, this section(".init.text") will
> have attributes of "AX" (means allocate space and
> executable). However, if I first compile the program into llvm IR,
> then convert IR to native assembly code using
> llc, this section will not have "AX" attribute. This causes the native
> executable fails when it tries to call a function
> in .init.text section. Any suggestion? (btw, my platform is Linux
> running on x86 machine.)
>
> Thank you
>
> Haifeng
> _______________________________________________
> 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