If it is purely about code size you should definitely compile without
the debugging symbols (drop the -g switch). This should reduce the
size of the binary dramatically.

Stefan


Am 16.05.2012 17:18, schrieb Adam Ford:
> As a followup...
> 
> I have also compiled without:
> 
> -fdata-sections -ffunction-sections and linked with
> --no-keep-memory -Wl,-gc-sections
> 
> Having them on seems to make the code slightly smaller, but not
> much.
> 
> adam On 05/16/2012 10:14 AM, Adam Ford wrote:
>> I'm sorry for bugging people, and I have Googled this question,
>> but the answers I'm finding are really old and I know there are
>> updates to mspgcc since most of the answers were posted....
>> 
>> I am trying to port 3 different programs from IAR to MSPGCC for
>> work. I'm using the latest released version, but 2 of the 3 won't
>> fit even when compiling using optimizations: -mmcu=$(MCU) -g -Os
>> -Wall -fdata-sections -ffunction-sections  and linked with
>> --no-keep-memory -Wl,-gc-sections
>> 
>> Does anyone have any ideas how I can further optimize the
>> compiler (other than rewriting - which I've been trying to do)?
>> 
>> With an MSP430F149 processor, under IAR, the code compiles and
>> links (Code = 45858, data = 3000, CONST=4935)
>> 
>> Under GCC, it won't link because '.rodata won't fit into region
>> rom' and rom overflows by 796 bytes.
>> 
>> Examining the Map file shows .rodata is 0x1a66 in size, .text is
>> 0xc240 in size, .bss is 0x712
>> 
>> Any ideas how to make the libraries or optimizer make smaller
>> code?
>> 
>> adam
>> 
>> This email, including any attachments and files transmitted with
>> it, are for the sole use of the intended recipient(s) to whom
>> this email is addressed, and may contain confidential and/or
>> privileged information. Any unauthorized review, use, disclosure
>> or distribution is prohibited. If you are not the intended
>> recipient, please be advised that you have received this email in
>> error, and please contact the sender by reply email and destroy
>> all copies (including all electronic and hard copies) of the
>> original message. Thank you.
>> 
>> ------------------------------------------------------------------------------
>>
>> 
Live Security Virtual Conference
>> Exclusive live event will cover all the ways today's security
>> and threat landscape has changed and how IT managers can respond.
>> Discussions will include endpoint security, mobile security and
>> the latest in malware threats.
>> http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ 
>> _______________________________________________ Mspgcc-users
>> mailing list Mspgcc-users@lists.sourceforge.net 
>> https://lists.sourceforge.net/lists/listinfo/mspgcc-users
> 
> This email, including any attachments and files transmitted with
> it, are for the sole use of the intended recipient(s) to whom this
> email is addressed, and may contain confidential and/or privileged
> information. Any unauthorized review, use, disclosure or
> distribution is prohibited. If you are not the intended recipient,
> please be advised that you have received this email in error, and
> please contact the sender by reply email and destroy all copies
> (including all electronic and hard copies) of the original message.
> Thank you.
> 
> ------------------------------------------------------------------------------
>
> 
Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and 
> threat landscape has changed and how IT managers can respond.
> Discussions will include endpoint security, mobile security and the
> latest in malware threats.
> http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ 
> _______________________________________________ Mspgcc-users
> mailing list Mspgcc-users@lists.sourceforge.net 
> https://lists.sourceforge.net/lists/listinfo/mspgcc-users

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users

Reply via email to