avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-gcc-list] Removal of unused functions again...


From: Johannes bauer
Subject: [avr-gcc-list] Removal of unused functions again...
Date: Sat, 19 Aug 2006 00:09:49 +0200
User-agent: Mozilla Thunderbird 1.0.7 (X11/20051015)

Hello people,

I've read quite a bit about the removal of unused functions when using
avr-gcc. In particular I've read Jörg's remarks about the automatic
removal feature being useless and I think this might very well be
correct. He also made a remark about the feature being hardly maintained
and that it might break with future versions of GCC - this again might
hold true (if I'm not making something wrong).

Here's what I did: First wanted to go the way of least resistance:

CFLAGS += -ffunction-sections
LDFLAGS += -static -Wl,--gc-sections -Wl,-uInterruptVectors

Result? The .text secion is completely empty in the output file:

# nm outfile
00800060 B __bss_end
00800060 B __bss_start
00000000 T __ctors_end
00000000 T __ctors_start
00800060 D __data_end
00000000 A __data_load_end
00000000 A __data_load_start
00800060 D __data_start
00000000 T __dtors_end
00000000 T __dtors_start
00800060 D _edata
00810000 ? __eeprom_end
00800060 ? _end
00000000 T _etext
00000000 W __heap_end
00800060 ? __heap_start
         U InterruptVectors
0000025f W __stack

So then I took Jörg's comment seriously: I split the functionality up
into eight seperate source-files, compiled them with -c, bonded them
together with avr-ar. Then, trying to link my project with the newly
created .a file:

# avr-gcc -Wall -Werror -Wunused -Wuninitialized -Os -mmcu=at90s8515 -o
outfile.c source.c obj1.o obj2.o obj3. library.a
/usr/lib/gcc-lib/avr/3.3/../../../../avr/bin/ld: region text is full
(Temperatur section .text)

I'm using avr-gcc version...
Reading specs from /usr/lib/gcc-lib/avr/3.3/specs
Configured with: ./configure --prefix=/usr --host=i686-pc-linux-gnu
--mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share
--sysconfdir=/etc --localstatedir=/var/lib --target=avr
--enable-languages=c --enable-nls
Thread model: single
gcc version 3.3

Is there anything I'm doing completely wrong? Anybody knows what this is
all about?

Greetings,
Johannes




reply via email to

[Prev in Thread] Current Thread [Next in Thread]