the sh_size input member is reliable, we don't need to duplicate it in the section mapping info.
Unified · Split
| @@ -2751,7 +2751,6 @@ ST_FUNC void *load_data(int fd, unsigned long file_offset, unsigned long size) · 2750 unmodified lines | ||
| 2751 | 2751 | typedef struct SectionMergeInfo { |
| 2752 | 2752 | Section *s; /* corresponding existing section */ |
| 2753 | 2753 | unsigned long offset; /* offset of the new section in the existing section */ |
| 2754 | − unsigned long size; /* size of the new section in the existing section */ | |
| 2755 | 2754 | uint8_t new_section; /* true if section 's' was added */ |
| 2756 | 2755 | uint8_t link_once; /* true if link once section */ |
| 2757 | 2756 | } SectionMergeInfo; |
| @@ -2917,7 +2916,6 @@ ST_FUNC int tcc_load_object_file(TCCState *s1, · 159 unmodified lines | ||
| 2917 | 2916 | if (sh->sh_addralign > s->sh_addralign) |
| 2918 | 2917 | s->sh_addralign = sh->sh_addralign; |
| 2919 | 2918 | sm_table[i].offset = s->data_offset; |
| 2920 | − sm_table[i].size = sh->sh_size; | |
| 2921 | 2919 | sm_table[i].s = s; |
| 2922 | 2920 | /* concatenate sections */ |
| 2923 | 2921 | size = sh->sh_size; |
| @@ -3006,7 +3004,7 @@ ST_FUNC int tcc_load_object_file(TCCState *s1, · 82 unmodified lines | ||
| 3006 | 3004 | continue; |
| 3007 | 3005 | sh = &shdr[i]; |
| 3008 | 3006 | offset = sm_table[i].offset; |
| 3009 | − size = sm_table[i].size; | |
| 3007 | + size = sh->sh_size; | |
| 3010 | 3008 | switch(s->sh_type) { |
| 3011 | 3009 | case SHT_RELX: |
| 3012 | 3010 | /* take relocation offset information */ |