[LLVMdev] Placing globals in specific sections

Chris Lattner sabre at nondot.org
Sat Jan 28 18:41:55 PST 2006


On Sat, 28 Jan 2006, Yossi Kreinin wrote:
> The LLVM Bytecode File Format specifies an optional SectionID attribute
> for globals. I didn't find a matching attribute in the LLVM source code.
> Code such as:
>
>  int a __attribute__ ((section ("A_SECTION")));
>
> compiles with llvm-gcc, but apparently the section information is
> stripped (the object file doesn't contain "A_SECTION").
>
> Is the SectionID feature implemented or just defined?

The old/traditional llvm-gcc C front-end doesn't honor section attributes. 
The new one does, but it is not "stable" on all targets.  If you'd like to 
try it out, let me know and I can give you instructions for use.

-Chris

-- 
http://nondot.org/sabre/
http://llvm.org/




More information about the llvm-dev mailing list