[cfe-dev] [PATCH] options -ffunction-sections and -fdata-sections

Sylvere Teissier st at invia.fr
Wed Apr 7 15:25:40 PDT 2010


Anton Korobeynikov wrote:
> Hello, Sylvere
>
>   
>> Currently it works only for elf format backend, for other object formats
>> these options are ignored.
>>     
> First of all, please honor the LLVM coding style (or, at least, the
> code style of the source files you're modifying).
>   
Ok, I have checked this point, I hope it's ok now
> Second, I belive the approach used is wrong - there is already way to
> emit objects into separate sections, which
> is used for linkonce objects, you just need to hook in there. No need
> to reinvent the wheel :)
>   
Thanks for the tip, I've changed my patch using the existing code. But I 
use different section names than gnu.linkonce when It's not "WeakForLinker"
because gnu.linkonce.* are special sections. (I try to follow GCC 
section naming for -ffunction-sections/-fdata-sections)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: function-data-sections-clang.patch
Type: text/x-patch
Size: 4000 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20100408/76cae99e/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: function-data-sections-llvm.patch
Type: text/x-patch
Size: 4772 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20100408/76cae99e/attachment-0001.bin>


More information about the cfe-dev mailing list