[PATCH] D33647: [ELF] - Linkerscript: implement NOLOAD section type.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Mon May 29 23:16:28 PDT 2017


>> Problem is that Var will be placed into .data section.
>> (if __attribute__ used with section, the variable is treated like an initialized variable, see article above)
>> We may want to save space, and do not write 4096 of zeroes to output file. NOLOAD is a solution.
>
>It will be placed in the .data_noload_a section. I assume you mean the
>problem is that it will be of type progbits and there is no syntax in
>__attribute__ to mark it nobits instead.

Yeah, by "placed into .data section" I was mean it loses nobits type.

I saw ways to achieve the same using __attribute__, eg:
unsigned int __attribute__((section(".myVarSection,\"aw\", at nobits#"))) myVar;
(https://stackoverflow.com/questions/6252812/what-does-the-aw-flag-in-the-section-attribute-mean)

Way above does not compile for me. I saw other more nice syntax specific to some arm compiler,
I cant find it now, but generally anyways looks there is no standart here and people use script.

George.


More information about the llvm-commits mailing list