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
27512751 typedef struct SectionMergeInfo {
27522752 Section *s; /* corresponding existing section */
27532753 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 */
27552754 uint8_t new_section; /* true if section 's' was added */
27562755 uint8_t link_once; /* true if link once section */
27572756 } SectionMergeInfo;
@@ -2917,7 +2916,6 @@ ST_FUNC int tcc_load_object_file(TCCState *s1, · 159 unmodified lines
29172916 if (sh->sh_addralign > s->sh_addralign)
29182917 s->sh_addralign = sh->sh_addralign;
29192918 sm_table[i].offset = s->data_offset;
2920− sm_table[i].size = sh->sh_size;
29212919 sm_table[i].s = s;
29222920 /* concatenate sections */
29232921 size = sh->sh_size;
@@ -3006,7 +3004,7 @@ ST_FUNC int tcc_load_object_file(TCCState *s1, · 82 unmodified lines
30063004 continue;
30073005 sh = &shdr[i];
30083006 offset = sm_table[i].offset;
3009− size = sm_table[i].size;
3007+ size = sh->sh_size;
30103008 switch(s->sh_type) {
30113009 case SHT_RELX:
30123010 /* 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