Hi! In an attempt to reduce the code size I tried to use the -ffunction-sections and -fdata-sections with the --gc-sections linker flag. With -ffunction-sections option enabled the linker fails with the following errors:
avr-gcc -Wl,-Map,orient.out.map -mmcu=atxmega32a4 --gc-sections -Wl,--relax -lc -lm -o orient.out main.o kalman.o data_link.o gps_parser.o ../common/ring.o ../common/stack.o ../common/crc16.o ../common/runge_kutta.o ../common/trig.o ../common/coordinates.o hal/acc.o hal/adc.o hal/baro.o hal/gps.o hal/gyro.o hal/orient_hal.o hal/mag.o hal/temp.o hal/hw/lpr530al.o hal/hw/ly530alh.o hal/hw/mma7260q.o hal/hw/venus634flpx.o hal/cdev.o ../common/hal/timing.o ../common/hal/xmega_usart.o ../common/hal/xmega_adc.o ../common/hal/xmega_clock.o /usr/lib/gcc/avr/4.3.4/../../../avr/lib/avrxmega3/libc.a(fp_powsodd.o):../../../libm/fplib/fp_powsodd.S:59: relocation truncated to fit: R_AVR_13_PCREL against symbol `__mulsf3' defined in .text section in /usr/lib/gcc/avr/4.3.4/avrxmega3/libgcc.a(_mul_sf.o) /usr/lib/gcc/avr/4.3.4/../../../avr/lib/avrxmega3/libc.a(fp_powsodd.o):../../../libm/fplib/fp_powsodd.S:69: relocation truncated to fit: R_AVR_13_PCREL against symbol `__mulsf3' defined in .text section in /usr/lib/gcc/avr/4.3.4/avrxmega3/libgcc.a(_mul_sf.o) /usr/lib/gcc/avr/4.3.4/../../../avr/lib/avrxmega3/libc.a(inverse.o):../../../libm/fplib/inverse.S:50: relocation truncated to fit: R_AVR_13_PCREL against symbol `__divsf3' defined in .text section in /usr/lib/gcc/avr/4.3.4/avrxmega3/libgcc.a(_div_sf.o) make: *** [orient.out] Error 1 CFLAGS=-I. $(INC) -g $(MMCU) -O$(OPTLEVEL) \ -fpack-struct -fshort-enums \ -funsigned-bitfields -funsigned-char \ -Wall -Wstrict-prototypes \ $(SIM) \ -Wa,-ahlms=$(firstword \ $(filter %.lst, $(<:.c=.lst))) \ --param inline-call-cost=2 \ -finline-limit=3 \ -fno-inline-small-functions \ -fdata-sections \ -ffreestanding \ -ffunction-sections \ LDFLAGS=-Wl,-Map,$(TRG).map $(MMCU) \ --gc-sections \ -Wl,--relax \ $(LIBS) -- Regards, Thomas _______________________________________________ AVR-GCC-list mailing list AVR-GCC-list@nongnu.org http://lists.nongnu.org/mailman/listinfo/avr-gcc-list