Andes Workshop
http://forum.andestech.com/

-ffunction-sections及-fdata-sections
http://forum.andestech.com/viewtopic.php?f=6&t=678
Page 1 of 1

Author:  cindy [ Fri Mar 01, 2013 3:51 pm ]
Post subject:  -ffunction-sections及-fdata-sections

-ffunction-sections, -fdata-sections會使compiler為每個function和data分配獨立的section。 --gc-sections會使ld刪除沒有被使用的section。

ld以section作為最小的處理單元,只要一個section中有某個符號被引用,該section就會被放入output中。這些選項一起使用會從最終的輸出檔中刪除所有未被使用的function和data, 只包含用到的function和data。

-ffunction-sections, -fdata-sections加上--gc-sections可以減少code size。
更重要的是保持良好的coding習慣,常常review code。
gc-sections有時會造成debug information不正確,使得debug有些困擾。

Page 1 of 1 All times are UTC + 8 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/