I guess I may be the last one to have spotted this but is everyone else aware that when you use -Wl,-relax the .lss file can no longer be used. I was looking at the intermediate .s files and the .loc directives inserted to support the debugging; for any particular block the line numbers there agreed with the line numbers of the relevant source lines but the actual source annotation produced with avr-objdump -S leads to wrong source lines being shown. Switching off -relax fixes this. I guess that the .loc's are used at the stage that CALLs are produced with the assumption they will create 4 bytes of output and then the relaxation happens and reduces 4 bytes to 2 so the actual offsets into the disassembly change but nothing has corrected the symbolic debug info to account for this. The affect is cumulative so source line annotation gets further and further away from the relevant opcodes the further into the file you get.
It's just a little irritating when a bootloader builds to 2020 bytes with relax but about 2200 without and the bootloader section is 2048 bytes! I guess I just have to live with the consequences.
Relax, don't do it, when you want to go to it!
EDIT: how embarrassing, so I AM the last person to spot this - I even read this thread: https://www.avrfreaks.net/index.p...