From d784b288775558d34a72cdca011fd801acfe6a99 Mon Sep 17 00:00:00 2001 From: Michael Matz Date: Thu, 31 Dec 2020 01:21:52 +0100 Subject: [PATCH] No need for sm_table.size entry the sh_size input member is reliable, we don't need to duplicate it in the section mapping info. --- tccelf.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tccelf.c b/tccelf.c index 2b929886..dfb2ab67 100644 --- a/tccelf.c +++ b/tccelf.c @@ -2751,7 +2751,6 @@ ST_FUNC void *load_data(int fd, unsigned long file_offset, unsigned long size) typedef struct SectionMergeInfo { Section *s; /* corresponding existing section */ unsigned long offset; /* offset of the new section in the existing section */ - unsigned long size; /* size of the new section in the existing section */ uint8_t new_section; /* true if section 's' was added */ uint8_t link_once; /* true if link once section */ } SectionMergeInfo; @@ -2917,7 +2916,6 @@ ST_FUNC int tcc_load_object_file(TCCState *s1, if (sh->sh_addralign > s->sh_addralign) s->sh_addralign = sh->sh_addralign; sm_table[i].offset = s->data_offset; - sm_table[i].size = sh->sh_size; sm_table[i].s = s; /* concatenate sections */ size = sh->sh_size; @@ -3006,7 +3004,7 @@ ST_FUNC int tcc_load_object_file(TCCState *s1, continue; sh = &shdr[i]; offset = sm_table[i].offset; - size = sm_table[i].size; + size = sh->sh_size; switch(s->sh_type) { case SHT_RELX: /* take relocation offset information */