From 9950e8b7a170c61647aceef32b71b9d09c4dcbea Mon Sep 17 00:00:00 2001 From: Conor Taylor Date: Mon, 31 May 2021 20:00:40 +0200 Subject: [PATCH] Add size property to avr_symbol_t --- simavr/sim/sim_avr.h | 1 + simavr/sim/sim_elf.c | 1 + 2 files changed, 2 insertions(+) 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, -- 2.39.5