have you tried, -g -Os

or -ggdb -Os

that is what I use to debug size optimized code.

works fine.

figuring out what the code is doing can be a bit tricky but it can be done.


On Wed, Feb 18, 2015 at 9:10 PM, Arvind Padmanabhan <
arvindpadmanab...@yahoo.com.sg> wrote:

> Hi Folks,
>
> My friend has Code Composer Studio (CCS) license. He compiled without
> debugging and no optimization. Code size (ROM) is only 35 KB. This is good
> for MSP430G2955 that has 56 KB of Flash.
>
> I compiled the same code using mspgcc, I get the following (-g -Oo):
>
> /usr/lib/gcc/msp430/4.6.3/../../../../msp430/bin/ld: lpwmn.elf section
> `.text' will not fit in region `rom'
> /usr/lib/gcc/msp430/4.6.3/../../../../msp430/bin/ld: section .vectors
> loaded at [0000ffe0,0000ffff] overlaps section .text loaded at
> [00002100,0001078f]
> /usr/lib/gcc/msp430/4.6.3/../../../../msp430/bin/ld: region `rom'
> overflowed by 2674 bytes
> /usr/lib/gcc/msp430/4.6.3/libcrt0.a(_copy_data.o): In function
> `__do_copy_data':
> /build/buildd/gcc-msp430-4.6.3~mspgcc-20120406/./gcc-4.6.3/gcc/config/msp430/crt0.S:195:
> relocation truncated to fit: R_MSP430_16_BYTE against symbol
> `__data_load_start' defined in *ABS* section in lpwmn.elf
> /usr/lib/gcc/msp430/4.6.3/crt0ivtbl16.o: In function `__isr_14':
> (.text+0x2): relocation truncated to fit: R_MSP430_16 against symbol
> `_unexpected_' defined in .text.crt0 section in
> /usr/lib/gcc/msp430/4.6.3/libcrt0.a(_unexpected_.o)
> ./4lpwmn/util/src/util.o: In function `UTIL_initTraceCntxt':
> util.c:(.text+0x4f6): relocation truncated to fit: R_MSP430_16 against
> symbol `memset' defined in .text section in /usr/msp430/lib/libc.a(memset.o)
> ./4lpwmn/system/src/system.o: In function `SYS_init':
> system.c:(.text+0x14): relocation truncated to fit: R_MSP430_16 against
> symbol `memset' defined in .text section in /usr/msp430/lib/libc.a(memset.o)
> ./4lpwmn/system/src/system.o: In function `SYS_loop':
> system.c:(.text+0x614): relocation truncated to fit: R_MSP430_16 against
> symbol `PHY_PIB_init' defined in .text section in
> ./4lpwmn/802_15_4e/src/phy_pib.o
> system.c:(.text+0x61c): relocation truncated to fit: R_MSP430_16 against
> symbol `ADP_init' defined in .text section in ./4lpwmn/adp/src/adp.o
> system.c:(.text+0x716): relocation truncated to fit: R_MSP430_16 against
> symbol `ADP_evtHndlr' defined in .text section in ./4lpwmn/adp/src/adp.o
> system.c:(.text+0x8ec): relocation truncated to fit: R_MSP430_16 against
> symbol `ADP_procPendingTrscns' defined in .text section in
> ./4lpwmn/adp/src/adp.o
> system.c:(.text+0x974): relocation truncated to fit: R_MSP430_16 against
> symbol `ADP_evtHndlr' defined in .text section in ./4lpwmn/adp/src/adp.o
> ./4lpwmn/smac/src/s_mac_cc1101.o: In function `MAC_csmaAttemptTxOnCca':
> s_mac_cc1101.c:(.text+0x704): relocation truncated to fit: R_MSP430_16
> against symbol `CC1101_txToIdleTransitionTimeMilli' defined in .rodata
> section in ./4lpwmn/pltfrm/src/cc1101.o
> ./4lpwmn/smac/src/s_mac_cc1101.o: In function `MAC_getCsmaBackOff':
> s_mac_cc1101.c:(.text+0x7f8): additional relocation overflows omitted from
> the output
> collect2: ld returned 1 exit status
> make: *** [lpwmn.elf] Error 1
>
> If I remove -g option and optimize for size (-Os), then I can get it down
> to 32 KB. Problem is I can't do debugging in this case. Am I missing some
> trick or is CCS compiler doing something smart?
>
> Regards,
> Arvind
>
>
> ------------------------------------------------------------------------------
> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
> with Interactivity, Sharing, Native Excel Exports, App Integration & more
> Get technology previously reserved for billion-dollar corporations, FREE
>
> http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
> _______________________________________________
> Mspgcc-users mailing list
> Mspgcc-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mspgcc-users
>
>


-- 
Eric B. Decker
Senior (over 50 :-) Researcher
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
_______________________________________________
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users

Reply via email to