Open ManfredSteiner opened 2 years ago
A probable work-round would be to convert the ELF file to ihex and load that. That does lose debug symbols.
The problem sounds similar to #462, with the same cause: simavr does not really follow the ELF spec.
Thank your for response. Your statement in #462 ...
simavr loads only the .text, .data, .eeprom, .fuse and .lock sections and assumes the first two are contiguous.
... seems to be true, which is definitely a failure in simavr.
In my project I build now in different ways. One variant for hardware target and one variant for simulation (without modification of default section configuration). That's my work-arround at the moment.
For a project with an Atmega324P I use special sections to ensure that some code is located on desired addresses. Works fine on real target, but these sections are not loaded proper in simavr.
Any idea what is going wrong and how to solve this problem?
To reproduce this problem I use an Ubuntu system with avr-gcc (5.4.0), avr-gdb (10.1.90.20210103-git) and simavr (1.6+dfsg-3).
1) Create file
main.c
2) Build project and locate section
.app
to0x7100
3) Check result in elf-file
Disassemble elf-file with
avr-objdump -d main.elf
4) Start simavr
5) Start avr-gdb and show memory on location
0x7100
Start in another shell avr-gdb with
avr-gdb main.elf
.Then execute the following commands on gdb console:
target remote localhost:1234
x/20b 0x7100
As you can see, the memory locations starting with
0x7100
are cleared (=0xff
) instead of showing the same content as in disassembly view. Symbols likemain
are shown as desired.