History

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.

Michael Matz committed 5 years ago

Commit d784b281 parent b1170881 file · +1 −3Browse files

Unified · Split

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

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t