binutils-2.18: add a stolen from head patch that fixes building of u-boot on powerpc
authorDmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Fri, 17 Jul 2009 10:18:10 +0000 (14:18 +0400)
committerDmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Fri, 17 Jul 2009 10:18:10 +0000 (14:18 +0400)
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
recipes/binutils/binutils-2.18/binutils-section-in-segment.patch [new file with mode: 0644]
recipes/binutils/binutils_2.18.bb

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 (file)
index 0000000..7e95b0a
--- /dev/null
@@ -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--
+
index 8721464..159d97f 100644 (file)
@@ -1,4 +1,4 @@
-INC_PR = "r6"
+INC_PR = "r7"
 PR = "${INC_PR}.1"
 
 require binutils.inc
@@ -15,6 +15,7 @@ SRC_URI = "\
      file://binutils-uclibc-300-012_check_ldrunpath_length.patch;patch=1 \
      file://binutils-uclibc-gas-needs-libm.patch;patch=1 \
      file://binutils-x86_64_i386_biarch.patch;patch=1 \
+     file://binutils-section-in-segment.patch;patch=1;pnum=0 \
      "
 
 # powerpc patches