Commit 9950e8b7a170c61647aceef32b71b9d09c4dcbea
authorConor Taylor <conor@taylor.sh>
Mon, 31 May 2021 18:00:40 +0000 (20:00 +0200)
committerConor Taylor <conor@taylor.sh>
Mon, 31 May 2021 18:00:40 +0000 (20:00 +0200)
2 files changed:
simavr/sim/sim_avr.h
simavr/sim/sim_elf.c

index 35539761b040fd1a0a3de88a551c6f71b20cec6c..710e12b1b0a08a15f24e438f4d70f11a277ea932 100644 (file)
@@ -358,6 +358,7 @@ typedef struct avr_kind_t {
 // a symbol loaded from the .elf file
 typedef struct avr_symbol_t {
        uint32_t        addr;
+       uint32_t        size;
        const char  symbol[0];
 } avr_symbol_t;
 
index 4c289593152af2373b53d2abd56d90cd93f9e209..3012daa61844f34e292e67bb68df03d2db1636aa 100644 (file)
@@ -382,6 +382,7 @@ elf_read_firmware(
                                        avr_symbol_t * s = malloc(sizeof(avr_symbol_t) + strlen(name) + 1);
                                        strcpy((char*)s->symbol, name);
                                        s->addr = sym.st_value;
+                                       s->size = sym.st_size;
                                        if (!(firmware->symbolcount % 8))
                                                firmware->symbol = realloc(
                                                        firmware->symbol,