Ignore:
Timestamp:
Dec 30, 2008, 4:46:44 PM (15 years ago)
Author:
Jim Gifford <clfs@…>
Branches:
clfs-1.2, clfs-2.1, clfs-3.0.0-systemd, clfs-3.0.0-sysvinit, master, systemd, sysvinit
Children:
1d2997a1
Parents:
893ca261
Message:

Update Binutils to -2 Patch

File:
1 moved

Legend:

Unmodified
Added
Removed
  • patches/binutils-2.19-branch_update-2.patch

    r893ca261 rafebdc9  
    11Submitted By: Jim Gifford (jim at linuxfromscratch dot org)
    2 Date: 12-21-2008
     2Date: 12-30-2008
    33Initial Package Version: 2.19
    44Origin: Upstream
     
    99diff -Naur binutils-2.19.orig/bfd/ChangeLog binutils-2.19/bfd/ChangeLog
    1010--- binutils-2.19.orig/bfd/ChangeLog    2008-10-16 06:20:48.000000000 -0700
    11 +++ binutils-2.19/bfd/ChangeLog 2008-11-20 03:50:22.000000000 -0800
    12 @@ -1,3 +1,22 @@
     11+++ binutils-2.19/bfd/ChangeLog 2008-12-23 02:06:46.000000000 -0800
     12@@ -1,3 +1,31 @@
     13+2008-12-23  Nick Clifton  <nickc@redhat.com>
     14+
     15+       * Import this patch from the mainline:
     16+       2008-11-10  Andreas Schwab  <schwab@suse.de>
     17+
     18+       PR 7011
     19+       * elf.c (assign_file_positions_for_non_load_sections): Handle
     20+       PT_GNU_RELRO specially.
     21+
    1322+2008-11-20  Alan Modra  <amodra@bigpond.net.au>
    1423+
     
    3544diff -Naur binutils-2.19.orig/bfd/Makefile.in binutils-2.19/bfd/Makefile.in
    3645--- binutils-2.19.orig/bfd/Makefile.in  2008-10-16 06:20:48.000000000 -0700
    37 +++ binutils-2.19/bfd/Makefile.in       2008-12-21 01:24:46.000000000 -0800
     46+++ binutils-2.19/bfd/Makefile.in       2008-12-30 16:34:28.000000000 -0800
    3847@@ -271,7 +271,7 @@
    3948 ACLOCAL_AMFLAGS = -I . -I .. -I ../config
     
    6978 dnl These must be called before LT_INIT, because it may want
    7079 dnl to call AC_CHECK_PROG.
     80diff -Naur binutils-2.19.orig/bfd/elf.c binutils-2.19/bfd/elf.c
     81--- binutils-2.19.orig/bfd/elf.c        2008-10-09 05:18:23.000000000 -0700
     82+++ binutils-2.19/bfd/elf.c     2008-12-23 02:06:46.000000000 -0800
     83@@ -4606,7 +4606,61 @@
     84        m != NULL;
     85        m = m->next, p++)
     86     {
     87-      if (m->count != 0)
     88+      if (p->p_type == PT_GNU_RELRO)
     89+       {
     90+         const Elf_Internal_Phdr *lp;
     91+
     92+         BFD_ASSERT (!m->includes_filehdr && !m->includes_phdrs);
     93+
     94+         if (link_info != NULL)
     95+           {
     96+             /* During linking the range of the RELRO segment is passed
     97+                in link_info.  */
     98+             for (lp = phdrs; lp < phdrs + count; ++lp)
     99+               {
     100+                 if (lp->p_type == PT_LOAD
     101+                     && lp->p_vaddr >= link_info->relro_start
     102+                     && lp->p_vaddr < link_info->relro_end
     103+                     && lp->p_vaddr + lp->p_filesz >= link_info->relro_end)
     104+                   break;
     105+               }
     106+           }
     107+         else
     108+           {
     109+             /* Otherwise we are copying an executable or shared
     110+                library, but we need to use the same linker logic.  */
     111+             for (lp = phdrs; lp < phdrs + count; ++lp)
     112+               {
     113+                 if (lp->p_type == PT_LOAD
     114+                     && lp->p_paddr == p->p_paddr)
     115+                   break;
     116+               }
     117+           }
     118+
     119+         if (lp < phdrs + count)
     120+           {
     121+             p->p_vaddr = lp->p_vaddr;
     122+             p->p_paddr = lp->p_paddr;
     123+             p->p_offset = lp->p_offset;
     124+             if (link_info != NULL)
     125+               p->p_filesz = link_info->relro_end - lp->p_vaddr;
     126+             else if (m->p_size_valid)
     127+               p->p_filesz = m->p_size;
     128+             else
     129+               abort ();
     130+             p->p_memsz = p->p_filesz;
     131+             p->p_align = 1;
     132+             p->p_flags = (lp->p_flags & ~PF_W);
     133+           }
     134+         else if (link_info != NULL)
     135+           {
     136+             memset (p, 0, sizeof *p);
     137+             p->p_type = PT_NULL;
     138+           }
     139+         else
     140+           abort ();
     141+       }
     142+      else if (m->count != 0)
     143        {
     144          if (p->p_type != PT_LOAD
     145              && (p->p_type != PT_NOTE
     146@@ -4622,87 +4676,20 @@
     147              p->p_filesz = sect->filepos - m->sections[0]->filepos;
     148              if (hdr->sh_type != SHT_NOBITS)
     149                p->p_filesz += hdr->sh_size;
     150-
     151-             if (p->p_type == PT_GNU_RELRO)
     152-               {
     153-                 /* When we get here, we are copying executable
     154-                    or shared library. But we need to use the same
     155-                    linker logic.  */
     156-                 Elf_Internal_Phdr *lp;
     157-
     158-                 for (lp = phdrs; lp < phdrs + count; ++lp)
     159-                   {
     160-                     if (lp->p_type == PT_LOAD
     161-                         && lp->p_paddr == p->p_paddr)
     162-                       break;
     163-                   }
     164-         
     165-                 if (lp < phdrs + count)
     166-                   {
     167-                     /* We should use p_size if it is valid since it
     168-                        may contain the first few bytes of the next
     169-                        SEC_ALLOC section.  */
     170-                     if (m->p_size_valid)
     171-                       p->p_filesz = m->p_size;
     172-                     else
     173-                       abort ();
     174-                     p->p_vaddr = lp->p_vaddr;
     175-                     p->p_offset = lp->p_offset;
     176-                     p->p_memsz = p->p_filesz;
     177-                     p->p_align = 1;
     178-                   }
     179-                 else
     180-                   abort ();
     181-               }
     182-             else
     183-               p->p_offset = m->sections[0]->filepos;
     184+             p->p_offset = m->sections[0]->filepos;
     185            }
     186        }
     187-      else
     188+      else if (m->includes_filehdr)
     189        {
     190-         if (m->includes_filehdr)
     191-           {
     192-             p->p_vaddr = filehdr_vaddr;
     193-             if (! m->p_paddr_valid)
     194-               p->p_paddr = filehdr_paddr;
     195-           }
     196-         else if (m->includes_phdrs)
     197-           {
     198-             p->p_vaddr = phdrs_vaddr;
     199-             if (! m->p_paddr_valid)
     200-               p->p_paddr = phdrs_paddr;
     201-           }
     202-         else if (p->p_type == PT_GNU_RELRO)
     203-           {
     204-             Elf_Internal_Phdr *lp;
     205-
     206-             for (lp = phdrs; lp < phdrs + count; ++lp)
     207-               {
     208-                 if (lp->p_type == PT_LOAD
     209-                     && lp->p_vaddr <= link_info->relro_end
     210-                     && lp->p_vaddr >= link_info->relro_start
     211-                     && (lp->p_vaddr + lp->p_filesz
     212-                         >= link_info->relro_end))
     213-                   break;
     214-               }
     215-
     216-             if (lp < phdrs + count
     217-                 && link_info->relro_end > lp->p_vaddr)
     218-               {
     219-                 p->p_vaddr = lp->p_vaddr;
     220-                 p->p_paddr = lp->p_paddr;
     221-                 p->p_offset = lp->p_offset;
     222-                 p->p_filesz = link_info->relro_end - lp->p_vaddr;
     223-                 p->p_memsz = p->p_filesz;
     224-                 p->p_align = 1;
     225-                 p->p_flags = (lp->p_flags & ~PF_W);
     226-               }
     227-             else
     228-               {
     229-                 memset (p, 0, sizeof *p);
     230-                 p->p_type = PT_NULL;
     231-               }
     232-           }
     233+         p->p_vaddr = filehdr_vaddr;
     234+         if (! m->p_paddr_valid)
     235+           p->p_paddr = filehdr_paddr;
     236+       }
     237+      else if (m->includes_phdrs)
     238+       {
     239+         p->p_vaddr = phdrs_vaddr;
     240+         if (! m->p_paddr_valid)
     241+           p->p_paddr = phdrs_paddr;
     242        }
     243     }
     244 
    71245diff -Naur binutils-2.19.orig/bfd/elf32-avr.c binutils-2.19/bfd/elf32-avr.c
    72246--- binutils-2.19.orig/bfd/elf32-avr.c  2008-08-08 22:35:12.000000000 -0700
     
    230404diff -Naur binutils-2.19.orig/bfd/version.h binutils-2.19/bfd/version.h
    231405--- binutils-2.19.orig/bfd/version.h    2008-10-16 05:51:57.000000000 -0700
    232 +++ binutils-2.19/bfd/version.h 2008-12-19 16:00:10.000000000 -0800
     406+++ binutils-2.19/bfd/version.h 2008-12-30 16:00:14.000000000 -0800
    233407@@ -1,4 +1,4 @@
    234408-#define BFD_VERSION_DATE 20081016
    235 +#define BFD_VERSION_DATE 20081220
     409+#define BFD_VERSION_DATE 20081231
    236410 #define BFD_VERSION @bfd_version@
    237411 #define BFD_VERSION_STRING  @bfd_version_package@ @bfd_version_string@
     
    239413diff -Naur binutils-2.19.orig/binutils/ChangeLog binutils-2.19/binutils/ChangeLog
    240414--- binutils-2.19.orig/binutils/ChangeLog       2008-10-02 01:07:16.000000000 -0700
    241 +++ binutils-2.19/binutils/ChangeLog    2008-12-01 02:05:34.000000000 -0800
    242 @@ -1,3 +1,11 @@
     415+++ binutils-2.19/binutils/ChangeLog    2008-12-23 03:49:58.000000000 -0800
     416@@ -1,3 +1,16 @@
     417+2008-12-23  Nick Clifton  <nickc@redhat.com>
     418+
     419+       * windmc.c (main): Use correct type for file length.
     420+       * dlltool.c (gen_exp_file): Likewise.
     421+
    243422+2008-12-01  Nick Clifton  <nickc@redhat.com>
    244423+
     
    254433diff -Naur binutils-2.19.orig/binutils/dlltool.c binutils-2.19/binutils/dlltool.c
    255434--- binutils-2.19.orig/binutils/dlltool.c       2008-07-29 21:34:56.000000000 -0700
    256 +++ binutils-2.19/binutils/dlltool.c    2008-12-01 02:05:34.000000000 -0800
     435+++ binutils-2.19/binutils/dlltool.c    2008-12-23 03:49:58.000000000 -0800
    257436@@ -1206,7 +1206,7 @@
    258437 
     
    264443       fatal (errmsg_fmt, errmsg_arg);
    265444     }
     445@@ -1980,7 +1980,7 @@
     446       int addr;
     447       long need[PAGE_SIZE];
     448       long page_addr;
     449-      int numbytes;
     450+      bfd_size_type numbytes;
     451       int num_entries;
     452       long *copy;
     453       int j;
    266454@@ -1992,10 +1992,10 @@
    267455       numbytes = ftell (base_file);
     
    279467diff -Naur binutils-2.19.orig/binutils/windmc.c binutils-2.19/binutils/windmc.c
    280468--- binutils-2.19.orig/binutils/windmc.c        2008-07-29 21:34:56.000000000 -0700
    281 +++ binutils-2.19/binutils/windmc.c     2008-12-01 02:05:34.000000000 -0800
     469+++ binutils-2.19/binutils/windmc.c     2008-12-23 03:49:58.000000000 -0800
     470@@ -1144,7 +1144,7 @@
     471     unichar *u;
     472     rc_uint_type ul;
     473     char *buff;
     474-    long flen;
     475+    bfd_size_type flen;
     476     FILE *fp = fopen (input_filename, "rb");
     477 
     478     if (!fp)
    282479@@ -1155,7 +1155,8 @@
    283480     fseek (fp, 0, SEEK_SET);
     
    304501diff -Naur binutils-2.19.orig/ld/ChangeLog binutils-2.19/ld/ChangeLog
    305502--- binutils-2.19.orig/ld/ChangeLog     2008-10-09 05:18:31.000000000 -0700
    306 +++ binutils-2.19/ld/ChangeLog  2008-11-13 22:55:50.000000000 -0800
    307 @@ -1,3 +1,8 @@
     503+++ binutils-2.19/ld/ChangeLog  2008-12-23 05:56:10.000000000 -0800
     504@@ -1,3 +1,13 @@
     505+2008-12-23  Tristan Gingold  <gingold@adacore.com>
     506+
     507+       * Makefile.am (EXTRA_DIST): Add deffilep.c and deffilep.h
     508+       * Makefile.in: Regenerate.
     509+
    308510+2008-11-14  Alan Modra  <amodra@bigpond.net.au>
    309511+
     
    316518diff -Naur binutils-2.19.orig/ld/Makefile.am binutils-2.19/ld/Makefile.am
    317519--- binutils-2.19.orig/ld/Makefile.am   2008-09-09 01:02:19.000000000 -0700
    318 +++ binutils-2.19/ld/Makefile.am        2008-11-13 22:55:50.000000000 -0800
     520+++ binutils-2.19/ld/Makefile.am        2008-12-23 05:56:10.000000000 -0800
    319521@@ -758,9 +758,9 @@
    320522 $(srcdir)/emultempl/spu_ovl.o_c: @MAINT@ $(srcdir)/emultempl/spu_ovl.S
     
    329531 eelf32_i860.c: $(srcdir)/emulparams/elf32_i860.sh \
    330532   $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
     533@@ -1914,7 +1914,8 @@
     534 
     535 # Stuff that should be included in a distribution.  The diststuff
     536 # target is run by the taz target in ../Makefile.in.
     537-EXTRA_DIST = ldgram.c ldgram.h ldlex.c emultempl/spu_ovl.o_c $(man_MANS)
     538+EXTRA_DIST = ldgram.c ldgram.h ldlex.c emultempl/spu_ovl.o_c \
     539+           deffilep.c deffilep.h $(man_MANS)
     540 diststuff: info $(EXTRA_DIST)
     541 all: info ld.1
     542 
    331543diff -Naur binutils-2.19.orig/ld/Makefile.in binutils-2.19/ld/Makefile.in
    332544--- binutils-2.19.orig/ld/Makefile.in   2008-09-09 01:02:19.000000000 -0700
    333 +++ binutils-2.19/ld/Makefile.in        2008-11-13 22:55:50.000000000 -0800
    334 @@ -1588,9 +1588,9 @@
     545+++ binutils-2.19/ld/Makefile.in        2008-12-23 05:56:10.000000000 -0800
     546@@ -730,7 +730,9 @@
     547 
     548 # Stuff that should be included in a distribution.  The diststuff
     549 # target is run by the taz target in ../Makefile.in.
     550-EXTRA_DIST = ldgram.c ldgram.h ldlex.c emultempl/spu_ovl.o_c $(man_MANS)
     551+EXTRA_DIST = ldgram.c ldgram.h ldlex.c emultempl/spu_ovl.o_c \
     552+           deffilep.c deffilep.h $(man_MANS)
     553+
     554 DISTCLEANFILES = tdirs site.exp site.bak stringify.sed $(am__append_1)
     555 all: config.h
     556        $(MAKE) $(AM_MAKEFLAGS) all-recursive
     557@@ -1588,9 +1590,9 @@
    335558 $(srcdir)/emultempl/spu_ovl.o_c: @MAINT@ $(srcdir)/emultempl/spu_ovl.S
    336559        if ../gas/as-new --version \
Note: See TracChangeset for help on using the changeset viewer.