[chbot] AVR linker issue (?)

Col colp42 at gmail.com
Sun Jul 18 03:13:01 BST 2021


On 18/07/21 10:39 am, Richard Jones wrote:
> Could the problem be to do with c++ compiler and c linker?
> Sorry I don't have a windows machine to look further.
>

It complied for me ok using C and a winavr make file.


Colin.

----------------------------

$ make


-------- begin --------
avr-gcc (AVR_8_bit_GNU_Toolchain_3.6.2_1778) 5.4.0
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


Compiling: main.c
avr-gcc -c -mmcu=atmega328p -I. -gstabs   -Os -funsigned-char 
-funsigned-bitfields -fpack-struct -fshort-enums -Wall 
-Wstrict-prototypes -Wa,-adhlns=main.lst  -std=gnu99 
-Wp,-M,-MP,-MT,main.o,-MF,.dep/main.o.d main.c -o main.o

Compiling: font.c
avr-gcc -c -mmcu=atmega328p -I. -gstabs   -Os -funsigned-char 
-funsigned-bitfields -fpack-struct -fshort-enums -Wall 
-Wstrict-prototypes -Wa,-adhlns=font.lst  -std=gnu99 
-Wp,-M,-MP,-MT,font.o,-MF,.dep/font.o.d font.c -o font.o

Linking: main.elf
avr-gcc -mmcu=atmega328p -I. -gstabs   -Os -funsigned-char 
-funsigned-bitfields -fpack-struct -fshort-enums -Wall 
-Wstrict-prototypes -Wa,-adhlns=main.o  -std=gnu99 
-Wp,-M,-MP,-MT,main.o,-MF,.dep/main.elf.d main.o font.o   --output 
main.elf -Wl,-Map=main.map,--cref    -lm

Creating load file for Flash: main.hex
avr-objcopy -O ihex -R .eeprom main.elf main.hex

Creating load file for EEPROM: main.eep
avr-objcopy -j .eeprom --set-section-flags=.eeprom="alloc,load" \
--change-section-lma .eeprom=0 -O ihex main.elf main.eep
avr-objcopy: --change-section-lma .eeprom=0x0000000000000000 never used

Creating Extended Listing: main.lss
avr-objdump -h -S main.elf > main.lss

Creating Symbol Table: main.sym
avr-nm -n main.elf > main.sym

Size after:
main.elf  :
section                    size      addr
.data                        10   8388864
.text                       190         0
.stab                      2052         0
.stabstr                   3503         0
.comment                     48         0
.note.gnu.avr.deviceinfo     64         0
.debug_info                1524         0
.debug_abbrev              1442         0
.debug_line                  26         0
.debug_str                  520         0
Total                      9379



Errors: none

-------- end --------





More information about the Chchrobotics mailing list