• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


Commit MetaInfo

Revision9acd786df49d30f422f4fa6d747c5ea5aec6c31b (tree)
Zeit2015-04-21 04:57:30
AutorH.J. Lu <hjl.tools@gmai...>
CommiterH.J. Lu

Log Message

Place .shstrtab before debug sections

Ändern Zusammenfassung

Diff

--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -5616,7 +5616,7 @@ static bfd_boolean
56165616 _bfd_elf_assign_file_positions_for_non_load (bfd *abfd)
56175617 {
56185618 file_ptr off;
5619- Elf_Internal_Shdr **shdrpp, **end_shdrpp;
5619+ Elf_Internal_Shdr **shdrpp, **end_shdrpp, **debug_shdrpp = NULL;
56205620 Elf_Internal_Shdr *shdrp;
56215621 Elf_Internal_Ehdr *i_ehdrp;
56225622 const struct elf_backend_data *bed;
@@ -5677,14 +5677,18 @@ _bfd_elf_assign_file_positions_for_non_load (bfd *abfd)
56775677 name, FALSE))
56785678 return FALSE;
56795679
5680+ if (debug_shdrpp == NULL)
5681+ debug_shdrpp = shdrpp;
5682+
56805683 /* Update section size and contents. */
56815684 shdrp->sh_size = sec->size;
56825685 shdrp->contents = sec->contents;
56835686 shdrp->bfd_section->contents = NULL;
56845687 }
5685- off = _bfd_elf_assign_file_position_for_section (shdrp,
5686- off,
5687- TRUE);
5688+ else
5689+ off = _bfd_elf_assign_file_position_for_section (shdrp,
5690+ off,
5691+ TRUE);
56885692 }
56895693 }
56905694 }
@@ -5696,6 +5700,15 @@ _bfd_elf_assign_file_positions_for_non_load (bfd *abfd)
56965700 shdrp->sh_size = _bfd_elf_strtab_size (elf_shstrtab (abfd));
56975701 off = _bfd_elf_assign_file_position_for_section (shdrp, off, TRUE);
56985702
5703+ /* Place DWARF debug sections after section name section. */
5704+ if (debug_shdrpp)
5705+ for (shdrpp = debug_shdrpp; shdrpp < end_shdrpp; shdrpp++)
5706+ {
5707+ shdrp = *shdrpp;
5708+ if (shdrp->sh_offset == -1)
5709+ off = _bfd_elf_assign_file_position_for_section (shdrp, off, TRUE);
5710+ }
5711+
56995712 /* Place the section headers. */
57005713 i_ehdrp = elf_elfheader (abfd);
57015714 bed = get_elf_backend_data (abfd);