History

Revert "Fix relocs of unwanted sections"

This reverts commit fef838db2d124db3f1357385972371ccba7af2c6, should not be necessary anymore.

Michael Matz committed 7 years ago

Commit 7ed2d151 parent eaf5f3f1 file · +3 −11Browse files

Unified · Split

tccelf.c+3−11
@@ -2270,7 +2270,6 @@ static void *load_data(int fd, unsigned long file_offset, unsigned long size) · 2269 unmodified lines
22702270 typedef struct SectionMergeInfo {
22712271 Section *s; /* corresponding existing section */
22722272 unsigned long offset; /* offset of the new section in the existing section */
2273− unsigned long oldlen; /* size of existing section before adding this one */
22742273 uint8_t new_section; /* true if section 's' was added */
22752274 uint8_t link_once; /* true if link once section */
22762275 } SectionMergeInfo;
@@ -2421,7 +2420,6 @@ ST_FUNC int tcc_load_object_file(TCCState *s1, · 144 unmodified lines
24212420 }
24222421
24232422 /* align start of section */
2424− sm_table[i].oldlen = s->data_offset;
24252423 offset = s->data_offset;
24262424
24272425 if (0 == strcmp(sh_name, ".stab")) {
@@ -2479,15 +2477,9 @@ ST_FUNC int tcc_load_object_file(TCCState *s1, · 51 unmodified lines
24792477 if (sh->sh_link > 0)
24802478 s->link = sm_table[sh->sh_link].s;
24812479 if (sh->sh_type == SHT_RELX) {
2482− if (sm_table[sh->sh_info].s) {
2483− s->sh_info = sm_table[sh->sh_info].s->sh_num;
2484− /* update backward link */
2485− s1->sections[s->sh_info]->reloc = s;
2486− } else {
2487− /* we haven't read the target of relocs, so cancel them */
2488− s->data_offset = sm_table[i].oldlen;
2489− sm_table[i].s = NULL;
2490− }
2480+ s->sh_info = sm_table[sh->sh_info].s->sh_num;
2481+ /* update backward link */
2482+ s1->sections[s->sh_info]->reloc = s;
24912483 }
24922484 }
24932485 sm = sm_table;

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