Hi,
of course, now that the startup code is eliminated, I'm trying to find a way to tell the avr-embedded-ld that the entry is the symbol main. I tried to change the ENTRY(_START) to ENTRY(main) in the script and/or add to the linker command line the --entry=main option, with no success

. I always get the same wrong code at the bootloader start address :
G:\Programming\dimitris\Projects\avrpasboot>G:\Programming\dimitris\tools\laz-2.2.2_fpc-3.2.2\fpc\3.2.3\bin\i386-win32\avr-embedded-objdump.exe -d pasboot.elf | more
pasboot.elf: file format elf32-avr
Disassembly of section .text:
00007000 <PsPASBOOT_ss_UART_TRANSMIT_BUFFERsPBYTEsBYTE>:
7000: 4f 92 push r4
7002: 3f 92 push r3
7004: 2f 92 push r2
7006: 1c 01 movw r2, r24
7008: 46 2e mov r4, r22
700a: 08 c0 rjmp .+16 ; 0x701c <PsPASBOOT_ss_UART_TRANSMIT_BUFFERsPBYTEsBYTE+0x1c>
700c: f1 01 movw r30, r2
700e: 80 81 ld r24, Z
7010: 0e 94 45 3c call 0x788a ; 0x788a <UART_ss_UART_TRANSMITsBYTE>
7014: 21 e0 ldi r18, 0x01 ; 1
Pitty that the fpc 3.2.3 fixes doesn't have the avr sections PR merged !
I attached both the batch file and linker script, so as I'm not familiar with this link topic, does anyone have any hint ?
regards,