Add size property to avr_symbol_t
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)
simavr/sim/sim_avr.h
simavr/sim/sim_elf.c

index 3553976..710e12b 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 4c28959..3012daa 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,