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

linker script裡對齊16byte的語法
http://forum.andestech.com/viewtopic.php?f=16&t=226
Page 1 of 1

Author:  cindy [ Thu Dec 29, 2011 12:25 pm ]
Post subject:  linker script裡對齊16byte的語法

如果user希望程式的section的結尾能在16 byte boundary上。
加上]. = ALIGN(16); 可以達到這個功能,
如下:

.text : { *(.text .stub .text.* .gnu.linkonce.t.*) KEEP (*(.text.*personality*))*(.gnu.warning) . = ALIGN(16); }

KEEP是避免程式碼被garbage collection去掉。
下面是說明:

Input section and garbage collection
When link-time garbage collection is in use (`--gc-sections'), it is often useful to mark sections that should not be eliminated. This is accomplished by surrounding an input section's wildcard entry with KEEP(), as in KEEP(*(.init)) or KEEP(SORT(*)(.ctors)).

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