Subject:
|
Re: GCC vs. IAR compiler: Could GCC be tweaked to generate code as tight as IAR?
|
Newsgroups:
|
lugnet.robotics.nxt.nxthacking
|
Date:
|
Thu, 5 Apr 2007 02:03:36 GMT
|
Viewed:
|
20275 times
|
| |
| |
In lugnet.robotics.nxt.nxthacking, Rasmus Pedersen wrote:
> Hi,
>
> If I compile the LEGO firmware sources with gcc, the code size increases much
> beyond the 128 KB (which I think) the IAR compiled sources fits into.
I read a paper that attributed most of the code size increases in gcc generated
code to the printf library - search for AN52-ARM-C-Benchmark.pdf to read the
paper. Out of curiosity I built the firmware using the newlib libc and the gcc
4.1.1 toolchain. The code size was
firmware :
section size addr
.text 158492 1048576
.data 6216 2097152
.bss 46240 2103368
.comment 2052 0
.debug_aranges 7312 0
.debug_pubnames 16026 0
.debug_info 213843 0
.debug_abbrev 42027 0
.debug_line 53237 0
.debug_frame 19336 0
.debug_str 30069 0
.debug_loc 126303 0
.debug_ranges 3744 0
Total 724897
I then built the firmware without linking to libc, and supplied the missing
functions from source ripped out of linux's klibc. I got this for code size
firmware :
section size addr
.text 127080 1048576
.data 5116 2097152
.bss 45752 2102268
.comment 1188 0
.debug_aranges 5912 0
.debug_pubnames 12976 0
.debug_info 92527 0
.debug_abbrev 20705 0
.debug_line 30860 0
.debug_frame 14212 0
.debug_str 22560 0
.debug_loc 75593 0
.debug_ranges 2616 0
Total 457097
I haven't tried the klibc firmware so this could be complete garbage, but it may
be a place to start.
Andrew
|
|
Message is in Reply To:
11 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|