The error is not related to demo.elf. Running qemu-system-avr without a program (no "-bios program.elf" option) also yields the same error:
$ ./qemu-5.1.0/avr-softmmu/qemu-system-avr -machine mega2560 VNC server running on 127.0.0.1:5900 qemu-system-avr: execution left flash memory Aborted (core dumped)
The error is not related to demo.elf. Running qemu-system-avr without a program (no "-bios program.elf" option) also yields the same error:
$ ./qemu- 5.1.0/avr- softmmu/ qemu-system- avr -machine mega2560
VNC server running on 127.0.0.1:5900
qemu-system-avr: execution left flash memory
Aborted (core dumped)