diff options
Diffstat (limited to 'recipes/binutils/binutils-2.18/binutils-section-in-segment.patch')
-rw-r--r-- | recipes/binutils/binutils-2.18/binutils-section-in-segment.patch | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/recipes/binutils/binutils-2.18/binutils-section-in-segment.patch b/recipes/binutils/binutils-2.18/binutils-section-in-segment.patch new file mode 100644 index 0000000000..7e95b0a6dd --- /dev/null +++ b/recipes/binutils/binutils-2.18/binutils-section-in-segment.patch @@ -0,0 +1,30 @@ +2007-11-28 Nathan Sidwell <nathan@codesourcery.com> + + Issue #2297 + include/elf/ + * internal.h (ELF_IS_SECTION_IN_SEGMENT): Adjust to cope with + segments at the end of memory. + +Index: include/elf/internal.h +=================================================================== +--- include/elf/internal.h (revision 187336) ++++ include/elf/internal.h (working copy) +@@ -280,11 +280,12 @@ struct elf_segment_map + || ((bfd_vma) sec_hdr->sh_offset >= segment->p_offset \ + && (sec_hdr->sh_offset + ELF_SECTION_SIZE(sec_hdr, segment) \ + <= segment->p_offset + segment->p_filesz))) \ +- /* SHF_ALLOC sections must have VMAs within the segment. */ \ ++ /* SHF_ALLOC sections must have VMAs within the segment. Be \ ++ careful about segments right at the end of memory. */ \ + && ((sec_hdr->sh_flags & SHF_ALLOC) == 0 \ + || (sec_hdr->sh_addr >= segment->p_vaddr \ +- && (sec_hdr->sh_addr + ELF_SECTION_SIZE(sec_hdr, segment) \ +- <= segment->p_vaddr + segment->p_memsz)))) ++ && (sec_hdr->sh_addr - segment->p_vaddr \ ++ + ELF_SECTION_SIZE(sec_hdr, segment) <= segment->p_memsz)))) + + /* Decide if the given sec_hdr is in the given segment in file. */ + #define ELF_IS_SECTION_IN_SEGMENT_FILE(sec_hdr, segment) \ + +--------------040206010003050401040204-- + |