aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/unexelf.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/unexelf.c b/src/unexelf.c
index 0277f5767ab..5ce8050dcc8 100644
--- a/src/unexelf.c
+++ b/src/unexelf.c
@@ -719,11 +719,19 @@ unexec (new_name, old_name, data_start, bss_start, entry_address)
719 NEW_SECTION_H (nn).sh_addralign = OLD_SECTION_H (nn).sh_addralign; 719 NEW_SECTION_H (nn).sh_addralign = OLD_SECTION_H (nn).sh_addralign;
720 NEW_SECTION_H (nn).sh_size = 0; 720 NEW_SECTION_H (nn).sh_size = 0;
721 } 721 }
722 /* Any section that was original placed AFTER the bss section should now 722 else
723 be off by NEW_DATA2_SIZE. */ 723 {
724 else if (NEW_SECTION_H (nn).sh_offset >= new_data2_offset) 724 /* Any section that was original placed AFTER the bss
725 NEW_SECTION_H (nn).sh_offset += new_data2_size; 725 section should now be off by NEW_DATA2_SIZE. */
726 726 if (NEW_SECTION_H (nn).sh_offset >= new_data2_offset)
727 NEW_SECTION_H (nn).sh_offset += new_data2_size;
728 /* Any section that was originally placed after the section
729 header table should now be off by the size of one section
730 header table entry. */
731 if (NEW_SECTION_H (nn).sh_offset > new_file_h->e_shoff)
732 NEW_SECTION_H (nn).sh_offset += new_file_h->e_shentsize;
733 }
734
727 /* If any section hdr refers to the section after the new .data 735 /* If any section hdr refers to the section after the new .data
728 section, make it refer to next one because we have inserted 736 section, make it refer to next one because we have inserted
729 a new section in between. */ 737 a new section in between. */