設置選項為: Options-C/C++中勾選上 One ELF Section per Function復選框
它的意義多是,每個函數獨自設立建設一個 elf,link時能夠僅把須要的函數編譯進代碼內里。
官方說法:
One ELF Section per Function:
Generate one ELF section for each function in source file. Output sections are named with the same name as the function that generates the section. Allows to optimize code or to locate each function on individual memory addresses.
這里有個文章:http://wenku.baidu.com/view/6bd94e60561252d380eb6e3e.html
有人提出不同意見:
這個選項是說,每個函數只存在一個,而不是復制多個,可以理解為 時間換空間。
意思是運行速度會慢一點。
也有人在選擇了此項優化后,串口通信出了問題,去掉優化后就好了,有待考證.
我的使用:
選擇此優化,但不選擇Optimization優化(Level 0),暫時沒有發現問題,串口xmodem燒錄Flash也沒有問題。