From: Conor Taylor Date: Mon, 31 May 2021 18:00:40 +0000 (+0200) Subject: Add size property to avr_symbol_t X-Git-Url: https://git.htl-mechatronik.at/public/?a=commitdiff_plain;h=9950e8b7a170c61647aceef32b71b9d09c4dcbea;p=sx%2Fsimavr.git Add size property to avr_symbol_t --- diff --git a/simavr/sim/sim_avr.h b/simavr/sim/sim_avr.h index 3553976..710e12b 100644 --- a/simavr/sim/sim_avr.h +++ b/simavr/sim/sim_avr.h @@ -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; diff --git a/simavr/sim/sim_elf.c b/simavr/sim/sim_elf.c index 4c28959..3012daa 100644 --- a/simavr/sim/sim_elf.c +++ b/simavr/sim/sim_elf.c @@ -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,