head 1.26;
access;
symbols
OPENPKG_E1_MP_HEAD:1.18
OPENPKG_E1_MP:1.18
OPENPKG_E1_MP_2_STABLE:1.17.2.1
OPENPKG_E1_FP:1.17.2.1
OPENPKG_2_STABLE_MP:1.18
OPENPKG_2_STABLE_20061018:1.17.2.1
OPENPKG_2_STABLE_20060622:1.17
OPENPKG_2_STABLE:1.17.0.2
OPENPKG_2_STABLE_BP:1.17
OPENPKG_2_5_RELEASE:1.15
OPENPKG_2_5_SOLID:1.15.0.2
OPENPKG_2_5_SOLID_BP:1.15
OPENPKG_2_4_RELEASE:1.13
OPENPKG_2_4_SOLID:1.13.0.2
OPENPKG_2_4_SOLID_BP:1.13
OPENPKG_CW_FP:1.12
OPENPKG_2_3_RELEASE:1.12
OPENPKG_2_3_SOLID:1.12.0.2
OPENPKG_2_3_SOLID_BP:1.12
OPENPKG_2_2_RELEASE:1.9
OPENPKG_2_2_SOLID:1.9.0.4
OPENPKG_2_2_SOLID_BP:1.9
OPENPKG_2_1_RELEASE:1.9
OPENPKG_2_1_SOLID:1.9.0.2
OPENPKG_2_1_SOLID_BP:1.9
OPENPKG_2_0_RELEASE:1.5
OPENPKG_2_0_SOLID:1.5.0.2
OPENPKG_2_0_SOLID_BP:1.5
OPENPKG_1_3_RELEASE:1.2.4.1
OPENPKG_1_3_SOLID:1.2.4.1.0.2
OPENPKG_1_3_SOLID_BP:1.2.4.1
OPENPKG_1_STABLE_MP:1.5
OPENPKG_1_2_RELEASE:1.2
OPENPKG_1_2_SOLID:1.2.0.6
OPENPKG_1_2_SOLID_BP:1.2
OPENPKG_1_STABLE:1.2.0.4
OPENPKG_1_STABLE_BP:1.2
OPENPKG_1_1_RELEASE:1.2
OPENPKG_1_1_SOLID:1.2.0.2
OPENPKG_1_1_SOLID_BP:1.2;
locks; strict;
comment @# @;
1.26
date 2009.10.16.16.47.45; author rse; state Exp;
branches;
next 1.25;
commitid UM2zNgxFrRwTqM7u;
1.25
date 2009.04.09.16.51.28; author rse; state Exp;
branches;
next 1.24;
commitid tn2ZJAgF8SGPymJt;
1.24
date 2009.02.03.07.31.51; author rse; state Exp;
branches;
next 1.23;
commitid iiIysjeDtW0oyXAt;
1.23
date 2008.10.16.20.41.07; author rse; state Exp;
branches;
next 1.22;
commitid KGUwCjs53JznsTmt;
1.22
date 2007.11.11.14.50.53; author rse; state Exp;
branches;
next 1.21;
commitid 3tQGJk6J2DXNraFs;
1.21
date 2007.08.29.07.54.37; author rse; state Exp;
branches;
next 1.20;
commitid Vwi81LBAETktwCvs;
1.20
date 2007.06.23.12.52.55; author rse; state Exp;
branches;
next 1.19;
commitid H0HZgCxwLXRkk2ns;
1.19
date 2007.06.06.09.17.53; author rse; state Exp;
branches;
next 1.18;
commitid 6kSPUFHOckarGPks;
1.18
date 2006.06.24.20.04.49; author rse; state Exp;
branches;
next 1.17;
commitid Ou9qdiEpks4VpiCr;
1.17
date 2006.05.29.13.10.22; author rse; state Exp;
branches
1.17.2.1;
next 1.16;
commitid N3HfF3tVP0UlXUyr;
1.16
date 2006.05.26.19.09.30; author rse; state Exp;
branches;
next 1.15;
commitid Ttg0iRVRlvxJ2zyr;
1.15
date 2005.09.21.19.29.45; author rse; state Exp;
branches
1.15.2.1;
next 1.14;
1.14
date 2005.09.13.19.47.25; author mk; state Exp;
branches;
next 1.13;
1.13
date 2005.05.03.17.59.39; author rse; state Exp;
branches
1.13.2.1;
next 1.12;
1.12
date 2005.02.02.09.55.42; author cs; state Exp;
branches;
next 1.11;
1.11
date 2005.01.07.17.38.36; author cs; state Exp;
branches;
next 1.10;
1.10
date 2004.11.25.10.55.25; author rse; state Exp;
branches;
next 1.9;
1.9
date 2004.05.29.07.22.12; author rse; state Exp;
branches;
next 1.8;
1.8
date 2004.05.18.07.19.29; author rse; state Exp;
branches;
next 1.7;
1.7
date 2004.05.06.09.37.31; author rse; state Exp;
branches;
next 1.6;
1.6
date 2004.04.30.20.04.53; author rse; state Exp;
branches;
next 1.5;
1.5
date 2003.06.20.10.10.40; author mlelstv; state Exp;
branches
1.5.2.1;
next 1.4;
1.4
date 2003.06.19.10.42.11; author mlelstv; state Exp;
branches;
next 1.3;
1.3
date 2003.06.16.15.47.53; author mlelstv; state Exp;
branches;
next 1.2;
1.2
date 2002.08.26.10.29.35; author rse; state Exp;
branches
1.2.4.1;
next 1.1;
1.1
date 2002.08.22.15.43.52; author rse; state Exp;
branches;
next ;
1.17.2.1
date 2006.10.16.14.48.30; author rse; state Exp;
branches;
next ;
commitid iZxwRSmmWscPXUQr;
1.15.2.1
date 2006.05.26.19.10.49; author rse; state Exp;
branches;
next ;
commitid aXNcSi2SIqwb3zyr;
1.13.2.1
date 2006.05.26.19.12.19; author rse; state Exp;
branches;
next ;
commitid ktzvYzpXG2TH3zyr;
1.5.2.1
date 2004.04.30.20.06.11; author rse; state Exp;
branches;
next ;
1.2.4.1
date 2003.07.24.20.41.50; author rse; state Exp;
branches;
next ;
desc
@@
1.26
log
@upgrading package: binutils 2.19.1 -> 2.20
@
text
@Use the platform specific ELF branding expected under FreeBSD.
This is similar to what the vendor ld(1) does on this platform.
Additionally, recognize and ignore Solaris 10's "Solaris Cryptographic
Framework" ELF header type "SUNW_signature", Solaris 10 "Symbol
information" ELF header type "SUNW_syminfo" and Solaris 10 "DTrace
Object Format" ELF header type. Also, fix the path to the dynamic
linker under Solaris 10/amd64.
Index: include/elf/common.h
--- include/elf/common.h.orig 2008-08-04 01:20:42 +0200
+++ include/elf/common.h 2009-02-03 08:15:09 +0100
@@@@ -404,6 +404,9 @@@@
#define SHT_SUNW_verdef 0x6ffffffd /* Versions defined by file */
#define SHT_SUNW_verneed 0x6ffffffe /* Versions needed by file */
#define SHT_SUNW_versym 0x6fffffff /* Symbol versions */
+#define SHT_SUNW_syminfo 0x6ffffffc /* Symbol information */
+#define SHT_SUNW_signature 0x6ffffff6 /* Solaris Cryptographic Framework: Digital Signature */
+#define SHT_SUNW_dof 0x6ffffff4 /* Solaris DTrace Object Format */
#define SHT_GNU_verdef SHT_SUNW_verdef
#define SHT_GNU_verneed SHT_SUNW_verneed
Index: bfd/elf.c
--- bfd/elf.c.orig 2008-12-23 14:54:48 +0100
+++ bfd/elf.c 2009-02-03 08:15:09 +0100
@@@@ -1859,6 +1859,11 @@@@
elf_tdata (abfd)->dynverref_hdr = *hdr;
return _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex);
+ case SHT_SUNW_syminfo:
+ /* case SHT_SUNW_signature: conflicts with new SHT_GNU_HASH in Binutils 2.18 */
+ case SHT_SUNW_dof:
+ return TRUE;
+
case SHT_SHLIB:
return TRUE;
@@@@ -4825,6 +4830,12 @@@@
else
i_ehdrp->e_type = ET_REL;
+ /* OpenPKG platform branding BEGIN */
+#if defined(OPENPKG_OS_FREEBSD)
+ i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_FREEBSD;
+#endif
+ /* OpenPKG platform branding END */
+
switch (bfd_get_arch (abfd))
{
case bfd_arch_unknown:
Index: bfd/elf64-x86-64.c
--- bfd/elf64-x86-64.c.orig 2008-07-28 20:07:05 +0200
+++ bfd/elf64-x86-64.c 2009-02-03 08:15:09 +0100
@@@@ -346,7 +346,11 @@@@
/* The name of the dynamic interpreter. This is put in the .interp
section. */
+#if defined(OPENPKG_OS_SOLARIS)
+#define ELF_DYNAMIC_INTERPRETER "/lib/amd64/ld.so.1"
+#else
#define ELF_DYNAMIC_INTERPRETER "/lib/ld64.so.1"
+#endif
/* If ELIMINATE_COPY_RELOCS is non-zero, the linker will try to avoid
copying dynamic variables from a shared lib into an app's dynbss
-----------------------------------------------------------------------------
Support FreeBSD >= 4.10 by fixing platform detection.
Index: bfd/configure
--- bfd/configure.orig 2009-02-02 11:44:37 +0100
+++ bfd/configure 2009-02-03 08:15:09 +0100
@@@@ -18061,6 +18061,10 @@@@
i[3-7]86-*-bsdi)
COREFILE=
;;
+ i[3456]86-*-freebsd4.1[0-9]*)
+ COREFILE=''
+ TRAD_HEADER='"hosts/i386bsd.h"'
+ ;;
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*)
COREFILE=trad-core.lo
TRAD_HEADER='"hosts/i386bsd.h"'
-----------------------------------------------------------------------------
Fight problems with --disable-nls under Solaris
Index: gas/asintl.h
--- gas/asintl.h.orig 2007-07-03 13:01:02 +0200
+++ gas/asintl.h 2009-02-03 08:15:09 +0100
@@@@ -20,6 +20,11 @@@@
Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
02110-1301, USA. */
+#ifndef ENABLE_NLS
+# define _LIBINTL_H
+# define _LIBGETTEXT_H
+#endif
+
#ifdef HAVE_LOCALE_H
# ifndef ENABLE_NLS
/* The Solaris version of locale.h always includes libintl.h. If we have
Index: ld/ld.h
--- ld/ld.h.orig 2008-05-31 18:35:56 +0200
+++ ld/ld.h 2009-02-03 08:15:09 +0100
@@@@ -23,6 +23,11 @@@@
#ifndef LD_H
#define LD_H
+#ifndef ENABLE_NLS
+# define _LIBINTL_H
+# define _LIBGETTEXT_H
+#endif
+
#ifdef HAVE_LOCALE_H
#endif
#ifndef SEEK_CUR
Index: ld/Makefile.in
--- ld/Makefile.in.orig 2008-12-23 14:54:52 +0100
+++ ld/Makefile.in 2009-02-03 08:15:09 +0100
@@@@ -291,7 +291,7 @@@@
# We put the scripts in the directory $(scriptdir)/ldscripts.
# We can't put the scripts in $(datadir) because the SEARCH_DIR
# directives need to be different for native and cross linkers.
-scriptdir = $(tooldir)/lib
+scriptdir = $(libdir)
BASEDIR = $(srcdir)/..
BFDDIR = $(BASEDIR)/bfd
INCDIR = $(BASEDIR)/include
-----------------------------------------------------------------------------
workaround problems under Mac OS X.
Index: libiberty/fibheap.c
--- libiberty/fibheap.c.orig 2005-05-10 17:33:33 +0200
+++ libiberty/fibheap.c 2009-02-03 08:15:09 +0100
@@@@ -34,8 +34,11 @@@@
#include "libiberty.h"
#include "fibheap.h"
-
+#ifdef LONG_MIN
#define FIBHEAPKEY_MIN LONG_MIN
+#else
+#define FIBHEAPKEY_MIN (-0x7fffffffL - 1)
+#endif
static void fibheap_ins_root (fibheap_t, fibnode_t);
static void fibheap_rem_root (fibheap_t, fibnode_t);
-----------------------------------------------------------------------------
Disable the "error" about "eh_frame_hdr" as it is actually more a
warning (the linking is *not* aborted) and it occurs at least under
FreeBSD-7.0/amd64 regularily without doing any obvious harm. Seems
like the issue itself exists since a longer time, but in recent GNU
binutils this additional message was introduced. As we cannot observe
any problems and this message really confused, just disable it for now.
Index: bfd/elf-eh-frame.c
--- bfd/elf-eh-frame.c.orig 2008-09-17 11:00:44 +0200
+++ bfd/elf-eh-frame.c 2009-02-03 08:15:09 +0100
@@@@ -887,9 +887,11 @@@@
goto success;
free_no_table:
+#if 0
(*info->callbacks->einfo)
(_("%P: error in %B(%A); no .eh_frame_hdr table will be created.\n"),
abfd, sec);
+#endif
hdr_info->table = FALSE;
if (sec_info)
free (sec_info);
@
1.25
log
@apply an upstream patch for Solaris/amd64
@
text
@a178 42
-----------------------------------------------------------------------------
http://sourceware.org/bugzilla/show_bug.cgi?id=9938
Index: bfd/elf32-i386.c
--- bfd/elf32-i386.c.orig Mon Jul 28 20:07:05 2008
+++ bfd/elf32-i386.c Wed Apr 1 12:11:49 2009
@@@@ -1007,11 +1007,14 @@@@
return FALSE;
h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ /* Use strncmp to check ___tls_get_addr since ___tls_get_addr
+ may be versioned. */
return (h != NULL
&& h->root.root.string != NULL
&& (ELF32_R_TYPE (rel[1].r_info) == R_386_PC32
|| ELF32_R_TYPE (rel[1].r_info) == R_386_PLT32)
- && (strcmp (h->root.root.string, "___tls_get_addr") == 0));
+ && (strncmp (h->root.root.string, "___tls_get_addr",
+ 15) == 0));
case R_386_TLS_IE:
/* Check transition from IE access model:
Index: bfd/elf64-x86-64.c
--- bfd/elf64-x86-64.c.orig Mon Jul 28 20:07:05 2008
+++ bfd/elf64-x86-64.c Wed Apr 1 12:12:59 2009
@@@@ -810,11 +810,14 @@@@
return FALSE;
h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ /* Use strncmp to check __tls_get_addr since __tls_get_addr
+ may be versioned. */
return (h != NULL
&& h->root.root.string != NULL
&& (ELF64_R_TYPE (rel[1].r_info) == R_X86_64_PC32
|| ELF64_R_TYPE (rel[1].r_info) == R_X86_64_PLT32)
- && (strcmp (h->root.root.string, "__tls_get_addr") == 0));
+ && (strncmp (h->root.root.string,
+ "__tls_get_addr", 14) == 0));
case R_X86_64_GOTTPOFF:
/* Check transition from IE access model:
@
1.24
log
@upgrading package: binutils 2.19 -> 2.19.1
@
text
@d179 42
@
1.23
log
@upgrading package: binutils 2.18 -> 2.19
@
text
@d11 3
a13 3
--- include/elf/common.h.orig 2007-08-28 19:19:40 +0200
+++ include/elf/common.h 2007-08-29 09:30:04 +0200
@@@@ -353,6 +353,9 @@@@
d24 3
a26 3
--- bfd/elf.c.orig 2007-08-28 19:19:33 +0200
+++ bfd/elf.c 2007-08-29 09:30:04 +0200
@@@@ -1793,6 +1793,11 @@@@
d38 1
a38 1
@@@@ -4682,6 +4687,12 @@@@
d52 3
a54 3
--- bfd/elf64-x86-64.c.orig 2007-08-06 21:59:33 +0200
+++ bfd/elf64-x86-64.c 2007-08-29 09:30:04 +0200
@@@@ -345,7 +345,11 @@@@
d72 3
a74 3
--- bfd/configure.orig 2007-08-28 22:19:51 +0200
+++ bfd/configure 2007-08-29 09:30:04 +0200
@@@@ -17459,6 +17459,10 @@@@
d91 2
a92 2
--- gas/asintl.h.orig 2007-08-06 21:59:49 +0200
+++ gas/asintl.h 2007-08-29 09:30:04 +0200
d106 2
a107 2
--- ld/ld.h.orig 2007-08-06 22:00:19 +0200
+++ ld/ld.h 2007-08-29 09:30:04 +0200
d121 3
a123 3
--- ld/Makefile.in.orig 2007-08-06 22:29:54 +0200
+++ ld/Makefile.in 2007-08-29 09:30:04 +0200
@@@@ -287,7 +287,7 @@@@
d139 1
a139 1
+++ libiberty/fibheap.c 2007-08-29 09:30:04 +0200
d165 1
a165 1
+++ bfd/elf-eh-frame.c 2008-10-16 22:34:32 +0200
d178 1
@
1.22
log
@get rid of a confusing error message
@
text
@d164 4
a167 4
--- bfd/elf-eh-frame.c.orig 2007-08-06 21:59:22 +0200
+++ bfd/elf-eh-frame.c 2007-11-11 15:46:44 +0100
@@@@ -970,9 +970,11 @@@@
return offset != sec->rawsize;
d169 1
a169 1
free_no_table:
d175 1
a175 2
if (ehbuf)
free (ehbuf);
d177 1
@
1.21
log
@upgrading package: binutils 2.17 -> 2.18
@
text
@d154 24
@
1.20
log
@Silently ignore ld(1) option --hash-style=ARG which
RedHat/Fedora introduce in GNU binutils >= 2.17.50.
This is required to be able to build GCC under Fedora 7
as here the vendor cc(1) temporarily used our ld(1).
@
text
@d11 3
a13 3
--- include/elf/common.h.orig 2006-02-17 15:36:26 +0100
+++ include/elf/common.h 2006-06-24 21:50:39 +0200
@@@@ -346,6 +346,9 @@@@
d24 4
a27 3
--- bfd/elf.c.orig 2006-03-16 13:20:15 +0100
+++ bfd/elf.c 2006-06-24 21:50:39 +0200
@@@@ -2121,6 +2121,11 @@@@
a28 1
break;
d31 1
a31 1
+ case SHT_SUNW_signature:
d38 1
a38 1
@@@@ -4862,6 +4867,12 @@@@
d52 3
a54 3
--- bfd/elf64-x86-64.c.orig 2006-03-23 09:23:09 +0100
+++ bfd/elf64-x86-64.c 2006-06-24 21:50:39 +0200
@@@@ -327,7 +327,11 @@@@
a66 1
d72 3
a74 3
--- bfd/configure.orig 2006-06-23 20:17:03 +0200
+++ bfd/configure 2006-06-24 21:50:39 +0200
@@@@ -11495,6 +11495,10 @@@@
a89 15
Index: binutils/bucomm.h
--- binutils/bucomm.h.orig 2006-02-09 12:49:53 +0100
+++ binutils/bucomm.h 2006-06-24 21:50:39 +0200
@@@@ -138,6 +138,11 @@@@
#endif
+#ifndef ENABLE_NLS
+# define _LIBINTL_H
+# define _LIBGETTEXT_H
+#endif
+
#ifdef HAVE_LOCALE_H
# ifndef ENABLE_NLS
/* The Solaris version of locale.h always includes libintl.h. If we have
d91 2
a92 2
--- gas/asintl.h.orig 2005-09-30 13:42:01 +0200
+++ gas/asintl.h 2006-06-24 21:50:39 +0200
d106 2
a107 2
--- ld/ld.h.orig 2005-09-30 13:42:04 +0200
+++ ld/ld.h 2006-06-24 21:50:39 +0200
d121 3
a123 3
--- ld/Makefile.in.orig 2006-06-03 06:45:50 +0200
+++ ld/Makefile.in 2006-06-24 21:53:56 +0200
@@@@ -269,7 +269,7 @@@@
d139 1
a139 1
+++ libiberty/fibheap.c 2007-06-06 11:11:42 +0200
a153 37
-----------------------------------------------------------------------------
Silently ignore ld(1) option --hash-style=ARG which
RedHat/Fedora introduce in GNU binutils >= 2.17.50.
This is required to be able to build GCC under Fedora 7
as here the vendor cc(1) temporarily used our ld(1).
Index: ld/emultempl/elf32.em
--- ld/emultempl/elf32.em.orig 2006-06-12 15:05:04 +0200
+++ ld/emultempl/elf32.em 2007-06-23 14:46:32 +0200
@@@@ -1734,6 +1734,7 @@@@
#define OPTION_GROUP (OPTION_ENABLE_NEW_DTAGS + 1)
#define OPTION_EH_FRAME_HDR (OPTION_GROUP + 1)
#define OPTION_EXCLUDE_LIBS (OPTION_EH_FRAME_HDR + 1)
+#define OPTION_HASH_STYLE (OPTION_EXCLUDE_LIBS + 1)
static void
gld${EMULATION_NAME}_add_options
@@@@ -1750,6 +1751,7 @@@@
{"enable-new-dtags", no_argument, NULL, OPTION_ENABLE_NEW_DTAGS},
{"eh-frame-hdr", no_argument, NULL, OPTION_EH_FRAME_HDR},
{"exclude-libs", required_argument, NULL, OPTION_EXCLUDE_LIBS},
+ {"hash-style", required_argument, NULL, OPTION_HASH_STYLE},
{"Bgroup", no_argument, NULL, OPTION_GROUP},
EOF
fi
@@@@ -1806,6 +1808,10 @@@@
add_excluded_libs (optarg);
break;
+ case OPTION_HASH_STYLE:
+ /* silently ignore --hash-style=ARG from GNU binutils >= 2.17.50 */
+ break;
+
case 'z':
if (strcmp (optarg, "initfirst") == 0)
link_info.flags_1 |= (bfd_vma) DF_1_INITFIRST;
@
1.19
log
@blindly try to add some additional Mac OS X support
@
text
@d170 37
@
1.18
log
@upgrading package: binutils 2.16.1 -> 2.17
@
text
@d149 21
@
1.17
log
@Fix GNU binutils support for Solaris 10/amd64:
- recognize and ignore Solaris 10's "Solaris Cryptographic Framework"
ELF header type "SUNW_signature"
- recognize and ignore Solaris 10's "Symbol information"
ELF header type "SUNW_syminfo"
- recognize and ignore Solaris 10's "DTrace Object Format"
ELF header type.
- Fix the path to the dynamic linker under Solaris 10/amd64.
- Enable 64-bit support in GNU binutils libbfd.
Sponsored by: SpaceNet AG
@
text
@d11 3
a13 3
--- include/elf/common.h.orig 2004-10-08 15:55:08 +0200
+++ include/elf/common.h 2006-04-10 13:58:15 +0200
@@@@ -335,6 +335,9 @@@@
d24 4
a27 4
--- bfd/elf.c.orig 2005-05-30 00:00:10 +0200
+++ bfd/elf.c 2006-04-10 13:58:42 +0200
@@@@ -2009,6 +2009,11 @@@@
return _bfd_elf_make_section_from_shdr (abfd, hdr, name);
d38 1
a38 1
@@@@ -4627,6 +4632,12 @@@@
d52 3
a54 3
--- bfd/elf64-x86-64.c.orig 2005-02-06 19:11:30 +0100
+++ bfd/elf64-x86-64.c 2006-04-10 15:34:03 +0200
@@@@ -259,7 +259,11 @@@@
d73 3
a75 3
--- bfd/configure.orig 2005-05-02 21:43:54 +0200
+++ bfd/configure 2005-05-03 19:49:53 +0200
@@@@ -9956,6 +9956,10 @@@@
d92 3
a94 4
--- binutils/bucomm.h.orig 2005-08-16 21:35:21.000000000 +0200
+++ binutils/bucomm.h 2005-09-13 16:55:29.276456000 +0200
@@@@ -125,6 +125,11 @@@@
# endif /* HAVE_ALLOCA_H */
d97 1
d104 2
a105 2
# include
#endif
d107 2
a108 2
--- gas/asintl.h.orig 2005-05-05 11:12:43.000000000 +0200
+++ gas/asintl.h 2005-09-13 16:58:29.082469000 +0200
d119 2
a120 16
# include
#endif
Index: gprof/gprof.c
--- gprof/gprof.c.orig 2005-04-23 19:13:31.000000000 +0200
+++ gprof/gprof.c 2005-09-13 17:13:52.242443000 +0200
@@@@ -189,8 +189,10 @@@@
#if defined (HAVE_SETLOCALE)
setlocale (LC_CTYPE, "");
#endif
+#ifdef ENABLE_NLS
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
+#endif
whoami = argv[0];
xmalloc_set_program_name (whoami);
d122 2
a123 2
--- ld/ld.h.orig 2005-06-09 04:05:46.000000000 +0200
+++ ld/ld.h 2005-09-13 17:24:03.767249000 +0200
a133 1
# include
d135 1
d137 3
a139 3
--- ld/Makefile.in.orig 2005-01-23 06:36:37 +0100
+++ ld/Makefile.in 2005-09-21 21:06:55 +0200
@@@@ -139,7 +139,7 @@@@
d145 3
a147 5
EMUL = @@EMUL@@
EMULATION_OFILES = @@EMULATION_OFILES@@
-----------------------------------------------------------------------------
a148 230
Security Issue (PR binutils/2584, CVE-2006-2362)
Index: bfd/tekhex.c
--- bfd/tekhex.c.orig 2004-10-08 16:54:02 +0200
+++ bfd/tekhex.c 2006-05-26 20:21:02 +0200
@@@@ -99,7 +99,7 @@@@
#define ISHEX(x) hex_p(x)
static void tekhex_init PARAMS ((void));
-static bfd_vma getvalue PARAMS ((char **));
+static bfd_boolean getvalue PARAMS ((char **, bfd_vma *));
static void tekhex_print_symbol
PARAMS ((bfd *, PTR, asymbol *, bfd_print_symbol_type));
static void tekhex_get_symbol_info PARAMS ((bfd *, asymbol *, symbol_info *));
@@@@ -121,11 +121,11 @@@@
static bfd_boolean tekhex_mkobject PARAMS ((bfd *));
static long tekhex_get_symtab_upper_bound PARAMS ((bfd *));
static long tekhex_canonicalize_symtab PARAMS ((bfd *, asymbol **));
-static void pass_over PARAMS ((bfd *, void (*) (bfd*, int, char *)));
-static void first_phase PARAMS ((bfd *, int, char *));
+static bfd_boolean pass_over PARAMS ((bfd *, bfd_boolean (*) (bfd*, int, char *)));
+static bfd_boolean first_phase PARAMS ((bfd *, int, char *));
static void insert_byte PARAMS ((bfd *, int, bfd_vma));
static struct data_struct *find_chunk PARAMS ((bfd *, bfd_vma));
-static unsigned int getsym PARAMS ((char *, char **));
+static bfd_boolean getsym PARAMS ((char *, char **, unsigned int *));
/*
Here's an example
@@@@ -304,40 +304,53 @@@@
#define enda(x) (x->vma + x->size)
-static bfd_vma
-getvalue (srcp)
+static bfd_boolean
+getvalue (srcp, valuep)
char **srcp;
+ bfd_vma *valuep;
{
char *src = *srcp;
bfd_vma value = 0;
- unsigned int len = hex_value(*src++);
+ unsigned int len;
+
+ if (!ISHEX(*src))
+ return FALSE;
+ len = hex_value(*src++);
if (len == 0)
len = 16;
while (len--)
{
+ if (!ISHEX(*src))
+ return FALSE;
value = value << 4 | hex_value(*src++);
}
*srcp = src;
- return value;
+ *valuep = value;
+ return TRUE;
}
-static unsigned int
-getsym (dstp, srcp)
+static bfd_boolean
+getsym (dstp, srcp, lenp)
char *dstp;
char **srcp;
+ unsigned int *lenp;
{
char *src = *srcp;
unsigned int i;
- unsigned int len = hex_value(*src++);
+ unsigned int len;
+ if (!ISHEX(*src))
+ return FALSE;
+ len = hex_value(*src++);
if (len == 0)
len = 16;
for (i = 0; i < len; i++)
dstp[i] = src[i];
dstp[i] = 0;
*srcp = src + i;
- return len;
+ *lenp = len;
+ return TRUE;
}
static struct data_struct *
@@@@ -383,7 +396,7 @@@@
/* The first pass is to find the names of all the sections, and see
how big the data is */
-static void
+static bfd_boolean
first_phase (abfd, type, src)
bfd *abfd;
int type;
@@@@ -391,6 +404,7 @@@@
{
asection *section = bfd_abs_section_ptr;
unsigned int len;
+ bfd_vma val;
char sym[17]; /* A symbol can only be 16chars long */
switch (type)
@@@@ -398,7 +412,10 @@@@
case '6':
/* Data record - read it and store it */
{
- bfd_vma addr = getvalue (&src);
+ bfd_vma addr;
+
+ if (!getvalue (&src, &addr))
+ return FALSE;
while (*src)
{
@@@@ -408,17 +425,18 @@@@
}
}
- return;
+ return TRUE;
case '3':
/* Symbol record, read the segment */
- len = getsym (sym, &src);
+ if (!getsym (sym, &src, &len))
+ return FALSE;
section = bfd_get_section_by_name (abfd, sym);
if (section == (asection *) NULL)
{
char *n = bfd_alloc (abfd, (bfd_size_type) len + 1);
if (!n)
- abort (); /* FIXME */
+ return FALSE;
memcpy (n, sym, len + 1);
section = bfd_make_section (abfd, n);
}
@@@@ -428,8 +446,11 @@@@
{
case '1': /* section range */
src++;
- section->vma = getvalue (&src);
- section->size = getvalue (&src) - section->vma;
+ if (!getvalue (&src, §ion->vma))
+ return FALSE;
+ if (!getvalue (&src, &val))
+ return FALSE;
+ section->size = val - section->vma;
section->flags = SEC_HAS_CONTENTS | SEC_LOAD | SEC_ALLOC;
break;
case '0':
@@@@ -447,37 +468,43 @@@@
char stype = (*src);
if (!new)
- abort (); /* FIXME */
+ return FALSE;
new->symbol.the_bfd = abfd;
src++;
abfd->symcount++;
abfd->flags |= HAS_SYMS;
new->prev = abfd->tdata.tekhex_data->symbols;
abfd->tdata.tekhex_data->symbols = new;
- len = getsym (sym, &src);
+ if (!getsym (sym, &src, &len))
+ return FALSE;
new->symbol.name = bfd_alloc (abfd, (bfd_size_type) len + 1);
if (!new->symbol.name)
- abort (); /* FIXME */
+ return FALSE;
memcpy ((char *) (new->symbol.name), sym, len + 1);
new->symbol.section = section;
if (stype <= '4')
new->symbol.flags = (BSF_GLOBAL | BSF_EXPORT);
else
new->symbol.flags = BSF_LOCAL;
- new->symbol.value = getvalue (&src) - section->vma;
+ if (!getvalue (&src, &val))
+ return FALSE;
+ new->symbol.value = val - section->vma;
}
+ default:
+ return FALSE;
}
}
}
+ return TRUE;
}
/* Pass over a tekhex, calling one of the above functions on each
record. */
-static void
+static bfd_boolean
pass_over (abfd, func)
bfd *abfd;
- void (*func) PARAMS ((bfd *, int, char *));
+ bfd_boolean (*func) PARAMS ((bfd *, int, char *));
{
unsigned int chars_on_line;
bfd_boolean eof = FALSE;
@@@@ -516,9 +543,10 @@@@
abort (); /* FIXME */
src[chars_on_line] = 0; /* put a null at the end */
- func (abfd, type, src);
+ if (!func (abfd, type, src))
+ return FALSE;
}
-
+ return TRUE;
}
static long
@@@@ -585,7 +613,9 @@@@
tekhex_mkobject (abfd);
- pass_over (abfd, first_phase);
+ if (!pass_over (abfd, first_phase))
+ return NULL;
+
return abfd->xvec;
}
@
1.17.2.1
log
@Mass merge from CURRENT to 2-STABLE (all packages except those of JUNK class)
@
text
@d11 3
a13 3
--- include/elf/common.h.orig 2006-02-17 15:36:26 +0100
+++ include/elf/common.h 2006-06-24 21:50:39 +0200
@@@@ -346,6 +346,9 @@@@
d24 4
a27 4
--- bfd/elf.c.orig 2006-03-16 13:20:15 +0100
+++ bfd/elf.c 2006-06-24 21:50:39 +0200
@@@@ -2121,6 +2121,11 @@@@
return _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex);
d38 1
a38 1
@@@@ -4862,6 +4867,12 @@@@
d52 3
a54 3
--- bfd/elf64-x86-64.c.orig 2006-03-23 09:23:09 +0100
+++ bfd/elf64-x86-64.c 2006-06-24 21:50:39 +0200
@@@@ -327,7 +327,11 @@@@
d73 3
a75 3
--- bfd/configure.orig 2006-06-23 20:17:03 +0200
+++ bfd/configure 2006-06-24 21:50:39 +0200
@@@@ -11495,6 +11495,10 @@@@
d92 4
a95 3
--- binutils/bucomm.h.orig 2006-02-09 12:49:53 +0100
+++ binutils/bucomm.h 2006-06-24 21:50:39 +0200
@@@@ -138,6 +138,11 @@@@
a97 1
d104 2
a105 2
# ifndef ENABLE_NLS
/* The Solaris version of locale.h always includes libintl.h. If we have
d107 2
a108 2
--- gas/asintl.h.orig 2005-09-30 13:42:01 +0200
+++ gas/asintl.h 2006-06-24 21:50:39 +0200
d119 16
a134 2
# ifndef ENABLE_NLS
/* The Solaris version of locale.h always includes libintl.h. If we have
d136 2
a137 2
--- ld/ld.h.orig 2005-09-30 13:42:04 +0200
+++ ld/ld.h 2006-06-24 21:50:39 +0200
d148 1
a149 1
#ifndef SEEK_CUR
d151 3
a153 3
--- ld/Makefile.in.orig 2006-06-03 06:45:50 +0200
+++ ld/Makefile.in 2006-06-24 21:53:56 +0200
@@@@ -269,7 +269,7 @@@@
d159 5
a163 3
BASEDIR = $(srcdir)/..
BFDDIR = $(BASEDIR)/bfd
INCDIR = $(BASEDIR)/include
d165 230
@
1.16
log
@Security Issue (PR binutils/2584, CVE-2006-2362)
@
text
@d4 19
d24 15
a38 3
--- bfd/elf.c.orig 2005-03-06 03:02:15 +0100
+++ bfd/elf.c 2005-05-03 19:48:25 +0200
@@@@ -4621,6 +4621,12 @@@@
d51 16
@
1.15
log
@provide both the binutils related C APIs and the ld(1) ldscripts (which for unknown reasons are definetely required on x86-solaris10 when building gcc 4.0)
@
text
@d115 233
@
1.15.2.1
log
@Security Issue (PR binutils/2584, CVE-2006-2362)
@
text
@a114 233
-----------------------------------------------------------------------------
Security Issue (PR binutils/2584, CVE-2006-2362)
Index: bfd/tekhex.c
--- bfd/tekhex.c.orig 2004-10-08 16:54:02 +0200
+++ bfd/tekhex.c 2006-05-26 20:21:02 +0200
@@@@ -99,7 +99,7 @@@@
#define ISHEX(x) hex_p(x)
static void tekhex_init PARAMS ((void));
-static bfd_vma getvalue PARAMS ((char **));
+static bfd_boolean getvalue PARAMS ((char **, bfd_vma *));
static void tekhex_print_symbol
PARAMS ((bfd *, PTR, asymbol *, bfd_print_symbol_type));
static void tekhex_get_symbol_info PARAMS ((bfd *, asymbol *, symbol_info *));
@@@@ -121,11 +121,11 @@@@
static bfd_boolean tekhex_mkobject PARAMS ((bfd *));
static long tekhex_get_symtab_upper_bound PARAMS ((bfd *));
static long tekhex_canonicalize_symtab PARAMS ((bfd *, asymbol **));
-static void pass_over PARAMS ((bfd *, void (*) (bfd*, int, char *)));
-static void first_phase PARAMS ((bfd *, int, char *));
+static bfd_boolean pass_over PARAMS ((bfd *, bfd_boolean (*) (bfd*, int, char *)));
+static bfd_boolean first_phase PARAMS ((bfd *, int, char *));
static void insert_byte PARAMS ((bfd *, int, bfd_vma));
static struct data_struct *find_chunk PARAMS ((bfd *, bfd_vma));
-static unsigned int getsym PARAMS ((char *, char **));
+static bfd_boolean getsym PARAMS ((char *, char **, unsigned int *));
/*
Here's an example
@@@@ -304,40 +304,53 @@@@
#define enda(x) (x->vma + x->size)
-static bfd_vma
-getvalue (srcp)
+static bfd_boolean
+getvalue (srcp, valuep)
char **srcp;
+ bfd_vma *valuep;
{
char *src = *srcp;
bfd_vma value = 0;
- unsigned int len = hex_value(*src++);
+ unsigned int len;
+
+ if (!ISHEX(*src))
+ return FALSE;
+ len = hex_value(*src++);
if (len == 0)
len = 16;
while (len--)
{
+ if (!ISHEX(*src))
+ return FALSE;
value = value << 4 | hex_value(*src++);
}
*srcp = src;
- return value;
+ *valuep = value;
+ return TRUE;
}
-static unsigned int
-getsym (dstp, srcp)
+static bfd_boolean
+getsym (dstp, srcp, lenp)
char *dstp;
char **srcp;
+ unsigned int *lenp;
{
char *src = *srcp;
unsigned int i;
- unsigned int len = hex_value(*src++);
+ unsigned int len;
+ if (!ISHEX(*src))
+ return FALSE;
+ len = hex_value(*src++);
if (len == 0)
len = 16;
for (i = 0; i < len; i++)
dstp[i] = src[i];
dstp[i] = 0;
*srcp = src + i;
- return len;
+ *lenp = len;
+ return TRUE;
}
static struct data_struct *
@@@@ -383,7 +396,7 @@@@
/* The first pass is to find the names of all the sections, and see
how big the data is */
-static void
+static bfd_boolean
first_phase (abfd, type, src)
bfd *abfd;
int type;
@@@@ -391,6 +404,7 @@@@
{
asection *section = bfd_abs_section_ptr;
unsigned int len;
+ bfd_vma val;
char sym[17]; /* A symbol can only be 16chars long */
switch (type)
@@@@ -398,7 +412,10 @@@@
case '6':
/* Data record - read it and store it */
{
- bfd_vma addr = getvalue (&src);
+ bfd_vma addr;
+
+ if (!getvalue (&src, &addr))
+ return FALSE;
while (*src)
{
@@@@ -408,17 +425,18 @@@@
}
}
- return;
+ return TRUE;
case '3':
/* Symbol record, read the segment */
- len = getsym (sym, &src);
+ if (!getsym (sym, &src, &len))
+ return FALSE;
section = bfd_get_section_by_name (abfd, sym);
if (section == (asection *) NULL)
{
char *n = bfd_alloc (abfd, (bfd_size_type) len + 1);
if (!n)
- abort (); /* FIXME */
+ return FALSE;
memcpy (n, sym, len + 1);
section = bfd_make_section (abfd, n);
}
@@@@ -428,8 +446,11 @@@@
{
case '1': /* section range */
src++;
- section->vma = getvalue (&src);
- section->size = getvalue (&src) - section->vma;
+ if (!getvalue (&src, §ion->vma))
+ return FALSE;
+ if (!getvalue (&src, &val))
+ return FALSE;
+ section->size = val - section->vma;
section->flags = SEC_HAS_CONTENTS | SEC_LOAD | SEC_ALLOC;
break;
case '0':
@@@@ -447,37 +468,43 @@@@
char stype = (*src);
if (!new)
- abort (); /* FIXME */
+ return FALSE;
new->symbol.the_bfd = abfd;
src++;
abfd->symcount++;
abfd->flags |= HAS_SYMS;
new->prev = abfd->tdata.tekhex_data->symbols;
abfd->tdata.tekhex_data->symbols = new;
- len = getsym (sym, &src);
+ if (!getsym (sym, &src, &len))
+ return FALSE;
new->symbol.name = bfd_alloc (abfd, (bfd_size_type) len + 1);
if (!new->symbol.name)
- abort (); /* FIXME */
+ return FALSE;
memcpy ((char *) (new->symbol.name), sym, len + 1);
new->symbol.section = section;
if (stype <= '4')
new->symbol.flags = (BSF_GLOBAL | BSF_EXPORT);
else
new->symbol.flags = BSF_LOCAL;
- new->symbol.value = getvalue (&src) - section->vma;
+ if (!getvalue (&src, &val))
+ return FALSE;
+ new->symbol.value = val - section->vma;
}
+ default:
+ return FALSE;
}
}
}
+ return TRUE;
}
/* Pass over a tekhex, calling one of the above functions on each
record. */
-static void
+static bfd_boolean
pass_over (abfd, func)
bfd *abfd;
- void (*func) PARAMS ((bfd *, int, char *));
+ bfd_boolean (*func) PARAMS ((bfd *, int, char *));
{
unsigned int chars_on_line;
bfd_boolean eof = FALSE;
@@@@ -516,9 +543,10 @@@@
abort (); /* FIXME */
src[chars_on_line] = 0; /* put a null at the end */
- func (abfd, type, src);
+ if (!func (abfd, type, src))
+ return FALSE;
}
-
+ return TRUE;
}
static long
@@@@ -585,7 +613,9 @@@@
tekhex_mkobject (abfd);
- pass_over (abfd, first_phase);
+ if (!pass_over (abfd, first_phase))
+ return NULL;
+
return abfd->xvec;
}
@
1.14
log
@Problems with --disable-nls under Solaris
- Prevent inclusion of , when ENABLE_NLS is not set.
When ENABLE_NLS is not set, some parts of binutils are declaring dummy
versions of bindtextdomain, texdomain etc.
under Solaris includes , which leads to problems,
because the dummy definitions conflict with the definitions in libintl.h.
- Finally the dummy routines lead to a compilation error in gprof.c, because
they generate a warning ("statement without effect", or so) and the
compiler switch -Werror is used.
Real errors happen only in the current CVS version, but there where many
warnings in 2.16.1, so i applied the patch anyway.
@
text
@d103 12
@
1.13
log
@upgrading package: binutils 2.15 -> 2.16
@
text
@d39 64
@
1.13.2.1
log
@Security Issue (PR binutils/2584, CVE-2006-2362)
@
text
@a38 309
-----------------------------------------------------------------------------
Fight problems with --disable-nls under Solaris
Index: binutils/bucomm.h
--- binutils/bucomm.h.orig 2005-08-16 21:35:21.000000000 +0200
+++ binutils/bucomm.h 2005-09-13 16:55:29.276456000 +0200
@@@@ -125,6 +125,11 @@@@
# endif /* HAVE_ALLOCA_H */
#endif
+#ifndef ENABLE_NLS
+# define _LIBINTL_H
+# define _LIBGETTEXT_H
+#endif
+
#ifdef HAVE_LOCALE_H
# include
#endif
Index: gas/asintl.h
--- gas/asintl.h.orig 2005-05-05 11:12:43.000000000 +0200
+++ gas/asintl.h 2005-09-13 16:58:29.082469000 +0200
@@@@ -20,6 +20,11 @@@@
Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
02110-1301, USA. */
+#ifndef ENABLE_NLS
+# define _LIBINTL_H
+# define _LIBGETTEXT_H
+#endif
+
#ifdef HAVE_LOCALE_H
# include
#endif
Index: gprof/gprof.c
--- gprof/gprof.c.orig 2005-04-23 19:13:31.000000000 +0200
+++ gprof/gprof.c 2005-09-13 17:13:52.242443000 +0200
@@@@ -189,8 +189,10 @@@@
#if defined (HAVE_SETLOCALE)
setlocale (LC_CTYPE, "");
#endif
+#ifdef ENABLE_NLS
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
+#endif
whoami = argv[0];
xmalloc_set_program_name (whoami);
Index: ld/ld.h
--- ld/ld.h.orig 2005-06-09 04:05:46.000000000 +0200
+++ ld/ld.h 2005-09-13 17:24:03.767249000 +0200
@@@@ -23,6 +23,11 @@@@
#ifndef LD_H
#define LD_H
+#ifndef ENABLE_NLS
+# define _LIBINTL_H
+# define _LIBGETTEXT_H
+#endif
+
#ifdef HAVE_LOCALE_H
# include
#endif
Index: ld/Makefile.in
--- ld/Makefile.in.orig 2005-01-23 06:36:37 +0100
+++ ld/Makefile.in 2005-09-21 21:06:55 +0200
@@@@ -139,7 +139,7 @@@@
# We put the scripts in the directory $(scriptdir)/ldscripts.
# We can't put the scripts in $(datadir) because the SEARCH_DIR
# directives need to be different for native and cross linkers.
-scriptdir = $(tooldir)/lib
+scriptdir = $(libdir)
EMUL = @@EMUL@@
EMULATION_OFILES = @@EMULATION_OFILES@@
-----------------------------------------------------------------------------
Security Issue (PR binutils/2584, CVE-2006-2362)
Index: bfd/tekhex.c
--- bfd/tekhex.c.orig 2004-10-08 16:54:02 +0200
+++ bfd/tekhex.c 2006-05-26 20:21:02 +0200
@@@@ -99,7 +99,7 @@@@
#define ISHEX(x) hex_p(x)
static void tekhex_init PARAMS ((void));
-static bfd_vma getvalue PARAMS ((char **));
+static bfd_boolean getvalue PARAMS ((char **, bfd_vma *));
static void tekhex_print_symbol
PARAMS ((bfd *, PTR, asymbol *, bfd_print_symbol_type));
static void tekhex_get_symbol_info PARAMS ((bfd *, asymbol *, symbol_info *));
@@@@ -121,11 +121,11 @@@@
static bfd_boolean tekhex_mkobject PARAMS ((bfd *));
static long tekhex_get_symtab_upper_bound PARAMS ((bfd *));
static long tekhex_canonicalize_symtab PARAMS ((bfd *, asymbol **));
-static void pass_over PARAMS ((bfd *, void (*) (bfd*, int, char *)));
-static void first_phase PARAMS ((bfd *, int, char *));
+static bfd_boolean pass_over PARAMS ((bfd *, bfd_boolean (*) (bfd*, int, char *)));
+static bfd_boolean first_phase PARAMS ((bfd *, int, char *));
static void insert_byte PARAMS ((bfd *, int, bfd_vma));
static struct data_struct *find_chunk PARAMS ((bfd *, bfd_vma));
-static unsigned int getsym PARAMS ((char *, char **));
+static bfd_boolean getsym PARAMS ((char *, char **, unsigned int *));
/*
Here's an example
@@@@ -304,40 +304,53 @@@@
#define enda(x) (x->vma + x->size)
-static bfd_vma
-getvalue (srcp)
+static bfd_boolean
+getvalue (srcp, valuep)
char **srcp;
+ bfd_vma *valuep;
{
char *src = *srcp;
bfd_vma value = 0;
- unsigned int len = hex_value(*src++);
+ unsigned int len;
+
+ if (!ISHEX(*src))
+ return FALSE;
+ len = hex_value(*src++);
if (len == 0)
len = 16;
while (len--)
{
+ if (!ISHEX(*src))
+ return FALSE;
value = value << 4 | hex_value(*src++);
}
*srcp = src;
- return value;
+ *valuep = value;
+ return TRUE;
}
-static unsigned int
-getsym (dstp, srcp)
+static bfd_boolean
+getsym (dstp, srcp, lenp)
char *dstp;
char **srcp;
+ unsigned int *lenp;
{
char *src = *srcp;
unsigned int i;
- unsigned int len = hex_value(*src++);
+ unsigned int len;
+ if (!ISHEX(*src))
+ return FALSE;
+ len = hex_value(*src++);
if (len == 0)
len = 16;
for (i = 0; i < len; i++)
dstp[i] = src[i];
dstp[i] = 0;
*srcp = src + i;
- return len;
+ *lenp = len;
+ return TRUE;
}
static struct data_struct *
@@@@ -383,7 +396,7 @@@@
/* The first pass is to find the names of all the sections, and see
how big the data is */
-static void
+static bfd_boolean
first_phase (abfd, type, src)
bfd *abfd;
int type;
@@@@ -391,6 +404,7 @@@@
{
asection *section = bfd_abs_section_ptr;
unsigned int len;
+ bfd_vma val;
char sym[17]; /* A symbol can only be 16chars long */
switch (type)
@@@@ -398,7 +412,10 @@@@
case '6':
/* Data record - read it and store it */
{
- bfd_vma addr = getvalue (&src);
+ bfd_vma addr;
+
+ if (!getvalue (&src, &addr))
+ return FALSE;
while (*src)
{
@@@@ -408,17 +425,18 @@@@
}
}
- return;
+ return TRUE;
case '3':
/* Symbol record, read the segment */
- len = getsym (sym, &src);
+ if (!getsym (sym, &src, &len))
+ return FALSE;
section = bfd_get_section_by_name (abfd, sym);
if (section == (asection *) NULL)
{
char *n = bfd_alloc (abfd, (bfd_size_type) len + 1);
if (!n)
- abort (); /* FIXME */
+ return FALSE;
memcpy (n, sym, len + 1);
section = bfd_make_section (abfd, n);
}
@@@@ -428,8 +446,11 @@@@
{
case '1': /* section range */
src++;
- section->vma = getvalue (&src);
- section->size = getvalue (&src) - section->vma;
+ if (!getvalue (&src, §ion->vma))
+ return FALSE;
+ if (!getvalue (&src, &val))
+ return FALSE;
+ section->size = val - section->vma;
section->flags = SEC_HAS_CONTENTS | SEC_LOAD | SEC_ALLOC;
break;
case '0':
@@@@ -447,37 +468,43 @@@@
char stype = (*src);
if (!new)
- abort (); /* FIXME */
+ return FALSE;
new->symbol.the_bfd = abfd;
src++;
abfd->symcount++;
abfd->flags |= HAS_SYMS;
new->prev = abfd->tdata.tekhex_data->symbols;
abfd->tdata.tekhex_data->symbols = new;
- len = getsym (sym, &src);
+ if (!getsym (sym, &src, &len))
+ return FALSE;
new->symbol.name = bfd_alloc (abfd, (bfd_size_type) len + 1);
if (!new->symbol.name)
- abort (); /* FIXME */
+ return FALSE;
memcpy ((char *) (new->symbol.name), sym, len + 1);
new->symbol.section = section;
if (stype <= '4')
new->symbol.flags = (BSF_GLOBAL | BSF_EXPORT);
else
new->symbol.flags = BSF_LOCAL;
- new->symbol.value = getvalue (&src) - section->vma;
+ if (!getvalue (&src, &val))
+ return FALSE;
+ new->symbol.value = val - section->vma;
}
+ default:
+ return FALSE;
}
}
}
+ return TRUE;
}
/* Pass over a tekhex, calling one of the above functions on each
record. */
-static void
+static bfd_boolean
pass_over (abfd, func)
bfd *abfd;
- void (*func) PARAMS ((bfd *, int, char *));
+ bfd_boolean (*func) PARAMS ((bfd *, int, char *));
{
unsigned int chars_on_line;
bfd_boolean eof = FALSE;
@@@@ -516,9 +543,10 @@@@
abort (); /* FIXME */
src[chars_on_line] = 0; /* put a null at the end */
- func (abfd, type, src);
+ if (!func (abfd, type, src))
+ return FALSE;
}
-
+ return TRUE;
}
static long
@@@@ -585,7 +613,9 @@@@
tekhex_mkobject (abfd);
- pass_over (abfd, first_phase);
+ if (!pass_over (abfd, first_phase))
+ return NULL;
+
return abfd->xvec;
}
@
1.12
log
@fixed patch
@
text
@d5 3
a7 3
--- bfd/elf.c.orig 2004-05-17 21:35:57 +0200
+++ bfd/elf.c 2004-11-24 13:21:56 +0100
@@@@ -4327,6 +4327,12 @@@@
d26 3
a28 3
--- bfd/configure.orig 2004-05-17 21:35:57 +0200
+++ bfd/configure 2004-11-24 15:14:05 +0100
@@@@ -5312,6 +5312,10 @@@@
d36 1
a36 1
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-*-freebsd*aout*)
a38 26
-----------------------------------------------------------------------------
Compare section id, not pointers
--- bfd/elflink.c.orig 2004-05-17 21:36:02.000000000 +0200
+++ bfd/elflink.c 2005-01-07 15:39:43.000000000 +0100
@@@@ -2700,7 +2700,7 @@@@
return vdiff > 0 ? 1 : -1;
else
{
- long sdiff = h1->root.u.def.section - h2->root.u.def.section;
+ long sdiff = h1->root.u.def.section->id - h2->root.u.def.section->id;
if (sdiff != 0)
return sdiff > 0 ? 1 : -1;
}
@@@@ -3954,7 +3954,7 @@@@
i = idx + 1;
else
{
- long sdiff = slook - h->root.u.def.section;
+ long sdiff = slook->id - h->root.u.def.section->id;
if (sdiff < 0)
j = idx;
else if (sdiff > 0)
@
1.11
log
@fixed ld(1) segfault probs on Solaris 8
@
text
@d60 1
a60 1
+ long sdiff = slook - h->root.u.def.section->id;
@
1.10
log
@GNU binutils 2.15 segfaulted in the past when built with GNU gcc 3.4.0
under at least Sun Solaris. Now with gcc 3.4.3 this seems to be no
longer happening, so try again to upgrade to GNU binutils 2.15. This is
especially needed for supporting amd64-freebsd5.3.
@
text
@d40 25
@
1.9
log
@fix binutils 2.14 packaging by using the old corresponding patch
@
text
@d5 3
a7 3
--- bfd/elf.c.orig 2002-07-30 20:19:42.000000000 +0200
+++ bfd/elf.c 2002-08-22 17:41:47.000000000 +0200
@@@@ -4235,6 +4235,12 @@@@
d23 1
a23 18
Fix the linker under Solaris/SPARC.
Index: bfd/elf64-sparc.c
--- bfd/elf64-sparc.c.orig 2003-06-20 09:42:19.000000000 +0200
+++ bfd/elf64-sparc.c 2003-06-20 09:42:40.000000000 +0200
@@@@ -2684,7 +2684,7 @@@@
overflows. We don't, but this breaks stabs debugging
info, whose relocations are only 32-bits wide. Ignore
overflows for discarded entries. */
- if (r_type == R_SPARC_32
+ if ((r_type == R_SPARC_32 || r_type == R_SPARC_DISP32)
&& _bfd_elf_section_offset (output_bfd, info, input_section,
rel->r_offset) == (bfd_vma) -1)
break;
-----------------------------------------------------------------------------
Support FreeBSD 4.10 by fixing platform detection.
d26 4
a29 4
--- bfd/configure.orig 2003-06-12 16:25:46.000000000 +0200
+++ bfd/configure 2004-04-30 22:01:31.000000000 +0200
@@@@ -5133,6 +5133,10 @@@@
i[3456]86-*-bsdi)
d36 1
a36 1
i[3456]86-*-bsd* | i[34567]86-*-freebsd[123] | i[34567]86-*-freebsd[123]\.* | i[34567]86-*-freebsd4\.[01234]* | i[34567]86-*-freebsd*aout*)
a39 50
-----------------------------------------------------------------------------
Accept (and ignore) --as-needed/--no-as-needed options from GNU binutils
2.15 in our GNU binutils 2.14 to resolve a chicken and egg problem under
platforms (like Fedora Core 2) which already run GNU binutils 2.15: the
vendor cc(1) knows that it has ld(1) from GNU binutils 2.15 and hence
always uses the --as-needed option when calling ld(1). Unfortunately,
between having built "binutils" and "gcc" packages, this will break
OpenPKG because the vendor cc(1) would run the OpenPKG ld(1) with an
option is (still) does not understand. The only workaround is to let our
ld(1) accept and ignore this option. Once our cc(1) from "gcc" package
is installed, the problem is gone, because our "gcc" package correctly
detects that our ld(1) still does ot understand --as-needed.
Index: ld/lexsup.c
--- ld/lexsup.c.orig 2003-03-31 20:12:52.000000000 +0200
+++ ld/lexsup.c 2004-05-05 16:52:46.000000000 +0200
@@@@ -112,7 +112,9 @@@@
#define OPTION_SPLIT_BY_RELOC (OPTION_WARN_SECTION_ALIGN + 1)
#define OPTION_SPLIT_BY_FILE (OPTION_SPLIT_BY_RELOC + 1)
#define OPTION_WHOLE_ARCHIVE (OPTION_SPLIT_BY_FILE + 1)
-#define OPTION_WRAP (OPTION_WHOLE_ARCHIVE + 1)
+#define OPTION_AS_NEEDED (OPTION_WHOLE_ARCHIVE + 1)
+#define OPTION_NO_AS_NEEDED (OPTION_AS_NEEDED + 1)
+#define OPTION_WRAP (OPTION_NO_AS_NEEDED + 1)
#define OPTION_FORCE_EXE_SUFFIX (OPTION_WRAP + 1)
#define OPTION_GC_SECTIONS (OPTION_FORCE_EXE_SUFFIX + 1)
#define OPTION_NO_GC_SECTIONS (OPTION_GC_SECTIONS + 1)
@@@@ -423,6 +425,10 @@@@
TWO_DASHES },
{ {"whole-archive", no_argument, NULL, OPTION_WHOLE_ARCHIVE},
'\0', NULL, N_("Include all objects from following archives"), TWO_DASHES },
+ { {"as-needed", no_argument, NULL, OPTION_AS_NEEDED},
+ '\0', NULL, N_("Only set DT_NEEDED for following dynamic libs if used"), TWO_DASHES },
+ { {"no-as-needed", no_argument, NULL, OPTION_NO_AS_NEEDED},
+ '\0', NULL, N_("Always set DT_NEEDED for following dynamic libs"), TWO_DASHES },
{ {"wrap", required_argument, NULL, OPTION_WRAP},
'\0', N_("SYMBOL"), N_("Use wrapper functions for SYMBOL"), TWO_DASHES },
{ {"mpc860c0", optional_argument, NULL, OPTION_MPC860C0},
@@@@ -823,6 +829,10 @@@@
case OPTION_NO_WHOLE_ARCHIVE:
whole_archive = FALSE;
break;
+ case OPTION_AS_NEEDED:
+ case OPTION_NO_AS_NEEDED:
+ einfo("%P: warning: options --as-needed and --no-as-needed still not supported\n");
+ break;
case 'O':
/* FIXME "-O " used to set the address of
section . Was this for compatibility with
@
1.8
log
@upgrading package: binutils 2.14 -> 2.15
@
text
@d23 17
d53 1
a53 1
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-*-freebsd*aout*)
d57 50
@
1.7
log
@cleanup patch and add workaround for Fedora
@
text
@a22 17
Fix the linker under Solaris/SPARC.
Index: bfd/elf64-sparc.c
--- bfd/elf64-sparc.c.orig 2003-06-20 09:42:19.000000000 +0200
+++ bfd/elf64-sparc.c 2003-06-20 09:42:40.000000000 +0200
@@@@ -2684,7 +2684,7 @@@@
overflows. We don't, but this breaks stabs debugging
info, whose relocations are only 32-bits wide. Ignore
overflows for discarded entries. */
- if (r_type == R_SPARC_32
+ if ((r_type == R_SPARC_32 || r_type == R_SPARC_DISP32)
&& _bfd_elf_section_offset (output_bfd, info, input_section,
rel->r_offset) == (bfd_vma) -1)
break;
-----------------------------------------------------------------------------
d36 1
a36 1
i[3456]86-*-bsd* | i[34567]86-*-freebsd[123] | i[34567]86-*-freebsd[123]\.* | i[34567]86-*-freebsd4\.[01234]* | i[34567]86-*-freebsd*aout*)
a39 50
-----------------------------------------------------------------------------
Accept (and ignore) --as-needed/--no-as-needed options from GNU binutils
2.15 in our GNU binutils 2.14 to resolve a chicken and egg problem under
platforms (like Fedora Core 2) which already run GNU binutils 2.15: the
vendor cc(1) knows that it has ld(1) from GNU binutils 2.15 and hence
always uses the --as-needed option when calling ld(1). Unfortunately,
between having built "binutils" and "gcc" packages, this will break
OpenPKG because the vendor cc(1) would run the OpenPKG ld(1) with an
option is (still) does not understand. The only workaround is to let our
ld(1) accept and ignore this option. Once our cc(1) from "gcc" package
is installed, the problem is gone, because our "gcc" package correctly
detects that our ld(1) still does ot understand --as-needed.
Index: ld/lexsup.c
--- ld/lexsup.c.orig 2003-03-31 20:12:52.000000000 +0200
+++ ld/lexsup.c 2004-05-05 16:52:46.000000000 +0200
@@@@ -112,7 +112,9 @@@@
#define OPTION_SPLIT_BY_RELOC (OPTION_WARN_SECTION_ALIGN + 1)
#define OPTION_SPLIT_BY_FILE (OPTION_SPLIT_BY_RELOC + 1)
#define OPTION_WHOLE_ARCHIVE (OPTION_SPLIT_BY_FILE + 1)
-#define OPTION_WRAP (OPTION_WHOLE_ARCHIVE + 1)
+#define OPTION_AS_NEEDED (OPTION_WHOLE_ARCHIVE + 1)
+#define OPTION_NO_AS_NEEDED (OPTION_AS_NEEDED + 1)
+#define OPTION_WRAP (OPTION_NO_AS_NEEDED + 1)
#define OPTION_FORCE_EXE_SUFFIX (OPTION_WRAP + 1)
#define OPTION_GC_SECTIONS (OPTION_FORCE_EXE_SUFFIX + 1)
#define OPTION_NO_GC_SECTIONS (OPTION_GC_SECTIONS + 1)
@@@@ -423,6 +425,10 @@@@
TWO_DASHES },
{ {"whole-archive", no_argument, NULL, OPTION_WHOLE_ARCHIVE},
'\0', NULL, N_("Include all objects from following archives"), TWO_DASHES },
+ { {"as-needed", no_argument, NULL, OPTION_AS_NEEDED},
+ '\0', NULL, N_("Only set DT_NEEDED for following dynamic libs if used"), TWO_DASHES },
+ { {"no-as-needed", no_argument, NULL, OPTION_NO_AS_NEEDED},
+ '\0', NULL, N_("Always set DT_NEEDED for following dynamic libs"), TWO_DASHES },
{ {"wrap", required_argument, NULL, OPTION_WRAP},
'\0', N_("SYMBOL"), N_("Use wrapper functions for SYMBOL"), TWO_DASHES },
{ {"mpc860c0", optional_argument, NULL, OPTION_MPC860C0},
@@@@ -823,6 +829,10 @@@@
case OPTION_NO_WHOLE_ARCHIVE:
whole_archive = FALSE;
break;
+ case OPTION_AS_NEEDED:
+ case OPTION_NO_AS_NEEDED:
+ einfo("%P: warning: options --as-needed and --no-as-needed still not supported\n");
+ break;
case 'O':
/* FIXME "-O " used to set the address of
section . Was this for compatibility with
@
1.6
log
@add support for FreeBSD 4.10
@
text
@d1 4
d20 7
a26 1
--- bfd/elf64-sparc.c.dist 2003-06-20 09:42:19.000000000 +0200
d37 5
d56 51
@
1.5
log
@use less intrusive patch by amodra@@bigpond.net.au for sparc-solaris
@
text
@d27 14
@
1.5.2.1
log
@add support for FreeBSD 4.10
@
text
@a26 14
Index: bfd/configure
--- bfd/configure.orig 2003-06-12 16:25:46.000000000 +0200
+++ bfd/configure 2004-04-30 22:01:31.000000000 +0200
@@@@ -5133,6 +5133,10 @@@@
i[3456]86-*-bsdi)
COREFILE=
;;
+ i[3456]86-*-freebsd4.1[0-9]*)
+ COREFILE=''
+ TRAD_HEADER='"hosts/i386bsd.h"'
+ ;;
i[3456]86-*-bsd* | i[34567]86-*-freebsd[123] | i[34567]86-*-freebsd[123]\.* | i[34567]86-*-freebsd4\.[01234]* | i[34567]86-*-freebsd*aout*)
COREFILE=trad-core.lo
TRAD_HEADER='"hosts/i386bsd.h"'
@
1.4
log
@add experimental patch to fix linker on sparc-solaris
@
text
@d16 11
a26 41
--- bfd/elflink.h.dist 2003-06-19 09:57:30.000000000 +0200
+++ bfd/elflink.h 2003-06-19 10:02:26.000000000 +0200
@@@@ -8692,7 +8692,10 @@@@
if (_bfd_elf_discard_section_eh_frame (abfd, info, eh,
elf_reloc_symbol_deleted_p,
&cookie))
+ {
ret = TRUE;
+ elf_section_data (eh)->relocs = cookie.rels;
+ }
if (cookie.rels != NULL
&& elf_section_data (eh)->relocs != cookie.rels)
--- bfd/elf-eh-frame.c.dist 2003-06-19 09:57:34.000000000 +0200
+++ bfd/elf-eh-frame.c 2003-06-19 10:01:22.000000000 +0200
@@@@ -254,6 +254,7 @@@@
unsigned int make_relative, make_lsda_relative;
bfd_size_type new_size;
unsigned int ptr_size;
+ Elf_Internal_Rela *rel;
if (sec->_raw_size == 0)
{
@@@@ -577,7 +578,8 @@@@
goto free_no_table;
ENSURE_NO_RELOCS (buf);
- if (GET_RELOC (buf) == NULL)
+ rel = GET_RELOC (buf);
+ if (rel == NULL)
/* This should not happen. */
goto free_no_table;
if ((*reloc_symbol_deleted_p) (buf - ehbuf, cookie))
@@@@ -586,6 +588,7 @@@@
be deleted. */
new_size -= hdr.length + 4;
sec_info->entry[sec_info->count].removed = 1;
+ memset (rel, 0, sizeof(*rel));
}
else
{
@
1.3
log
@drop ancient patch
@
text
@d16 41
@
1.2
log
@branding only under FreeBSD for now
@
text
@a2 9
@@@@ -441,7 +441,7 @@@@
isymend = intsym_buf + symcount;
for (esym = extsym_buf, isym = intsym_buf, shndx = extshndx_buf;
isym < isymend;
- esym += extsym_size, isym++, shndx = shndx != NULL ? shndx + 1 : NULL)
+ (char *)esym += extsym_size, isym++, shndx = shndx != NULL ? shndx + 1 : NULL)
(*bed->s->swap_symbol_in) (ibfd, esym, (const PTR) shndx, isym);
out:
@
1.2.4.1
log
@mass Merge-From-CURRENT (MFC) in preparation for OpenPKG 1.3 [class CORE only]
@
text
@d3 9
a24 11
--- bfd/elf64-sparc.c.dist 2003-06-20 09:42:19.000000000 +0200
+++ bfd/elf64-sparc.c 2003-06-20 09:42:40.000000000 +0200
@@@@ -2684,7 +2684,7 @@@@
overflows. We don't, but this breaks stabs debugging
info, whose relocations are only 32-bits wide. Ignore
overflows for discarded entries. */
- if (r_type == R_SPARC_32
+ if ((r_type == R_SPARC_32 || r_type == R_SPARC_DISP32)
&& _bfd_elf_section_offset (output_bfd, info, input_section,
rel->r_offset) == (bfd_vma) -1)
break;
@
1.1
log
@more fixes, more fixes (for Solaris)
@
text
@d12 1
a12 1
@@@@ -4235,6 +4235,18 @@@@
a18 6
+#elif defined(OPENPKG_OS_LINUX)
+ i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_LINUX;
+#elif defined(OPENPKG_OS_SOLARIS)
+ i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_SOLARIS;
+#else
+ i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_NONE;
@