Andes Workshop

It is currently Fri Mar 29, 2024 7:26 am

All times are UTC + 8 hours [ DST ]




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: linker script裡對齊16byte的語法
PostPosted: Thu Dec 29, 2011 12:25 pm 
Offline
User avatar

Joined: Fri Mar 04, 2011 9:36 pm
Posts: 500
如果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)).


Top
 Profile Send private message E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 18 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group