binutils/binutils.patch

changeset 68
49e9fb8edd05
child 69
84180bd0cb45
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/binutils/binutils.patch	Mon Jan 12 14:38:36 2009 +0100
     1.3 @@ -0,0 +1,177 @@
     1.4 +Use the platform specific ELF branding expected under FreeBSD.
     1.5 +This is similar to what the vendor ld(1) does on this platform.
     1.6 +
     1.7 +Additionally, recognize and ignore Solaris 10's "Solaris Cryptographic
     1.8 +Framework" ELF header type "SUNW_signature", Solaris 10 "Symbol
     1.9 +information" ELF header type "SUNW_syminfo" and Solaris 10 "DTrace
    1.10 +Object Format" ELF header type. Also, fix the path to the dynamic
    1.11 +linker under Solaris 10/amd64.
    1.12 +
    1.13 +Index: include/elf/common.h
    1.14 +--- include/elf/common.h.orig	2007-08-28 19:19:40 +0200
    1.15 ++++ include/elf/common.h	2007-08-29 09:30:04 +0200
    1.16 +@@ -353,6 +353,9 @@
    1.17 + #define SHT_SUNW_verdef	0x6ffffffd	/* Versions defined by file */
    1.18 + #define SHT_SUNW_verneed 0x6ffffffe	/* Versions needed by file */
    1.19 + #define SHT_SUNW_versym	0x6fffffff	/* Symbol versions */
    1.20 ++#define SHT_SUNW_syminfo 0x6ffffffc	/* Symbol information */
    1.21 ++#define SHT_SUNW_signature 0x6ffffff6	/* Solaris Cryptographic Framework: Digital Signature */
    1.22 ++#define SHT_SUNW_dof 0x6ffffff4	/* Solaris DTrace Object Format */
    1.23 + 
    1.24 + #define SHT_GNU_verdef	SHT_SUNW_verdef
    1.25 + #define SHT_GNU_verneed	SHT_SUNW_verneed
    1.26 +Index: bfd/elf.c
    1.27 +--- bfd/elf.c.orig	2007-08-28 19:19:33 +0200
    1.28 ++++ bfd/elf.c	2007-08-29 09:30:04 +0200
    1.29 +@@ -1793,6 +1793,11 @@
    1.30 +       elf_tdata (abfd)->dynverref_hdr = *hdr;
    1.31 +       return _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex);
    1.32 + 
    1.33 ++    case SHT_SUNW_syminfo:
    1.34 ++    /* case SHT_SUNW_signature: conflicts with new SHT_GNU_HASH in Binutils 2.18 */
    1.35 ++    case SHT_SUNW_dof:
    1.36 ++      return TRUE;
    1.37 ++
    1.38 +     case SHT_SHLIB:
    1.39 +       return TRUE;
    1.40 + 
    1.41 +@@ -4682,6 +4687,12 @@
    1.42 +   else
    1.43 +     i_ehdrp->e_type = ET_REL;
    1.44 + 
    1.45 ++  /* OpenPKG platform branding BEGIN */
    1.46 ++#if defined(OPENPKG_OS_FREEBSD)
    1.47 ++  i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_FREEBSD;
    1.48 ++#endif
    1.49 ++  /* OpenPKG platform branding END */
    1.50 ++
    1.51 +   switch (bfd_get_arch (abfd))
    1.52 +     {
    1.53 +     case bfd_arch_unknown:
    1.54 +Index: bfd/elf64-x86-64.c
    1.55 +--- bfd/elf64-x86-64.c.orig	2007-08-06 21:59:33 +0200
    1.56 ++++ bfd/elf64-x86-64.c	2007-08-29 09:30:04 +0200
    1.57 +@@ -345,7 +345,11 @@
    1.58 + /* The name of the dynamic interpreter.	 This is put in the .interp
    1.59 +    section.  */
    1.60 + 
    1.61 ++#if defined(OPENPKG_OS_SOLARIS)
    1.62 ++#define ELF_DYNAMIC_INTERPRETER "/lib/amd64/ld.so.1"
    1.63 ++#else
    1.64 + #define ELF_DYNAMIC_INTERPRETER "/lib/ld64.so.1"
    1.65 ++#endif
    1.66 + 
    1.67 + /* If ELIMINATE_COPY_RELOCS is non-zero, the linker will try to avoid
    1.68 +    copying dynamic variables from a shared lib into an app's dynbss
    1.69 +
    1.70 +-----------------------------------------------------------------------------
    1.71 +
    1.72 +Support FreeBSD >= 4.10 by fixing platform detection.
    1.73 +
    1.74 +Index: bfd/configure
    1.75 +--- bfd/configure.orig	2007-08-28 22:19:51 +0200
    1.76 ++++ bfd/configure	2007-08-29 09:30:04 +0200
    1.77 +@@ -17459,6 +17459,10 @@
    1.78 +   i[3-7]86-*-bsdi)
    1.79 + 	COREFILE=
    1.80 + 	;;
    1.81 ++  i[3456]86-*-freebsd4.1[0-9]*)
    1.82 ++	COREFILE=''
    1.83 ++	TRAD_HEADER='"hosts/i386bsd.h"'
    1.84 ++	;;
    1.85 +   i[3-7]86-*-bsd* | i[3-7]86-*-freebsd[123] | i[3-7]86-*-freebsd[123]\.* | i[3-7]86-*-freebsd4\.[01234] | i[3-7]86-*-freebsd4\.[01234]\.* | i[3-7]86-*-freebsd*aout*)
    1.86 + 	COREFILE=trad-core.lo
    1.87 + 	TRAD_HEADER='"hosts/i386bsd.h"'
    1.88 +
    1.89 +-----------------------------------------------------------------------------
    1.90 +
    1.91 +Fight problems with --disable-nls under Solaris
    1.92 +
    1.93 +Index: gas/asintl.h
    1.94 +--- gas/asintl.h.orig	2007-08-06 21:59:49 +0200
    1.95 ++++ gas/asintl.h	2007-08-29 09:30:04 +0200
    1.96 +@@ -20,6 +20,11 @@
    1.97 +    Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
    1.98 +    02110-1301, USA.  */
    1.99 + 
   1.100 ++#ifndef ENABLE_NLS
   1.101 ++# define _LIBINTL_H
   1.102 ++# define _LIBGETTEXT_H
   1.103 ++#endif
   1.104 ++
   1.105 + #ifdef HAVE_LOCALE_H
   1.106 + # ifndef ENABLE_NLS
   1.107 +    /* The Solaris version of locale.h always includes libintl.h.  If we have
   1.108 +Index: ld/ld.h
   1.109 +--- ld/ld.h.orig	2007-08-06 22:00:19 +0200
   1.110 ++++ ld/ld.h	2007-08-29 09:30:04 +0200
   1.111 +@@ -23,6 +23,11 @@
   1.112 + #ifndef LD_H
   1.113 + #define LD_H
   1.114 + 
   1.115 ++#ifndef ENABLE_NLS
   1.116 ++# define _LIBINTL_H
   1.117 ++# define _LIBGETTEXT_H
   1.118 ++#endif
   1.119 ++
   1.120 + #ifdef HAVE_LOCALE_H
   1.121 + #endif
   1.122 + #ifndef SEEK_CUR
   1.123 +Index: ld/Makefile.in
   1.124 +--- ld/Makefile.in.orig	2007-08-06 22:29:54 +0200
   1.125 ++++ ld/Makefile.in	2007-08-29 09:30:04 +0200
   1.126 +@@ -287,7 +287,7 @@
   1.127 + # We put the scripts in the directory $(scriptdir)/ldscripts.
   1.128 + # We can't put the scripts in $(datadir) because the SEARCH_DIR
   1.129 + # directives need to be different for native and cross linkers.
   1.130 +-scriptdir = $(tooldir)/lib
   1.131 ++scriptdir = $(libdir)
   1.132 + BASEDIR = $(srcdir)/..
   1.133 + BFDDIR = $(BASEDIR)/bfd
   1.134 + INCDIR = $(BASEDIR)/include
   1.135 +
   1.136 +-----------------------------------------------------------------------------
   1.137 +
   1.138 +workaround problems under Mac OS X.
   1.139 +
   1.140 +Index: libiberty/fibheap.c
   1.141 +--- libiberty/fibheap.c.orig	2005-05-10 17:33:33 +0200
   1.142 ++++ libiberty/fibheap.c	2007-08-29 09:30:04 +0200
   1.143 +@@ -34,8 +34,11 @@
   1.144 + #include "libiberty.h"
   1.145 + #include "fibheap.h"
   1.146 + 
   1.147 +-
   1.148 ++#ifdef LONG_MIN
   1.149 + #define FIBHEAPKEY_MIN	LONG_MIN
   1.150 ++#else
   1.151 ++#define FIBHEAPKEY_MIN	(-0x7fffffffL - 1)
   1.152 ++#endif
   1.153 + 
   1.154 + static void fibheap_ins_root (fibheap_t, fibnode_t);
   1.155 + static void fibheap_rem_root (fibheap_t, fibnode_t);
   1.156 +
   1.157 +-----------------------------------------------------------------------------
   1.158 +
   1.159 +Disable the "error" about "eh_frame_hdr" as it is actually more a
   1.160 +warning (the linking is *not* aborted) and it occurs at least under
   1.161 +FreeBSD-7.0/amd64 regularily without doing any obvious harm. Seems
   1.162 +like the issue itself exists since a longer time, but in recent GNU
   1.163 +binutils this additional message was introduced. As we cannot observe
   1.164 +any problems and this message really confused, just disable it for now.
   1.165 +
   1.166 +Index: bfd/elf-eh-frame.c
   1.167 +--- bfd/elf-eh-frame.c.orig	2007-08-06 21:59:22 +0200
   1.168 ++++ bfd/elf-eh-frame.c	2007-11-11 15:46:44 +0100
   1.169 +@@ -970,9 +970,11 @@
   1.170 +   return offset != sec->rawsize;
   1.171 + 
   1.172 + free_no_table:
   1.173 ++#if 0
   1.174 +   (*info->callbacks->einfo)
   1.175 +     (_("%P: error in %B(%A); no .eh_frame_hdr table will be created.\n"),
   1.176 +      abfd, sec);
   1.177 ++#endif
   1.178 +   if (ehbuf)
   1.179 +     free (ehbuf);
   1.180 +   if (sec_info)

mercurial