Andes Workshop

It is currently Tue Sep 26, 2017 2:50 pm

All times are UTC + 8 hours [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: 如何減少code size
PostPosted: Mon Apr 07, 2014 9:05 pm 
Offline

Joined: Thu Jan 23, 2014 4:18 pm
Posts: 12
在map.txt中,看到很多沒有用過的library function,而且比主程式大很多。

是否有辦法移除這些function?

例如
0x00001fdc __gxx_personality_v0
0x00006388 __cxa_demangle
0x00006354 __gcclibcxx_demangle_callback
0x000069e0 _Unwind_GetIPInfo
0x000069d8 _Unwind_GetIP
0x00009694 _Unwind_Find_FDE
0x00009430 __register_frame
0x0000a07c __sfvwrite_r
0x0000b738 _svfprintf_r
0x0000d658 _dtoa_r


Attachments:
File comment: map.txt
map.zip [14.54 KiB]
Downloaded 161 times
File comment: source code
firmware.zip [43.59 KiB]
Downloaded 163 times
Top
 Profile Send private message E-mail  
 
 Post subject: Re: 如何減少code size
PostPosted: Tue Apr 08, 2014 7:30 pm 
Offline
User avatar

Joined: Fri Mar 04, 2011 9:36 pm
Posts: 500
您好,
我們研究一下。


Top
 Profile Send private message E-mail  
 
 Post subject: Re: 如何減少code size
PostPosted: Wed Apr 09, 2014 11:31 am 
Offline

Joined: Thu Apr 03, 2014 10:09 am
Posts: 42
Hi banyh,
The gcc compiler is auto produce __cxa_allocate_exception... etc.

The reason it "works" by defining it as a global NULL void pointer is probably because nothing is throwing an exception. When something tries to throw an exception, then you will see it misbehave.

you can reference the link:
http://stackoverflow.com/questions/329059/what-is-gxx-personality-v0-for
Attachment:
2.jpg
2.jpg [ 222.72 KiB | Viewed 3209 times ]


solution:
you can add the "-fno-exceptions" at Andes C++ Compiler->Miscellaneous
Attachment:
1.jpg
1.jpg [ 180.96 KiB | Viewed 3209 times ]


Top
 Profile Send private message E-mail  
 
 Post subject: Re: 如何減少code size
PostPosted: Wed Apr 09, 2014 4:12 pm 
Offline

Joined: Thu Jan 23, 2014 4:18 pm
Posts: 12
謝謝,沒問題了

加上 -fno-exceptions -fno-rtti 就可以從77KB降到7KB


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

All times are UTC + 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


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