summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/recipes-connectivity/avahi/files/fix_for_automake_1.11.2.patch44
-rw-r--r--meta/recipes-connectivity/dhcp/dhcp/fix-client-path.patch23
-rw-r--r--meta/recipes-connectivity/libnss-mdns/files/alignment-fix.patch13
-rw-r--r--meta/recipes-core/dbus/dbus-1.6.10/test-run-path.patch26
-rw-r--r--meta/recipes-core/gettext/gettext-0.16.1/fixchicken.patch33
-rw-r--r--meta/recipes-core/gettext/gettext-0.16.1/getline.m4.patch39
-rw-r--r--meta/recipes-core/systemd/systemd/use-rootlibdir.patch107
-rw-r--r--meta/recipes-core/util-linux/util-linux/remove-lscpu.patch37
-rw-r--r--meta/recipes-core/util-linux/util-linux/remove_sigsetmark.patch35
-rw-r--r--meta/recipes-core/util-linux/util-linux/uclibc-compile.patch15
-rw-r--r--meta/recipes-devtools/autoconf/autoconf/autoconf-x.patch38
-rw-r--r--meta/recipes-devtools/btrfs-tools/btrfs-tools/btrfs-progs-fix-parallel-build.patch30
-rw-r--r--meta/recipes-devtools/btrfs-tools/btrfs-tools/btrfs-progs-fix-parallel-build2.patch27
-rw-r--r--meta/recipes-devtools/cdrtools/cdrtools-native/no_usr_src.patch33
-rw-r--r--meta/recipes-devtools/elfutils/elfutils-0.155/elfutils-robustify.patch1756
-rw-r--r--meta/recipes-devtools/gdb/gdb/libiberty-cross.patch632
-rw-r--r--meta/recipes-devtools/perl/perl-5.14.3/asm-pageh-fix.patch21
-rw-r--r--meta/recipes-devtools/python/python-native/sys_platform_is_now_always_linux2.patch28
-rw-r--r--meta/recipes-devtools/python/python-pygobject/generate-constants.patch20
-rw-r--r--meta/recipes-devtools/qemu/files/3f08ffb4a4741d147634761dc053ed386243a0de.patch42
-rw-r--r--meta/recipes-devtools/qemu/files/enable-i386-linux-user.patch55
-rw-r--r--meta/recipes-devtools/qemu/files/init-info.patch18
-rw-r--r--meta/recipes-devtools/rpm/rpm/rpm_fix_for_automake-1.12.patch21
-rw-r--r--meta/recipes-devtools/tcf-agent/tcf-agent/fix_tcf-agent.init.patch96
-rw-r--r--meta/recipes-extended/iputils/files/arping-break-libsysfs-dependency.patch296
-rw-r--r--meta/recipes-extended/libarchive/libarchive/0003-Patch-from-upstream-rev-2516.patch63
-rw-r--r--meta/recipes-extended/procps/procps-3.2.8/pagesz-not-constant.patch24
-rw-r--r--meta/recipes-gnome/gtk+/gtk+-2.24.22/no-demos.patch15
-rw-r--r--meta/recipes-gnome/libglade/libglade-2.6.4/no-deprecation.patch13
-rw-r--r--meta/recipes-graphics/mesa/mesa/0005-llvmpipe-remove-the-power-of-two-sizeof-struct-cmd_b.patch41
-rw-r--r--meta/recipes-graphics/xorg-lib/libxxf86dga/libxxf86dga-1.1.3_fix_for_x32.patch30
-rw-r--r--meta/recipes-kernel/kmod/kmod/fix-undefined-O_CLOEXEC.patch17
-rw-r--r--meta/recipes-kernel/linux-libc-headers/linux-libc-headers/connector-msg-size-fix.patch29
-rw-r--r--meta/recipes-kernel/linux/linux-yocto/tools-perf-no-scripting.patch52
-rw-r--r--meta/recipes-support/gnutls/gnutls/gnutls-texinfo-euro.patch18
-rw-r--r--meta/recipes-support/nspr/nspr/fix-build-on-aarch64.patch101
36 files changed, 0 insertions, 3888 deletions
diff --git a/meta/recipes-connectivity/avahi/files/fix_for_automake_1.11.2.patch b/meta/recipes-connectivity/avahi/files/fix_for_automake_1.11.2.patch
deleted file mode 100644
index e7a1908a63..0000000000
--- a/meta/recipes-connectivity/avahi/files/fix_for_automake_1.11.2.patch
+++ /dev/null
@@ -1,44 +0,0 @@
1Upstream-Status: Pending
2
3automake version 1.11.2 has made use of dir variables more strict.
4the use of pkglibdir with DATA var results in automake errors.
5 This commits uses pkgdatadir var instead of pkglibdir to avoid
6the strict check errors.
7
8Fixes this error:
9service-type-database/Makefile.am:21: `pkglibdir' is not a legitimate directory for `DATA'
10autoreconf: automake failed with exit status: 1
11ERROR: autoreconf execution failed.
12
13Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
142011/12/28
15
16
17Index: avahi-0.6.30/service-type-database/Makefile.am
18===================================================================
19--- avahi-0.6.30.orig/service-type-database/Makefile.am
20+++ avahi-0.6.30/service-type-database/Makefile.am
21@@ -18,13 +18,12 @@
22 EXTRA_DIST=build-db.in service-types
23
24 pkgdata_DATA=service-types
25-pkglib_DATA=
26
27 if HAVE_PYTHON
28 if HAVE_GDBM
29
30 noinst_SCRIPTS=build-db
31-pkglib_DATA+=service-types.db
32+pkgdata_DATA+=service-types.db
33
34 build-db: build-db.in
35 $(AM_V_GEN)sed -e 's,@PYTHON\@,$(PYTHON),g' \
36@@ -41,7 +40,7 @@ endif
37 if HAVE_DBM
38
39 noinst_SCRIPTS=build-db
40-pkglib_DATA+=service-types.db.pag service-types.db.dir
41+pkgdata_DATA+=service-types.db.pag service-types.db.dir
42
43 build-db: build-db.in
44 $(AM_V_GEN)sed -e 's,@PYTHON\@,$(PYTHON),g' \
diff --git a/meta/recipes-connectivity/dhcp/dhcp/fix-client-path.patch b/meta/recipes-connectivity/dhcp/dhcp/fix-client-path.patch
deleted file mode 100644
index 97ed0d9322..0000000000
--- a/meta/recipes-connectivity/dhcp/dhcp/fix-client-path.patch
+++ /dev/null
@@ -1,23 +0,0 @@
1CLIENT_PATH is the only environment when executing dhclient-script,
2without this patch, dhclient-script won't run properly because it
3invokes ifconfig and route
4
5Upstream-Status: Inappropriate [configuration]
6
77/28/2010 - qhe
8
9diff -ru dhcp-4.1.1-P1.orig//client/Makefile.am dhcp-4.1.1-P1/client/Makefile.am
10--- dhcp-4.1.1-P1.orig//client/Makefile.am 2010-07-29 13:20:05.000000000 +0800
11+++ dhcp-4.1.1-P1/client/Makefile.am 2010-07-29 13:28:14.000000000 +0800
12@@ -10,9 +10,9 @@
13 EXTRA_DIST = $(man_MANS)
14
15 dhclient.o: dhclient.c
16- $(COMPILE) -DCLIENT_PATH='"$(sbindir)"' \
17+ $(COMPILE) -DCLIENT_PATH='"PATH=$(sbindir):$(base_sbindir):$(bindir):$(base_bindir)"' \
18 -DLOCALSTATEDIR='"$(localstatedir)"' -c dhclient.c
19
20 dhc6.o: dhc6.c
21- $(COMPILE) -DCLIENT_PATH='"$(sbindir)"' \
22+ $(COMPILE) -DCLIENT_PATH='"PATH=$(sbindir):$(base_sbindir):$(bindir):$(base_bindir)"' \
23 -DLOCALSTATEDIR='"$(localstatedir)"' -c dhc6.c
diff --git a/meta/recipes-connectivity/libnss-mdns/files/alignment-fix.patch b/meta/recipes-connectivity/libnss-mdns/files/alignment-fix.patch
deleted file mode 100644
index 70de305bac..0000000000
--- a/meta/recipes-connectivity/libnss-mdns/files/alignment-fix.patch
+++ /dev/null
@@ -1,13 +0,0 @@
1Upstream-Status: Pending
2
3--- nss-mdns-0.6/src/nss.c.orig 2005-09-25 17:27:51 +0200
4+++ nss-mdns-0.6/src/nss.c 2005-09-25 17:28:55 +0200
5@@ -456,6 +456,8 @@
6 result->h_addrtype = af;
7 result->h_length = address_length;
8
9+ idx+=(sizeof(char*)-idx%sizeof(char*)); /* Align on 32 bit boundary */
10+
11 /* Check if there's enough space for the addresses */
12 if (buflen < idx+u.data_len+sizeof(char*)*(u.count+1)) {
13 *errnop = ERANGE;
diff --git a/meta/recipes-core/dbus/dbus-1.6.10/test-run-path.patch b/meta/recipes-core/dbus/dbus-1.6.10/test-run-path.patch
deleted file mode 100644
index 5c08c9354a..0000000000
--- a/meta/recipes-core/dbus/dbus-1.6.10/test-run-path.patch
+++ /dev/null
@@ -1,26 +0,0 @@
1
2
3Signed-off-by: Björn Stenberg <bjst@enea.com>
4Upstream-Status: Pending
5
6--- a/test/Makefile.am 2012-06-15 15:25:43.000000000 +0200
7+++ b/test/Makefile.am 2012-11-16 09:24:44.263140840 +0100
8@@ -119,12 +119,13 @@
9 DBUS_TEST_HOMEDIR=@abs_top_builddir@/dbus \
10 DBUS_TEST_SYSCONFDIR=$(DESTDIR)$(sysconfdir)
11
12+ptest_run_dir = ..
13+
14 TESTS_ENVIRONMENT = \
15- DBUS_BLOCK_ON_ABORT=1 \
16- DBUS_FATAL_WARNINGS=1 \
17- DBUS_TEST_DAEMON=@abs_top_builddir@/bus/dbus-daemon$(EXEEXT) \
18- DBUS_TEST_DATA=@abs_top_builddir@/test/data \
19- DBUS_TEST_HOMEDIR=@abs_top_builddir@/dbus \
20+ DBUS_FATAL_WARNINGS=0 \
21+ DBUS_TEST_DAEMON=$(ptest_run_dir)/bus/dbus-daemon$(EXEEXT) \
22+ DBUS_TEST_DATA=$(ptest_run_dir)/test/data \
23+ DBUS_TEST_HOMEDIR=$(ptest_run_dir)/dbus \
24 $(NULL)
25
26 test_corrupt_SOURCES = corrupt.c
diff --git a/meta/recipes-core/gettext/gettext-0.16.1/fixchicken.patch b/meta/recipes-core/gettext/gettext-0.16.1/fixchicken.patch
deleted file mode 100644
index 36ce4630a2..0000000000
--- a/meta/recipes-core/gettext/gettext-0.16.1/fixchicken.patch
+++ /dev/null
@@ -1,33 +0,0 @@
1
2# Pulled from OpenEmbedded
3#
4# Commented by: Saul Wold <saul.wold@intel.com>
5
6Upstream-Status: Inappropriate [licensing]
7
8Index: gettext-tools/m4/csharpcomp.m4
9===================================================================
10RCS file: /cvs/gettext/gettext/gettext-tools/m4/csharpcomp.m4,v
11retrieving revision 1.4
12retrieving revision 1.6
13diff -u -r1.4 -r1.6
14--- a/gettext-tools/m4/csharpcomp.m4 30 Jan 2004 11:01:18 -0000 1.4
15+++ a/gettext-tools/m4/csharpcomp.m4 26 May 2004 12:15:23 -0000 1.6
16@@ -1,4 +1,4 @@
17-# csharpcomp.m4 serial 2 (gettext-0.14.1)
18+# csharpcomp.m4 serial 4 (gettext-0.15)
19 dnl Copyright (C) 2003-2004 Free Software Foundation, Inc.
20 dnl This file is free software, distributed under the terms of the GNU
21 dnl General Public License. As a special exception to the GNU General
22@@ -43,7 +43,8 @@
23 ;;
24 sscli)
25 if test -n "$HAVE_CSC_IN_PATH" \
26- && csc -help >/dev/null 2>/dev/null; then
27+ && csc -help >/dev/null 2>/dev/null \
28+ && { if csc -help 2>/dev/null | grep -i chicken > /dev/null; then false; else true; fi; }; then
29 HAVE_CSC=1
30 ac_result="csc"
31 break
32
33
diff --git a/meta/recipes-core/gettext/gettext-0.16.1/getline.m4.patch b/meta/recipes-core/gettext/gettext-0.16.1/getline.m4.patch
deleted file mode 100644
index bf995bc622..0000000000
--- a/meta/recipes-core/gettext/gettext-0.16.1/getline.m4.patch
+++ /dev/null
@@ -1,39 +0,0 @@
1
2# Pulled from OpenEmbedded
3#
4# Commented by: Saul Wold <saul.wold@intel.com>
5
6Upstream-Status: Inappropriate [licensing]
7
8--- /gettext-tools/m4/orig-getline.m4 2003-07-18 18:11:37.000000000 +0300
9+++ /gettext-tools/m4/getline.m4 2007-02-03 13:33:41.000000000 +0200
10@@ -42,12 +42,23 @@
11 return 1;
12 len = getline (&line, &siz, in);
13 exit ((len == 4 && line && strcmp (line, "foo\n") == 0) ? 0 : 1);
14- }
15- ], am_cv_func_working_getline=yes dnl The library version works.
16- , am_cv_func_working_getline=no dnl The library version does NOT work.
17- , am_cv_func_working_getline=no dnl We're cross compiling.
18- )])
19- fi
20+ }
21+ ], am_cv_func_working_getline=yes dnl The library version works.
22+ , am_cv_func_working_getline=no dnl The library version does NOT work.
23+! , dnl We're cross compiling. Assume ir works on glibc2 systems.
24+! [AC_EGREP_CPP([Lucky GNU user],
25+! [
26+! #include <features.h>
27+! #ifdef __GNU_LIBRARY__
28+! #if (__GLIBC__ >= 2)
29+! Lucky GNU user
30+! #endif
31+! #endif
32+! ],
33+! [am_cv_func_working_getline=yes],
34+! [am_cv_func_working_getline=no])]
35+ )])
36+ fi
37
38 if test $am_cv_func_working_getline = no; then
39 dnl We must choose a different name for our function, since on ELF systems
diff --git a/meta/recipes-core/systemd/systemd/use-rootlibdir.patch b/meta/recipes-core/systemd/systemd/use-rootlibdir.patch
deleted file mode 100644
index 4c471b673b..0000000000
--- a/meta/recipes-core/systemd/systemd/use-rootlibdir.patch
+++ /dev/null
@@ -1,107 +0,0 @@
1Upstream-Status: Undecided
2
3This patch removes some of hardcoded references to /lib
4and /usr/lib since on some architectures it should be
5/lib64 and /usr/lib64 atleast in OE
6
7I am not sure about the intention of hardcoded values
8thats why status is undecided
9
10Signed-off-by: Khem Raj <raj.khem@gmail.com>
11
12Index: git/Makefile.am
13===================================================================
14--- git.orig/Makefile.am 2012-09-22 11:07:58.811981199 -0700
15+++ git/Makefile.am 2012-09-22 11:09:11.267983956 -0700
16@@ -64,25 +64,25 @@
17
18 # Our own, non-special dirs
19 pkgsysconfdir=$(sysconfdir)/systemd
20-userunitdir=$(prefix)/lib/systemd/user
21-userpresetdir=$(prefix)/lib/systemd/user-preset
22-tmpfilesdir=$(prefix)/lib/tmpfiles.d
23-sysctldir=$(prefix)/lib/sysctl.d
24-usergeneratordir=$(prefix)/lib/systemd/user-generators
25+userunitdir=$(prefix)/$(rootlibdir)/systemd/user
26+userpresetdir=$(prefix)/$(rootlibdir)/systemd/user-preset
27+tmpfilesdir=$(prefix)/$(rootlibdir)/tmpfiles.d
28+sysctldir=$(prefix)/$(rootlibdir)/sysctl.d
29+usergeneratordir=$(prefix)/$(rootlibdir)/systemd/user-generators
30 pkgincludedir=$(includedir)/systemd
31 systemgeneratordir=$(rootlibexecdir)/system-generators
32 systemshutdowndir=$(rootlibexecdir)/system-shutdown
33 systemsleepdir=$(rootlibexecdir)/system-sleep
34-systemunitdir=$(rootprefix)/lib/systemd/system
35-systempresetdir=$(rootprefix)/lib/systemd/system-preset
36-udevlibexecdir=$(rootprefix)/lib/udev
37+systemunitdir=$(rootprefix)/$(rootlibdir)/systemd/system
38+systempresetdir=$(rootprefix)/$(rootlibdir)/systemd/system-preset
39+udevlibexecdir=$(rootprefix)/$(rootlibdir)/udev
40 udevhomedir = $(udevlibexecdir)
41 udevrulesdir = $(udevlibexecdir)/rules.d
42
43 # And these are the special ones for /
44 rootprefix=@rootprefix@
45 rootbindir=$(rootprefix)/bin
46-rootlibexecdir=$(rootprefix)/lib/systemd
47+rootlibexecdir=$(rootprefix)/$(rootlibdir)/systemd
48
49 CLEANFILES = $(BUILT_SOURCES)
50 EXTRA_DIST =
51@@ -132,7 +132,7 @@
52 -DSYSTEMD_STDIO_BRIDGE_BINARY_PATH=\"$(bindir)/systemd-stdio-bridge\" \
53 -DROOTPREFIX=\"$(rootprefix)\" \
54 -DRUNTIME_DIR=\"/run\" \
55- -DRANDOM_SEED=\"$(localstatedir)/lib/random-seed\" \
56+ -DRANDOM_SEED=\"$(localstatedir)/$(rootlibdir)/random-seed\" \
57 -DSYSTEMD_CRYPTSETUP_PATH=\"$(rootlibexecdir)/systemd-cryptsetup\" \
58 -DSYSTEM_GENERATOR_PATH=\"$(systemgeneratordir)\" \
59 -DUSER_GENERATOR_PATH=\"$(usergeneratordir)\" \
60@@ -2692,7 +2692,7 @@
61
62 binfmt-install-data-hook:
63 $(MKDIR_P) -m 0755 \
64- $(DESTDIR)$(prefix)/lib/binfmt.d \
65+ $(DESTDIR)$(prefix)/$(rootlibdir)/binfmt.d \
66 $(DESTDIR)$(sysconfdir)/binfmt.d \
67 $(DESTDIR)$(systemunitdir)/sysinit.target.wants
68 ( cd $(DESTDIR)$(systemunitdir)/sysinit.target.wants && \
69@@ -3107,7 +3107,7 @@
70
71 timedated-install-data-hook:
72 $(MKDIR_P) -m 0755 \
73- $(DESTDIR)$(prefix)/lib/systemd/ntp-units.d \
74+ $(DESTDIR)$(prefix)/$(rootlibdir)/systemd/ntp-units.d \
75 $(DESTDIR)$(sysconfdir)/systemd/ntp-units.d
76 ( cd $(DESTDIR)$(systemunitdir) && \
77 rm -f dbus-org.freedesktop.timedate1.service && \
78@@ -3337,7 +3337,7 @@
79 logind-install-data-hook:
80 $(MKDIR_P) -m 0755 \
81 $(DESTDIR)$(systemunitdir)/multi-user.target.wants \
82- $(DESTDIR)$(localstatedir)/lib/systemd
83+ $(DESTDIR)$(localstatedir)/$(rootlibdir)/systemd
84 ( cd $(DESTDIR)$(systemunitdir) && \
85 rm -f dbus-org.freedesktop.login1.service && \
86 $(LN_S) systemd-logind.service dbus-org.freedesktop.login1.service)
87@@ -3494,7 +3494,7 @@
88 -e 's,@PACKAGE_VERSION\@,$(PACKAGE_VERSION),g' \
89 -e 's,@PACKAGE_NAME\@,$(PACKAGE_NAME),g' \
90 -e 's,@PACKAGE_URL\@,$(PACKAGE_URL),g' \
91- -e 's,@RANDOM_SEED\@,$(localstatedir)/lib/random-seed,g' \
92+ -e 's,@RANDOM_SEED\@,$(localstatedir)/$(rootlibdir)/random-seed,g' \
93 -e 's,@prefix\@,$(prefix),g' \
94 -e 's,@exec_prefix\@,$(exec_prefix),g' \
95 -e 's,@libdir\@,$(libdir),g' \
96@@ -3619,9 +3619,9 @@
97 $(MKDIR_P) -m 0755 \
98 $(DESTDIR)$(tmpfilesdir) \
99 $(DESTDIR)$(sysconfdir)/tmpfiles.d \
100- $(DESTDIR)$(prefix)/lib/modules-load.d \
101+ $(DESTDIR)$(prefix)/$(rootlibdir)/modules-load.d \
102 $(DESTDIR)$(sysconfdir)/modules-load.d \
103- $(DESTDIR)$(prefix)/lib/sysctl.d \
104+ $(DESTDIR)$(prefix)/$(rootlibdir)/sysctl.d \
105 $(DESTDIR)$(sysconfdir)/sysctl.d \
106 $(DESTDIR)$(systemshutdowndir) \
107 $(DESTDIR)$(systemsleepdir) \
diff --git a/meta/recipes-core/util-linux/util-linux/remove-lscpu.patch b/meta/recipes-core/util-linux/util-linux/remove-lscpu.patch
deleted file mode 100644
index ddf14a50d1..0000000000
--- a/meta/recipes-core/util-linux/util-linux/remove-lscpu.patch
+++ /dev/null
@@ -1,37 +0,0 @@
1Upstream-Status: Inappropriate [distribution]
2
3Take out lscpu stuff from the code
4
5Signed-off-by: Saul Wold <sgw@linux.intel.com>
6
7Index: util-linux-2.22.1/configure.ac
8===================================================================
9--- util-linux-2.22.1.orig/configure.ac
10+++ util-linux-2.22.1/configure.ac
11@@ -937,7 +937,7 @@ UL_REQUIRES_BUILD([lsblk], [libmount])
12 AM_CONDITIONAL(BUILD_LSBLK, test "x$build_lsblk" = xyes)
13
14
15-UL_BUILD_INIT([lscpu], [check])
16+UL_BUILD_INIT([lscpu], [no])
17 UL_REQUIRES_LINUX([lscpu])
18 UL_REQUIRES_HAVE([lscpu], [cpu_set_t], [cpu_set_t type])
19 AM_CONDITIONAL(BUILD_LSCPU, test "x$build_lscpu" = xyes)
20Index: util-linux-2.22.1/sys-utils/Makemodule.am
21===================================================================
22--- util-linux-2.22.1.orig/sys-utils/Makemodule.am
23+++ util-linux-2.22.1/sys-utils/Makemodule.am
24@@ -224,13 +224,6 @@ swapoff_CFLAGS = $(AM_CFLAGS) -I$(ul_lib
25 swapoff_LDADD = $(LDADD) libmount.la
26 endif
27
28-if BUILD_LSCPU
29-usrbin_exec_PROGRAMS += lscpu
30-lscpu_SOURCES = sys-utils/lscpu.c
31-lscpu_LDADD = $(LDADD) libcommon.la
32-dist_man_MANS += sys-utils/lscpu.1
33-endif
34-
35 if BUILD_CHCPU
36 sbin_PROGRAMS += chcpu
37 chcpu_SOURCES = sys-utils/chcpu.c
diff --git a/meta/recipes-core/util-linux/util-linux/remove_sigsetmark.patch b/meta/recipes-core/util-linux/util-linux/remove_sigsetmark.patch
deleted file mode 100644
index 02e4d16ff7..0000000000
--- a/meta/recipes-core/util-linux/util-linux/remove_sigsetmark.patch
+++ /dev/null
@@ -1,35 +0,0 @@
1simpleinit: remove deprecated sigsetmask()
2
3The sigsetmask() is deprecated in favor of sigprocmask().
4
5This is not needed upstream since simpleinit is removed from
6util-linux-ng master
7
8Signed-off-by: Khem Raj <raj.khem@gmail.com>
9
10Upstream-Status: Inappropriate
11
12Index: util-linux-2.19.1/simpleinit/shutdown.c
13===================================================================
14--- util-linux-2.19.1.orig/simpleinit/shutdown.c 2011-03-04 03:47:47.000000000 -0800
15+++ util-linux-2.19.1/simpleinit/shutdown.c 2011-07-06 08:43:39.183849752 -0700
16@@ -145,7 +145,7 @@
17 {
18 int c, i, fd;
19 char *ptr;
20-
21+ sigset_t sigmask;
22 i = getdtablesize ();
23 for (fd = 3; fd < i; fd++) close (fd);
24 if (getpid () == 1)
25@@ -153,7 +153,9 @@
26 for (fd = 0; fd < 3; fd++) close (fd);
27 while (1) wait (NULL); /* Grim reaper never stops */
28 }
29- sigsetmask (0); /* simpleinit(8) blocks all signals: undo for ALRM */
30+ /* simpleinit(8) blocks all signals: undo for ALRM */
31+ sigemptyset(&sigmask);
32+ sigprocmask (SIG_SETMASK, &sigmask, NULL);
33 for (i = 1; i < NSIG; i++) signal (i, SIG_DFL);
34
35 setlocale(LC_ALL, "");
diff --git a/meta/recipes-core/util-linux/util-linux/uclibc-compile.patch b/meta/recipes-core/util-linux/util-linux/uclibc-compile.patch
deleted file mode 100644
index 75774d8200..0000000000
--- a/meta/recipes-core/util-linux/util-linux/uclibc-compile.patch
+++ /dev/null
@@ -1,15 +0,0 @@
1Upstream-Status: Inappropriate [embedded specific]
2
3Index: util-linux-ng-2.16/misc-utils/cal.c
4===================================================================
5--- util-linux-ng-2.16.orig/misc-utils/cal.c 2009-07-03 16:20:01.000000000 -0700
6+++ util-linux-ng-2.16/misc-utils/cal.c 2009-07-18 23:21:37.000000000 -0700
7@@ -407,7 +407,7 @@
8 strcpy(day_headings,"");
9 strcpy(j_day_headings,"");
10
11-#ifdef HAVE_LANGINFO_H
12+#ifdef HAVE_LANGINFO_H && !defined(__UCLIBC__)
13 # define weekday(wd) nl_langinfo(ABDAY_1+wd)
14 #else
15 # define weekday(wd) _time_info->abbrev_wkday[wd]
diff --git a/meta/recipes-devtools/autoconf/autoconf/autoconf-x.patch b/meta/recipes-devtools/autoconf/autoconf/autoconf-x.patch
deleted file mode 100644
index 6ebef0a540..0000000000
--- a/meta/recipes-devtools/autoconf/autoconf/autoconf-x.patch
+++ /dev/null
@@ -1,38 +0,0 @@
1Upstream-Status: Pending
2
3Index: lib/autoconf/libs.m4
4===================================================================
5RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/libs.m4,v
6retrieving revision 1.13
7diff -p -u -r1.13 libs.m4
8--- autoconf-2.59/lib/autoconf/libs.m4 6 Sep 2005 15:34:06 -0000 1.13
9+++ autoconf-2.59/lib/autoconf/libs.m4 18 Sep 2005 17:09:58 -0000
10@@ -265,13 +265,13 @@ ac_x_header_dirs='
11 /usr/openwin/share/include'
12
13 if test "$ac_x_includes" = no; then
14- # Guess where to find include files, by looking for Intrinsic.h.
15+ # Guess where to find include files, by looking for Xlib.h.
16 # First, try using that file with no special directory specified.
17- AC_PREPROC_IFELSE([AC_LANG_SOURCE([@%:@include <X11/Intrinsic.h>])],
18+ AC_PREPROC_IFELSE([AC_LANG_SOURCE([@%:@include <X11/Xlib.h>])],
19 [# We can compile using X headers with no special include directory.
20 ac_x_includes=],
21 [for ac_dir in $ac_x_header_dirs; do
22- if test -r "$ac_dir/X11/Intrinsic.h"; then
23+ if test -r "$ac_dir/X11/Xlib.h"; then
24 ac_x_includes=$ac_dir
25 break
26 fi
27@@ -284,9 +284,9 @@ if test "$ac_x_libraries" = no; then
28 # Don't add to $LIBS permanently.
29 ac_save_LIBS=$LIBS
30- LIBS="-lXt $LIBS"
31- AC_LINK_IFELSE([AC_LANG_PROGRAM([@%:@include <X11/Intrinsic.h>],
32- [XtMalloc (0)])],
33+ LIBS="-lX11 $LIBS"
34+ AC_LINK_IFELSE([AC_LANG_PROGRAM([@%:@include <X11/Xlib.h>],
35+ [XrmInitialize ()])],
36 [LIBS=$ac_save_LIBS
37 # We can link X programs with no special library path.
38 ac_x_libraries=],
diff --git a/meta/recipes-devtools/btrfs-tools/btrfs-tools/btrfs-progs-fix-parallel-build.patch b/meta/recipes-devtools/btrfs-tools/btrfs-tools/btrfs-progs-fix-parallel-build.patch
deleted file mode 100644
index e461cdf447..0000000000
--- a/meta/recipes-devtools/btrfs-tools/btrfs-tools/btrfs-progs-fix-parallel-build.patch
+++ /dev/null
@@ -1,30 +0,0 @@
1btrfs-progs: fix parallel build
2
3Upstream-Status: Submitted [http://permalink.gmane.org/gmane.comp.file-systems.btrfs/28197]
4
5Parallel execution of "make install" may fail due to late creation of
6version.h, fix it by adding the dependence on version.h.
7
8The fix is similare to 7aaf00fc[btrfs-progs: fix parallel build]
9
10Signed-off-by: Roy.Li <rongqing.li@windriver.com>
11---
12 Makefile | 2 +-
13 1 file changed, 1 insertion(+), 1 deletion(-)
14
15diff --git a/Makefile b/Makefile
16index c43cb68..40ef205 100644
17--- a/Makefile
18+++ b/Makefile
19@@ -190,7 +190,7 @@ clean :
20 $(libs) $(lib_links)
21 $(Q)$(MAKE) $(MAKEOPTS) -C man $@
22
23-install: $(libs) $(progs) install-man
24+install: version.h $(libs) $(progs) install-man
25 $(INSTALL) -m755 -d $(DESTDIR)$(bindir)
26 $(INSTALL) $(progs) $(DESTDIR)$(bindir)
27 $(INSTALL) -m755 -d $(DESTDIR)$(libdir)
28--
291.7.10.4
30
diff --git a/meta/recipes-devtools/btrfs-tools/btrfs-tools/btrfs-progs-fix-parallel-build2.patch b/meta/recipes-devtools/btrfs-tools/btrfs-tools/btrfs-progs-fix-parallel-build2.patch
deleted file mode 100644
index af1a7606c4..0000000000
--- a/meta/recipes-devtools/btrfs-tools/btrfs-tools/btrfs-progs-fix-parallel-build2.patch
+++ /dev/null
@@ -1,27 +0,0 @@
1btrfs-progs: Fix parallel build
2
3Upstream-Status: Pending
4
5"make btrfs.o" fails unable to find version.h.
6
7This adds version.h as a dependency for all .o files and fixes various parallel
8build failures.
9
10RP 20/9/2013
11---
12 Makefile | 2 +-
13 1 file changed, 1 insertion(+), 1 deletion(-)
14
15Index: git/Makefile
16===================================================================
17--- git.orig/Makefile 2013-09-20 14:45:34.307723221 +0000
18+++ git/Makefile 2013-09-20 16:06:45.503611030 +0000
19@@ -76,7 +76,7 @@
20 check = true
21 endif
22
23-.c.o:
24+%.o: %.c version.h
25 $(Q)$(check) $<
26 @echo " [CC] $@"
27 $(Q)$(CC) $(DEPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c $<
diff --git a/meta/recipes-devtools/cdrtools/cdrtools-native/no_usr_src.patch b/meta/recipes-devtools/cdrtools/cdrtools-native/no_usr_src.patch
deleted file mode 100644
index 7341aecd6c..0000000000
--- a/meta/recipes-devtools/cdrtools/cdrtools-native/no_usr_src.patch
+++ /dev/null
@@ -1,33 +0,0 @@
1From 8d835cc7185e7cd878712d8208e6aa29b227ceff Mon Sep 17 00:00:00 2001
2From: Andrei Dinu <andrei.adrianx.dinu@intel.com>
3Date: Thu, 9 May 2013 16:03:59 +0300
4Subject: [PATCH] Remove hard-coded references to /usr/src/linux/include to
5 avoid host contamination.
6
7Upstream-Status: Innappropriate [configuration]
8
9Signed-off-by: Andrei Dinu <andrei.adrianx.dinu@intel.com>
10Signed-off-by: Scott Garman <scott.a.garman@intel.com>
11---
12 cdrtools-3.00/DEFAULTS/Defaults.gnu | 2 +-
13 1 file changed, 1 insertion(+), 1 deletion(-)
14 mode change 100644 => 100755 cdrtools-3.00/DEFAULTS/Defaults.gnu
15
16diff --git a/DEFAULTS/Defaults.gnu b/cdrtools-3.00/DEFAULTS/Defaults.gnu
17old mode 100644
18new mode 100755
19index e3e102b..8a18209
20--- a/DEFAULTS/Defaults.gnu
21+++ b/DEFAULTS/Defaults.gnu
22@@ -28,7 +28,7 @@ DEFLINKMODE= static
23 ###########################################################################
24 CWARNOPTS=
25
26-DEFINCDIRS= $(SRCROOT)/include /usr/src/linux/include
27+DEFINCDIRS= $(SRCROOT)/include
28 LDPATH= -L/opt/schily/lib
29 #RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR)
30 RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib
31--
321.7.9.5
33
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.155/elfutils-robustify.patch b/meta/recipes-devtools/elfutils/elfutils-0.155/elfutils-robustify.patch
deleted file mode 100644
index 9eee98412d..0000000000
--- a/meta/recipes-devtools/elfutils/elfutils-0.155/elfutils-robustify.patch
+++ /dev/null
@@ -1,1756 +0,0 @@
1--- elfutils/libdwfl/ChangeLog
2+++ elfutils/libdwfl/ChangeLog
3@@ -52,6 +52,11 @@
4 * dwfl_module_getdwarf.c (open_elf): Clear errno before CBFAIL.
5 Reported by Kurt Roeckx <kurt@roeckx.be>.
6
7+2011-03-23 Petr Machata <pmachata@redhat.com>
8+
9+ * relocate.c (relocate_section): Use gelf_fsize instead of relying
10+ on shdr->sh_entsize.
11+
12 2011-02-11 Roland McGrath <roland@redhat.com>
13
14 * linux-kernel-modules.c (try_kernel_name): Try .gz, .bz2, .xz
15--- elfutils/libdwfl/relocate.c
16+++ elfutils/libdwfl/relocate.c
17@@ -1,5 +1,5 @@
18 /* Relocate debug information.
19- Copyright (C) 2005-2010 Red Hat, Inc.
20+ Copyright (C) 2005-2011 Red Hat, Inc.
21 This file is part of elfutils.
22
23 This file is free software; you can redistribute it and/or modify
24@@ -457,7 +457,10 @@ relocate_section (Dwfl_Module *mod, Elf
25 }
26 }
27
28- size_t nrels = shdr->sh_size / shdr->sh_entsize;
29+ size_t sh_entsize
30+ = gelf_fsize (relocated, shdr->sh_type == SHT_REL ? ELF_T_REL : ELF_T_RELA,
31+ 1, EV_CURRENT);
32+ size_t nrels = shdr->sh_size / sh_entsize;
33 size_t complete = 0;
34 if (shdr->sh_type == SHT_REL)
35 for (size_t relidx = 0; !result && relidx < nrels; ++relidx)
36@@ -559,7 +562,7 @@ relocate_section (Dwfl_Module *mod, Elf
37 nrels = next;
38 }
39
40- shdr->sh_size = reldata->d_size = nrels * shdr->sh_entsize;
41+ shdr->sh_size = reldata->d_size = nrels * sh_entsize;
42 gelf_update_shdr (scn, shdr);
43 }
44
45--- elfutils/libelf/ChangeLog
46+++ elfutils/libelf/ChangeLog
47@@ -703,10 +703,53 @@
48 If section content hasn't been read yet, do it before looking for the
49 block size. If no section data present, infer size of section header.
50
51+2005-05-14 Jakub Jelinek <jakub@redhat.com>
52+
53+ * libelfP.h (INVALID_NDX): Define.
54+ * gelf_getdyn.c (gelf_getdyn): Use it. Remove ndx < 0 test if any.
55+ * gelf_getlib.c (gelf_getlib): Likewise.
56+ * gelf_getmove.c (gelf_getmove): Likewise.
57+ * gelf_getrel.c (gelf_getrel): Likewise.
58+ * gelf_getrela.c (gelf_getrela): Likewise.
59+ * gelf_getsym.c (gelf_getsym): Likewise.
60+ * gelf_getsyminfo.c (gelf_getsyminfo): Likewise.
61+ * gelf_getsymshndx.c (gelf_getsymshndx): Likewise.
62+ * gelf_getversym.c (gelf_getversym): Likewise.
63+ * gelf_update_dyn.c (gelf_update_dyn): Likewise.
64+ * gelf_update_lib.c (gelf_update_lib): Likewise.
65+ * gelf_update_move.c (gelf_update_move): Likewise.
66+ * gelf_update_rel.c (gelf_update_rel): Likewise.
67+ * gelf_update_rela.c (gelf_update_rela): Likewise.
68+ * gelf_update_sym.c (gelf_update_sym): Likewise.
69+ * gelf_update_syminfo.c (gelf_update_syminfo): Likewise.
70+ * gelf_update_symshndx.c (gelf_update_symshndx): Likewise.
71+ * gelf_update_versym.c (gelf_update_versym): Likewise.
72+ * elf_newscn.c (elf_newscn): Check for overflow.
73+ * elf32_updatefile.c (__elfw2(LIBELFBITS,updatemmap)): Likewise.
74+ (__elfw2(LIBELFBITS,updatefile)): Likewise.
75+ * elf_begin.c (file_read_elf): Likewise.
76+ * elf32_newphdr.c (elfw2(LIBELFBITS,newphdr)): Likewise.
77+ * elf_getarsym.c (elf_getarsym): Likewise.
78+ * elf32_getshdr.c (elfw2(LIBELFBITS,getshdr)): Likewise.
79 2005-05-11 Ulrich Drepper <drepper@redhat.com>
80
81 * elf.h: Update again.
82
83+2005-05-17 Jakub Jelinek <jakub@redhat.com>
84+
85+ * elf32_getphdr.c (elfw2(LIBELFBITS,getphdr)): Check if program header
86+ table fits into object's bounds.
87+ * elf_getshstrndx.c (elf_getshstrndx): Add elf->start_offset to
88+ elf->map_address. Check if first section header fits into object's
89+ bounds.
90+ * elf32_getshdr.c (elfw2(LIBELFBITS,getshdr)):
91+ Check if section header table fits into object's bounds.
92+ * elf_begin.c (get_shnum): Ensure section headers fits into
93+ object's bounds.
94+ (file_read_elf): Make sure scncnt is small enough to allocate both
95+ ElfXX_Shdr and Elf_Scn array. Make sure section and program header
96+ tables fit into object's bounds. Avoid memory leak on failure.
97+
98 2005-05-09 Ulrich Drepper <drepper@redhat.com>
99
100 * elf.h: Update from glibc.
101--- elfutils/libelf/elf32_getphdr.c
102+++ elfutils/libelf/elf32_getphdr.c
103@@ -93,6 +93,16 @@ __elfw2(LIBELFBITS,getphdr_wrlock) (elf)
104
105 if (elf->map_address != NULL)
106 {
107+ /* First see whether the information in the ELF header is
108+ valid and it does not ask for too much. */
109+ if (unlikely (ehdr->e_phoff >= elf->maximum_size)
110+ || unlikely (elf->maximum_size - ehdr->e_phoff < size))
111+ {
112+ /* Something is wrong. */
113+ __libelf_seterrno (ELF_E_INVALID_PHDR);
114+ goto out;
115+ }
116+
117 /* All the data is already mapped. Use it. */
118 void *file_phdr = ((char *) elf->map_address
119 + elf->start_offset + ehdr->e_phoff);
120--- elfutils/libelf/elf32_getshdr.c
121+++ elfutils/libelf/elf32_getshdr.c
122@@ -60,7 +60,8 @@ load_shdr_wrlock (Elf_Scn *scn)
123 goto out;
124
125 size_t shnum;
126- if (__elf_getshdrnum_rdlock (elf, &shnum) != 0)
127+ if (__elf_getshdrnum_rdlock (elf, &shnum) != 0
128+ || shnum > SIZE_MAX / sizeof (ElfW2(LIBELFBITS,Shdr)))
129 goto out;
130 size_t size = shnum * sizeof (ElfW2(LIBELFBITS,Shdr));
131
132@@ -77,6 +78,16 @@ load_shdr_wrlock (Elf_Scn *scn)
133
134 if (elf->map_address != NULL)
135 {
136+ /* First see whether the information in the ELF header is
137+ valid and it does not ask for too much. */
138+ if (unlikely (ehdr->e_shoff >= elf->maximum_size)
139+ || unlikely (elf->maximum_size - ehdr->e_shoff < size))
140+ {
141+ /* Something is wrong. */
142+ __libelf_seterrno (ELF_E_INVALID_SECTION_HEADER);
143+ goto free_and_out;
144+ }
145+
146 ElfW2(LIBELFBITS,Shdr) *notcvt;
147
148 /* All the data is already mapped. If we could use it
149--- elfutils/libelf/elf32_newphdr.c
150+++ elfutils/libelf/elf32_newphdr.c
151@@ -114,6 +114,12 @@ elfw2(LIBELFBITS,newphdr) (elf, count)
152 || count == PN_XNUM
153 || elf->state.ELFW(elf,LIBELFBITS).phdr == NULL)
154 {
155+ if (unlikely (count > SIZE_MAX / sizeof (ElfW2(LIBELFBITS,Phdr))))
156+ {
157+ result = NULL;
158+ goto out;
159+ }
160+
161 /* Allocate a new program header with the appropriate number of
162 elements. */
163 result = (ElfW2(LIBELFBITS,Phdr) *)
164--- elfutils/libelf/elf32_updatefile.c
165+++ elfutils/libelf/elf32_updatefile.c
166@@ -202,6 +202,9 @@ __elfw2(LIBELFBITS,updatemmap) (Elf *elf
167 /* Write all the sections. Well, only those which are modified. */
168 if (shnum > 0)
169 {
170+ if (unlikely (shnum > SIZE_MAX / sizeof (Elf_Scn *)))
171+ return 1;
172+
173 Elf_ScnList *list = &elf->state.ELFW(elf,LIBELFBITS).scns;
174 Elf_Scn **scns = (Elf_Scn **) alloca (shnum * sizeof (Elf_Scn *));
175 char *const shdr_start = ((char *) elf->map_address + elf->start_offset
176@@ -624,6 +627,10 @@ __elfw2(LIBELFBITS,updatefile) (Elf *elf
177 /* Write all the sections. Well, only those which are modified. */
178 if (shnum > 0)
179 {
180+ if (unlikely (shnum > SIZE_MAX / (sizeof (Elf_Scn *)
181+ + sizeof (ElfW2(LIBELFBITS,Shdr)))))
182+ return 1;
183+
184 off_t shdr_offset = elf->start_offset + ehdr->e_shoff;
185 #if EV_NUM != 2
186 xfct_t shdr_fctp = __elf_xfctstom[__libelf_version - 1][EV_CURRENT - 1][ELFW(ELFCLASS, LIBELFBITS) - 1][ELF_T_SHDR];
187--- elfutils/libelf/elf_begin.c
188+++ elfutils/libelf/elf_begin.c
189@@ -144,7 +144,8 @@ get_shnum (void *map_address, unsigned c
190
191 if (unlikely (result == 0) && ehdr.e32->e_shoff != 0)
192 {
193- if (ehdr.e32->e_shoff + sizeof (Elf32_Shdr) > maxsize)
194+ if (unlikely (ehdr.e32->e_shoff >= maxsize)
195+ || unlikely (maxsize - ehdr.e32->e_shoff < sizeof (Elf32_Shdr)))
196 /* Cannot read the first section header. */
197 return 0;
198
199@@ -192,7 +193,8 @@ get_shnum (void *map_address, unsigned c
200
201 if (unlikely (result == 0) && ehdr.e64->e_shoff != 0)
202 {
203- if (ehdr.e64->e_shoff + sizeof (Elf64_Shdr) > maxsize)
204+ if (unlikely (ehdr.e64->e_shoff >= maxsize)
205+ || unlikely (ehdr.e64->e_shoff + sizeof (Elf64_Shdr) > maxsize))
206 /* Cannot read the first section header. */
207 return 0;
208
209@@ -264,6 +266,15 @@ file_read_elf (int fildes, void *map_add
210 /* Could not determine the number of sections. */
211 return NULL;
212
213+ /* Check for too many sections. */
214+ if (e_ident[EI_CLASS] == ELFCLASS32)
215+ {
216+ if (scncnt > SIZE_MAX / (sizeof (Elf_Scn) + sizeof (Elf32_Shdr)))
217+ return NULL;
218+ }
219+ else if (scncnt > SIZE_MAX / (sizeof (Elf_Scn) + sizeof (Elf64_Shdr)))
220+ return NULL;
221+
222 /* We can now allocate the memory. Even if there are no section headers,
223 we allocate space for a zeroth section in case we need it later. */
224 const size_t scnmax = (scncnt ?: (cmd == ELF_C_RDWR || cmd == ELF_C_RDWR_MMAP)
225@@ -303,6 +314,16 @@ file_read_elf (int fildes, void *map_add
226 {
227 /* We can use the mmapped memory. */
228 elf->state.elf32.ehdr = ehdr;
229+
230+ if (unlikely (ehdr->e_shoff >= maxsize)
231+ || unlikely (maxsize - ehdr->e_shoff
232+ < scncnt * sizeof (Elf32_Shdr)))
233+ {
234+ free_and_out:
235+ free (elf);
236+ __libelf_seterrno (ELF_E_INVALID_FILE);
237+ return NULL;
238+ }
239 elf->state.elf32.shdr
240 = (Elf32_Shdr *) ((char *) ehdr + ehdr->e_shoff);
241
242@@ -389,6 +410,11 @@ file_read_elf (int fildes, void *map_add
243 {
244 /* We can use the mmapped memory. */
245 elf->state.elf64.ehdr = ehdr;
246+
247+ if (unlikely (ehdr->e_shoff >= maxsize)
248+ || unlikely (ehdr->e_shoff
249+ + scncnt * sizeof (Elf32_Shdr) > maxsize))
250+ goto free_and_out;
251 elf->state.elf64.shdr
252 = (Elf64_Shdr *) ((char *) ehdr + ehdr->e_shoff);
253
254--- elfutils/libelf/elf_getarsym.c
255+++ elfutils/libelf/elf_getarsym.c
256@@ -181,6 +181,9 @@ elf_getarsym (elf, ptr)
257 size_t index_size = atol (tmpbuf);
258
259 if (SARMAG + sizeof (struct ar_hdr) + index_size > elf->maximum_size
260+#if SIZE_MAX <= 4294967295U
261+ || n >= SIZE_MAX / sizeof (Elf_Arsym)
262+#endif
263 || n * w > index_size)
264 {
265 /* This index table cannot be right since it does not fit into
266--- elfutils/libelf/elf_getshdrstrndx.c
267+++ elfutils/libelf/elf_getshdrstrndx.c
268@@ -104,10 +104,25 @@ elf_getshdrstrndx (elf, dst)
269 if (elf->map_address != NULL
270 && elf->state.elf32.ehdr->e_ident[EI_DATA] == MY_ELFDATA
271 && (ALLOW_UNALIGNED
272- || (((size_t) ((char *) elf->map_address + offset))
273+ || (((size_t) ((char *) elf->map_address
274+ + elf->start_offset + offset))
275 & (__alignof__ (Elf32_Shdr) - 1)) == 0))
276- /* We can directly access the memory. */
277- num = ((Elf32_Shdr *) (elf->map_address + offset))->sh_link;
278+ {
279+ /* First see whether the information in the ELF header is
280+ valid and it does not ask for too much. */
281+ if (unlikely (elf->maximum_size - offset
282+ < sizeof (Elf32_Shdr)))
283+ {
284+ /* Something is wrong. */
285+ __libelf_seterrno (ELF_E_INVALID_SECTION_HEADER);
286+ result = -1;
287+ goto out;
288+ }
289+
290+ /* We can directly access the memory. */
291+ num = ((Elf32_Shdr *) (elf->map_address + elf->start_offset
292+ + offset))->sh_link;
293+ }
294 else
295 {
296 /* We avoid reading in all the section headers. Just read
297@@ -142,10 +157,25 @@ elf_getshdrstrndx (elf, dst)
298 if (elf->map_address != NULL
299 && elf->state.elf64.ehdr->e_ident[EI_DATA] == MY_ELFDATA
300 && (ALLOW_UNALIGNED
301- || (((size_t) ((char *) elf->map_address + offset))
302+ || (((size_t) ((char *) elf->map_address
303+ + elf->start_offset + offset))
304 & (__alignof__ (Elf64_Shdr) - 1)) == 0))
305- /* We can directly access the memory. */
306- num = ((Elf64_Shdr *) (elf->map_address + offset))->sh_link;
307+ {
308+ /* First see whether the information in the ELF header is
309+ valid and it does not ask for too much. */
310+ if (unlikely (elf->maximum_size - offset
311+ < sizeof (Elf64_Shdr)))
312+ {
313+ /* Something is wrong. */
314+ __libelf_seterrno (ELF_E_INVALID_SECTION_HEADER);
315+ result = -1;
316+ goto out;
317+ }
318+
319+ /* We can directly access the memory. */
320+ num = ((Elf64_Shdr *) (elf->map_address + elf->start_offset
321+ + offset))->sh_link;
322+ }
323 else
324 {
325 /* We avoid reading in all the section headers. Just read
326--- elfutils/libelf/elf_newscn.c
327+++ elfutils/libelf/elf_newscn.c
328@@ -83,10 +83,18 @@ elf_newscn (elf)
329 else
330 {
331 /* We must allocate a new element. */
332- Elf_ScnList *newp;
333+ Elf_ScnList *newp = NULL;
334
335 assert (elf->state.elf.scnincr > 0);
336
337+ if (
338+#if SIZE_MAX <= 4294967295U
339+ likely (elf->state.elf.scnincr
340+ < SIZE_MAX / 2 / sizeof (Elf_Scn) - sizeof (Elf_ScnList))
341+#else
342+ 1
343+#endif
344+ )
345 newp = (Elf_ScnList *) calloc (sizeof (Elf_ScnList)
346 + ((elf->state.elf.scnincr *= 2)
347 * sizeof (Elf_Scn)), 1);
348--- elfutils/libelf/gelf_getdyn.c
349+++ elfutils/libelf/gelf_getdyn.c
350@@ -1,5 +1,5 @@
351 /* Get information from dynamic table at the given index.
352- Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
353+ Copyright (C) 2000-2009 Red Hat, Inc.
354 This file is part of elfutils.
355 Written by Ulrich Drepper <drepper@redhat.com>, 2000.
356
357@@ -72,7 +72,7 @@ gelf_getdyn (data, ndx, dst)
358 table entries has to be adopted. The user better has provided
359 a buffer where we can store the information. While copying the
360 data we are converting the format. */
361- if (unlikely ((ndx + 1) * sizeof (Elf32_Dyn) > data_scn->d.d_size))
362+ if (INVALID_NDX (ndx, Elf32_Dyn, &data_scn->d))
363 {
364 __libelf_seterrno (ELF_E_INVALID_INDEX);
365 goto out;
366@@ -93,7 +93,7 @@ gelf_getdyn (data, ndx, dst)
367
368 /* The data is already in the correct form. Just make sure the
369 index is OK. */
370- if (unlikely ((ndx + 1) * sizeof (GElf_Dyn) > data_scn->d.d_size))
371+ if (INVALID_NDX (ndx, GElf_Dyn, &data_scn->d))
372 {
373 __libelf_seterrno (ELF_E_INVALID_INDEX);
374 goto out;
375--- elfutils/libelf/gelf_getlib.c
376+++ elfutils/libelf/gelf_getlib.c
377@@ -1,5 +1,5 @@
378 /* Get library from table at the given index.
379- Copyright (C) 2004 Red Hat, Inc.
380+ Copyright (C) 2004-2009 Red Hat, Inc.
381 This file is part of elfutils.
382 Written by Ulrich Drepper <drepper@redhat.com>, 2004.
383
384@@ -65,7 +65,7 @@ gelf_getlib (data, ndx, dst)
385 /* The data is already in the correct form. Just make sure the
386 index is OK. */
387 GElf_Lib *result = NULL;
388- if (unlikely ((ndx + 1) * sizeof (GElf_Lib) > data->d_size))
389+ if (INVALID_NDX (ndx, GElf_Lib, data))
390 __libelf_seterrno (ELF_E_INVALID_INDEX);
391 else
392 {
393--- elfutils/libelf/gelf_getmove.c
394+++ elfutils/libelf/gelf_getmove.c
395@@ -1,5 +1,5 @@
396 /* Get move structure at the given index.
397- Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
398+ Copyright (C) 2000-2009 Red Hat, Inc.
399 This file is part of elfutils.
400 Written by Ulrich Drepper <drepper@redhat.com>, 2000.
401
402@@ -62,7 +62,7 @@ gelf_getmove (data, ndx, dst)
403
404 /* The data is already in the correct form. Just make sure the
405 index is OK. */
406- if (unlikely ((ndx + 1) * sizeof (GElf_Move) > data->d_size))
407+ if (INVALID_NDX (ndx, GElf_Move, data))
408 {
409 __libelf_seterrno (ELF_E_INVALID_INDEX);
410 goto out;
411--- elfutils/libelf/gelf_getrela.c
412+++ elfutils/libelf/gelf_getrela.c
413@@ -1,5 +1,5 @@
414 /* Get RELA relocation information at given index.
415- Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
416+ Copyright (C) 2000-2009 Red Hat, Inc.
417 This file is part of elfutils.
418 Written by Ulrich Drepper <drepper@redhat.com>, 2000.
419
420@@ -50,12 +50,6 @@ gelf_getrela (data, ndx, dst)
421 if (data_scn == NULL)
422 return NULL;
423
424- if (unlikely (ndx < 0))
425- {
426- __libelf_seterrno (ELF_E_INVALID_INDEX);
427- return NULL;
428- }
429-
430 if (unlikely (data_scn->d.d_type != ELF_T_RELA))
431 {
432 __libelf_seterrno (ELF_E_INVALID_HANDLE);
433@@ -72,7 +66,7 @@ gelf_getrela (data, ndx, dst)
434 if (scn->elf->class == ELFCLASS32)
435 {
436 /* We have to convert the data. */
437- if (unlikely ((ndx + 1) * sizeof (Elf32_Rela) > data_scn->d.d_size))
438+ if (INVALID_NDX (ndx, Elf32_Rela, &data_scn->d))
439 {
440 __libelf_seterrno (ELF_E_INVALID_INDEX);
441 result = NULL;
442@@ -93,7 +87,7 @@ gelf_getrela (data, ndx, dst)
443 {
444 /* Simply copy the data after we made sure we are actually getting
445 correct data. */
446- if (unlikely ((ndx + 1) * sizeof (Elf64_Rela) > data_scn->d.d_size))
447+ if (INVALID_NDX (ndx, Elf64_Rela, &data_scn->d))
448 {
449 __libelf_seterrno (ELF_E_INVALID_INDEX);
450 result = NULL;
451--- elfutils/libelf/gelf_getrel.c
452+++ elfutils/libelf/gelf_getrel.c
453@@ -1,5 +1,5 @@
454 /* Get REL relocation information at given index.
455- Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
456+ Copyright (C) 2000-2009 Red Hat, Inc.
457 This file is part of elfutils.
458 Written by Ulrich Drepper <drepper@redhat.com>, 2000.
459
460@@ -50,12 +50,6 @@ gelf_getrel (data, ndx, dst)
461 if (data_scn == NULL)
462 return NULL;
463
464- if (unlikely (ndx < 0))
465- {
466- __libelf_seterrno (ELF_E_INVALID_INDEX);
467- return NULL;
468- }
469-
470 if (unlikely (data_scn->d.d_type != ELF_T_REL))
471 {
472 __libelf_seterrno (ELF_E_INVALID_HANDLE);
473@@ -72,7 +66,7 @@ gelf_getrel (data, ndx, dst)
474 if (scn->elf->class == ELFCLASS32)
475 {
476 /* We have to convert the data. */
477- if (unlikely ((ndx + 1) * sizeof (Elf32_Rel) > data_scn->d.d_size))
478+ if (INVALID_NDX (ndx, Elf32_Rel, &data_scn->d))
479 {
480 __libelf_seterrno (ELF_E_INVALID_INDEX);
481 result = NULL;
482@@ -92,7 +86,7 @@ gelf_getrel (data, ndx, dst)
483 {
484 /* Simply copy the data after we made sure we are actually getting
485 correct data. */
486- if (unlikely ((ndx + 1) * sizeof (Elf64_Rel) > data_scn->d.d_size))
487+ if (INVALID_NDX (ndx, Elf64_Rel, &data_scn->d))
488 {
489 __libelf_seterrno (ELF_E_INVALID_INDEX);
490 result = NULL;
491--- elfutils/libelf/gelf_getsym.c
492+++ elfutils/libelf/gelf_getsym.c
493@@ -1,5 +1,5 @@
494 /* Get symbol information from symbol table at the given index.
495- Copyright (C) 1999, 2000, 2001, 2002 Red Hat, Inc.
496+ Copyright (C) 1999-2009 Red Hat, Inc.
497 This file is part of elfutils.
498 Written by Ulrich Drepper <drepper@redhat.com>, 1999.
499
500@@ -69,7 +69,7 @@ gelf_getsym (data, ndx, dst)
501 table entries has to be adopted. The user better has provided
502 a buffer where we can store the information. While copying the
503 data we are converting the format. */
504- if (unlikely ((ndx + 1) * sizeof (Elf32_Sym) > data->d_size))
505+ if (INVALID_NDX (ndx, Elf32_Sym, data))
506 {
507 __libelf_seterrno (ELF_E_INVALID_INDEX);
508 goto out;
509@@ -98,7 +98,7 @@ gelf_getsym (data, ndx, dst)
510
511 /* The data is already in the correct form. Just make sure the
512 index is OK. */
513- if (unlikely ((ndx + 1) * sizeof (GElf_Sym) > data->d_size))
514+ if (INVALID_NDX (ndx, GElf_Sym, data))
515 {
516 __libelf_seterrno (ELF_E_INVALID_INDEX);
517 goto out;
518--- elfutils/libelf/gelf_getsyminfo.c
519+++ elfutils/libelf/gelf_getsyminfo.c
520@@ -1,5 +1,5 @@
521 /* Get additional symbol information from symbol table at the given index.
522- Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
523+ Copyright (C) 2000-2009 Red Hat, Inc.
524 This file is part of elfutils.
525 Written by Ulrich Drepper <drepper@redhat.com>, 2000.
526
527@@ -63,7 +63,7 @@ gelf_getsyminfo (data, ndx, dst)
528
529 /* The data is already in the correct form. Just make sure the
530 index is OK. */
531- if (unlikely ((ndx + 1) * sizeof (GElf_Syminfo) > data->d_size))
532+ if (INVALID_NDX (ndx, GElf_Syminfo, data))
533 {
534 __libelf_seterrno (ELF_E_INVALID_INDEX);
535 goto out;
536--- elfutils/libelf/gelf_getsymshndx.c
537+++ elfutils/libelf/gelf_getsymshndx.c
538@@ -1,6 +1,6 @@
539 /* Get symbol information and separate section index from symbol table
540 at the given index.
541- Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
542+ Copyright (C) 2000-2009 Red Hat, Inc.
543 This file is part of elfutils.
544 Written by Ulrich Drepper <drepper@redhat.com>, 2000.
545
546@@ -69,7 +69,7 @@ gelf_getsymshndx (symdata, shndxdata, nd
547 section index table. */
548 if (likely (shndxdata_scn != NULL))
549 {
550- if (unlikely ((ndx + 1) * sizeof (Elf32_Word) > shndxdata_scn->d.d_size))
551+ if (INVALID_NDX (ndx, Elf32_Word, &shndxdata_scn->d))
552 {
553 __libelf_seterrno (ELF_E_INVALID_INDEX);
554 goto out;
555@@ -89,7 +89,7 @@ gelf_getsymshndx (symdata, shndxdata, nd
556 table entries has to be adopted. The user better has provided
557 a buffer where we can store the information. While copying the
558 data we are converting the format. */
559- if (unlikely ((ndx + 1) * sizeof (Elf32_Sym) > symdata->d_size))
560+ if (INVALID_NDX (ndx, Elf32_Sym, symdata))
561 {
562 __libelf_seterrno (ELF_E_INVALID_INDEX);
563 goto out;
564@@ -118,7 +118,7 @@ gelf_getsymshndx (symdata, shndxdata, nd
565
566 /* The data is already in the correct form. Just make sure the
567 index is OK. */
568- if (unlikely ((ndx + 1) * sizeof (GElf_Sym) > symdata->d_size))
569+ if (INVALID_NDX (ndx, GElf_Sym, symdata))
570 {
571 __libelf_seterrno (ELF_E_INVALID_INDEX);
572 goto out;
573--- elfutils/libelf/gelf_getversym.c
574+++ elfutils/libelf/gelf_getversym.c
575@@ -1,5 +1,5 @@
576 /* Get symbol version information at the given index.
577- Copyright (C) 1999, 2000, 2001, 2002 Red Hat, Inc.
578+ Copyright (C) 1999-2009 Red Hat, Inc.
579 This file is part of elfutils.
580 Written by Ulrich Drepper <drepper@redhat.com>, 1999.
581
582@@ -71,7 +71,7 @@ gelf_getversym (data, ndx, dst)
583
584 /* The data is already in the correct form. Just make sure the
585 index is OK. */
586- if (unlikely ((ndx + 1) * sizeof (GElf_Versym) > data->d_size))
587+ if (INVALID_NDX (ndx, GElf_Versym, data))
588 {
589 __libelf_seterrno (ELF_E_INVALID_INDEX);
590 result = NULL;
591--- elfutils/libelf/gelf_update_dyn.c
592+++ elfutils/libelf/gelf_update_dyn.c
593@@ -1,5 +1,5 @@
594 /* Update information in dynamic table at the given index.
595- Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
596+ Copyright (C) 2000-2009 Red Hat, Inc.
597 This file is part of elfutils.
598 Written by Ulrich Drepper <drepper@redhat.com>, 2000.
599
600@@ -50,12 +50,6 @@ gelf_update_dyn (data, ndx, src)
601 if (data == NULL)
602 return 0;
603
604- if (unlikely (ndx < 0))
605- {
606- __libelf_seterrno (ELF_E_INVALID_INDEX);
607- return 0;
608- }
609-
610 if (unlikely (data_scn->d.d_type != ELF_T_DYN))
611 {
612 /* The type of the data better should match. */
613@@ -81,7 +75,7 @@ gelf_update_dyn (data, ndx, src)
614 }
615
616 /* Check whether we have to resize the data buffer. */
617- if (unlikely ((ndx + 1) * sizeof (Elf32_Dyn) > data_scn->d.d_size))
618+ if (INVALID_NDX (ndx, Elf32_Dyn, &data_scn->d))
619 {
620 __libelf_seterrno (ELF_E_INVALID_INDEX);
621 goto out;
622@@ -95,7 +89,7 @@ gelf_update_dyn (data, ndx, src)
623 else
624 {
625 /* Check whether we have to resize the data buffer. */
626- if (unlikely ((ndx + 1) * sizeof (Elf64_Dyn) > data_scn->d.d_size))
627+ if (INVALID_NDX (ndx, Elf64_Dyn, &data_scn->d))
628 {
629 __libelf_seterrno (ELF_E_INVALID_INDEX);
630 goto out;
631--- elfutils/libelf/gelf_update_lib.c
632+++ elfutils/libelf/gelf_update_lib.c
633@@ -1,5 +1,5 @@
634 /* Update library in table at the given index.
635- Copyright (C) 2004 Red Hat, Inc.
636+ Copyright (C) 2004-2009 Red Hat, Inc.
637 This file is part of elfutils.
638 Written by Ulrich Drepper <drepper@redhat.com>, 2004.
639
640@@ -47,12 +47,6 @@ gelf_update_lib (data, ndx, src)
641 if (data == NULL)
642 return 0;
643
644- if (unlikely (ndx < 0))
645- {
646- __libelf_seterrno (ELF_E_INVALID_INDEX);
647- return 0;
648- }
649-
650 Elf_Data_Scn *data_scn = (Elf_Data_Scn *) data;
651 if (unlikely (data_scn->d.d_type != ELF_T_LIB))
652 {
653@@ -66,7 +60,7 @@ gelf_update_lib (data, ndx, src)
654
655 /* Check whether we have to resize the data buffer. */
656 int result = 0;
657- if (unlikely ((ndx + 1) * sizeof (Elf64_Lib) > data_scn->d.d_size))
658+ if (INVALID_NDX (ndx, Elf64_Lib, &data_scn->d))
659 __libelf_seterrno (ELF_E_INVALID_INDEX);
660 else
661 {
662--- elfutils/libelf/gelf_update_move.c
663+++ elfutils/libelf/gelf_update_move.c
664@@ -1,5 +1,5 @@
665 /* Update move structure at the given index.
666- Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
667+ Copyright (C) 2000-2009 Red Hat, Inc.
668 This file is part of elfutils.
669 Written by Ulrich Drepper <drepper@redhat.com>, 2000.
670
671@@ -54,8 +54,7 @@ gelf_update_move (data, ndx, src)
672 assert (sizeof (GElf_Move) == sizeof (Elf64_Move));
673
674 /* Check whether we have to resize the data buffer. */
675- if (unlikely (ndx < 0)
676- || unlikely ((ndx + 1) * sizeof (GElf_Move) > data_scn->d.d_size))
677+ if (INVALID_NDX (ndx, GElf_Move, &data_scn->d))
678 {
679 __libelf_seterrno (ELF_E_INVALID_INDEX);
680 return 0;
681--- elfutils/libelf/gelf_update_rela.c
682+++ elfutils/libelf/gelf_update_rela.c
683@@ -1,5 +1,5 @@
684 /* Update RELA relocation information at given index.
685- Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
686+ Copyright (C) 2000-2009 Red Hat, Inc.
687 This file is part of elfutils.
688 Written by Ulrich Drepper <drepper@redhat.com>, 2000.
689
690@@ -47,12 +47,6 @@ gelf_update_rela (Elf_Data *dst, int ndx
691 if (dst == NULL)
692 return 0;
693
694- if (unlikely (ndx < 0))
695- {
696- __libelf_seterrno (ELF_E_INVALID_INDEX);
697- return 0;
698- }
699-
700 if (unlikely (data_scn->d.d_type != ELF_T_RELA))
701 {
702 /* The type of the data better should match. */
703@@ -80,7 +74,7 @@ gelf_update_rela (Elf_Data *dst, int ndx
704 }
705
706 /* Check whether we have to resize the data buffer. */
707- if (unlikely ((ndx + 1) * sizeof (Elf32_Rela) > data_scn->d.d_size))
708+ if (INVALID_NDX (ndx, Elf32_Rela, &data_scn->d))
709 {
710 __libelf_seterrno (ELF_E_INVALID_INDEX);
711 goto out;
712@@ -96,7 +90,7 @@ gelf_update_rela (Elf_Data *dst, int ndx
713 else
714 {
715 /* Check whether we have to resize the data buffer. */
716- if (unlikely ((ndx + 1) * sizeof (Elf64_Rela) > data_scn->d.d_size))
717+ if (INVALID_NDX (ndx, Elf64_Rela, &data_scn->d))
718 {
719 __libelf_seterrno (ELF_E_INVALID_INDEX);
720 goto out;
721--- elfutils/libelf/gelf_update_rel.c
722+++ elfutils/libelf/gelf_update_rel.c
723@@ -1,5 +1,5 @@
724 /* Update REL relocation information at given index.
725- Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
726+ Copyright (C) 2000-2009 Red Hat, Inc.
727 This file is part of elfutils.
728 Written by Ulrich Drepper <drepper@redhat.com>, 2000.
729
730@@ -47,12 +47,6 @@ gelf_update_rel (Elf_Data *dst, int ndx,
731 if (dst == NULL)
732 return 0;
733
734- if (unlikely (ndx < 0))
735- {
736- __libelf_seterrno (ELF_E_INVALID_INDEX);
737- return 0;
738- }
739-
740 if (unlikely (data_scn->d.d_type != ELF_T_REL))
741 {
742 /* The type of the data better should match. */
743@@ -78,7 +72,7 @@ gelf_update_rel (Elf_Data *dst, int ndx,
744 }
745
746 /* Check whether we have to resize the data buffer. */
747- if (unlikely ((ndx + 1) * sizeof (Elf32_Rel) > data_scn->d.d_size))
748+ if (INVALID_NDX (ndx, Elf32_Rel, &data_scn->d))
749 {
750 __libelf_seterrno (ELF_E_INVALID_INDEX);
751 goto out;
752@@ -93,7 +87,7 @@ gelf_update_rel (Elf_Data *dst, int ndx,
753 else
754 {
755 /* Check whether we have to resize the data buffer. */
756- if (unlikely ((ndx + 1) * sizeof (Elf64_Rel) > data_scn->d.d_size))
757+ if (INVALID_NDX (ndx, Elf64_Rel, &data_scn->d))
758 {
759 __libelf_seterrno (ELF_E_INVALID_INDEX);
760 goto out;
761--- elfutils/libelf/gelf_update_sym.c
762+++ elfutils/libelf/gelf_update_sym.c
763@@ -1,5 +1,5 @@
764 /* Update symbol information in symbol table at the given index.
765- Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
766+ Copyright (C) 2000-2009 Red Hat, Inc.
767 This file is part of elfutils.
768 Written by Ulrich Drepper <drepper@redhat.com>, 2000.
769
770@@ -51,12 +51,6 @@ gelf_update_sym (data, ndx, src)
771 if (data == NULL)
772 return 0;
773
774- if (unlikely (ndx < 0))
775- {
776- __libelf_seterrno (ELF_E_INVALID_INDEX);
777- return 0;
778- }
779-
780 if (unlikely (data_scn->d.d_type != ELF_T_SYM))
781 {
782 /* The type of the data better should match. */
783@@ -81,7 +75,7 @@ gelf_update_sym (data, ndx, src)
784 }
785
786 /* Check whether we have to resize the data buffer. */
787- if (unlikely ((ndx + 1) * sizeof (Elf32_Sym) > data_scn->d.d_size))
788+ if (INVALID_NDX (ndx, Elf32_Sym, &data_scn->d))
789 {
790 __libelf_seterrno (ELF_E_INVALID_INDEX);
791 goto out;
792@@ -104,7 +98,7 @@ gelf_update_sym (data, ndx, src)
793 else
794 {
795 /* Check whether we have to resize the data buffer. */
796- if (unlikely ((ndx + 1) * sizeof (Elf64_Sym) > data_scn->d.d_size))
797+ if (INVALID_NDX (ndx, Elf64_Sym, &data_scn->d))
798 {
799 __libelf_seterrno (ELF_E_INVALID_INDEX);
800 goto out;
801--- elfutils/libelf/gelf_update_syminfo.c
802+++ elfutils/libelf/gelf_update_syminfo.c
803@@ -1,5 +1,5 @@
804 /* Update additional symbol information in symbol table at the given index.
805- Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
806+ Copyright (C) 2000-2009 Red Hat, Inc.
807 This file is part of elfutils.
808 Written by Ulrich Drepper <drepper@redhat.com>, 2000.
809
810@@ -51,12 +51,6 @@ gelf_update_syminfo (data, ndx, src)
811 if (data == NULL)
812 return 0;
813
814- if (unlikely (ndx < 0))
815- {
816- __libelf_seterrno (ELF_E_INVALID_INDEX);
817- return 0;
818- }
819-
820 if (unlikely (data_scn->d.d_type != ELF_T_SYMINFO))
821 {
822 /* The type of the data better should match. */
823@@ -72,7 +66,7 @@ gelf_update_syminfo (data, ndx, src)
824 rwlock_wrlock (scn->elf->lock);
825
826 /* Check whether we have to resize the data buffer. */
827- if (unlikely ((ndx + 1) * sizeof (GElf_Syminfo) > data_scn->d.d_size))
828+ if (INVALID_NDX (ndx, GElf_Syminfo, &data_scn->d))
829 {
830 __libelf_seterrno (ELF_E_INVALID_INDEX);
831 goto out;
832--- elfutils/libelf/gelf_update_symshndx.c
833+++ elfutils/libelf/gelf_update_symshndx.c
834@@ -1,6 +1,6 @@
835 /* Update symbol information and section index in symbol table at the
836 given index.
837- Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
838+ Copyright (C) 2000-2009 Red Hat, Inc.
839 This file is part of elfutils.
840 Written by Ulrich Drepper <drepper@redhat.com>, 2000.
841
842@@ -56,12 +56,6 @@ gelf_update_symshndx (symdata, shndxdata
843 if (symdata == NULL)
844 return 0;
845
846- if (unlikely (ndx < 0))
847- {
848- __libelf_seterrno (ELF_E_INVALID_INDEX);
849- return 0;
850- }
851-
852 if (unlikely (symdata_scn->d.d_type != ELF_T_SYM))
853 {
854 /* The type of the data better should match. */
855@@ -107,7 +101,7 @@ gelf_update_symshndx (symdata, shndxdata
856 }
857
858 /* Check whether we have to resize the data buffer. */
859- if (unlikely ((ndx + 1) * sizeof (Elf32_Sym) > symdata_scn->d.d_size))
860+ if (INVALID_NDX (ndx, Elf32_Sym, &symdata_scn->d))
861 {
862 __libelf_seterrno (ELF_E_INVALID_INDEX);
863 goto out;
864@@ -130,7 +124,7 @@ gelf_update_symshndx (symdata, shndxdata
865 else
866 {
867 /* Check whether we have to resize the data buffer. */
868- if (unlikely ((ndx + 1) * sizeof (Elf64_Sym) > symdata_scn->d.d_size))
869+ if (INVALID_NDX (ndx, Elf64_Sym, &symdata_scn->d))
870 {
871 __libelf_seterrno (ELF_E_INVALID_INDEX);
872 goto out;
873--- elfutils/libelf/gelf_update_versym.c
874+++ elfutils/libelf/gelf_update_versym.c
875@@ -1,5 +1,5 @@
876 /* Update symbol version information.
877- Copyright (C) 2001, 2002 Red Hat, Inc.
878+ Copyright (C) 2001-2009 Red Hat, Inc.
879 This file is part of elfutils.
880 Written by Ulrich Drepper <drepper@redhat.com>, 2001.
881
882@@ -54,8 +54,7 @@ gelf_update_versym (data, ndx, src)
883 assert (sizeof (GElf_Versym) == sizeof (Elf64_Versym));
884
885 /* Check whether we have to resize the data buffer. */
886- if (unlikely (ndx < 0)
887- || unlikely ((ndx + 1) * sizeof (GElf_Versym) > data_scn->d.d_size))
888+ if (INVALID_NDX (ndx, GElf_Versym, &data_scn->d))
889 {
890 __libelf_seterrno (ELF_E_INVALID_INDEX);
891 return 0;
892--- elfutils/libelf/libelfP.h
893+++ elfutils/libelf/libelfP.h
894@@ -587,4 +587,8 @@ extern uint32_t __libelf_crc32 (uint32_t
895 /* Align offset to 4 bytes as needed for note name and descriptor data. */
896 #define NOTE_ALIGN(n) (((n) + 3) & -4U)
897
898+/* Convenience macro. */
899+#define INVALID_NDX(ndx, type, data) \
900+ unlikely ((data)->d_size / sizeof (type) <= (unsigned int) (ndx))
901+
902 #endif /* libelfP.h */
903--- elfutils/src/ChangeLog
904+++ elfutils/src/ChangeLog
905@@ -344,6 +344,12 @@
906
907 * readelf.c (dwarf_attr_string): Grok DW_AT_GNU_odr_signature.
908
909+2011-03-23 Petr Machata <pmachata@redhat.com>
910+
911+ * readelf.c (handle_dynamic, handle_relocs_rel)
912+ (handle_relocs_rela, handle_versym, print_liblist):
913+ Use gelf_fsize instead of relying on shdr->sh_entsize.
914+
915 2011-02-11 Roland McGrath <roland@redhat.com>
916
917 * elfcmp.c (verbose): New variable.
918@@ -2056,6 +2062,16 @@
919 object symbols or symbols with unknown type.
920 (check_rel): Likewise.
921
922+2005-06-09 Roland McGrath <roland@redhat.com>
923+
924+ * readelf.c (handle_dynamic, handle_symtab): Check for bogus sh_link.
925+ (handle_verneed, handle_verdef, handle_versym, handle_hash): Likewise.
926+ (handle_scngrp): Check for bogus sh_info.
927+
928+ * strip.c (handle_elf): Check for bogus values in sh_link, sh_info,
929+ st_shndx, e_shstrndx, and SHT_GROUP or SHT_SYMTAB_SHNDX data.
930+ Don't use assert on input values, instead bail with "illformed" error.
931+
932 2005-06-08 Roland McGrath <roland@redhat.com>
933
934 * readelf.c (print_ops): Add consts.
935@@ -2101,6 +2117,19 @@
936
937 * readelf.c (dwarf_tag_string): Add new tags.
938
939+2005-05-17 Jakub Jelinek <jakub@redhat.com>
940+
941+ * elflint.c (check_hash): Don't check entries beyond end of section.
942+ (check_note): Don't crash if gelf_rawchunk fails.
943+ (section_name): Return <invalid> if gelf_getshdr returns NULL.
944+
945+2005-05-14 Jakub Jelinek <jakub@redhat.com>
946+
947+ * elflint.c (section_name): Return "<invalid>" instead of
948+ crashing on invalid section name.
949+ (check_symtab, is_rel_dyn, check_rela, check_rel, check_dynamic,
950+ check_symtab_shndx, check_hash, check_versym): Robustify.
951+
952 2005-05-08 Roland McGrath <roland@redhat.com>
953
954 * strip.c (handle_elf): Don't translate hash and versym data formats,
955--- elfutils/src/elflint.c
956+++ elfutils/src/elflint.c
957@@ -123,6 +123,10 @@ static uint32_t shstrndx;
958 /* Array to count references in section groups. */
959 static int *scnref;
960
961+/* Numbers of sections and program headers. */
962+static unsigned int shnum;
963+static unsigned int phnum;
964+
965
966 int
967 main (int argc, char *argv[])
968@@ -311,10 +315,19 @@ section_name (Ebl *ebl, int idx)
969 {
970 GElf_Shdr shdr_mem;
971 GElf_Shdr *shdr;
972+ const char *ret;
973+
974+ if ((unsigned int) idx > shnum)
975+ return "<invalid>";
976
977 shdr = gelf_getshdr (elf_getscn (ebl->elf, idx), &shdr_mem);
978+ if (shdr == NULL)
979+ return "<invalid>";
980
981- return elf_strptr (ebl->elf, shstrndx, shdr->sh_name);
982+ ret = elf_strptr (ebl->elf, shstrndx, shdr->sh_name);
983+ if (ret == NULL)
984+ return "<invalid>";
985+ return ret;
986 }
987
988
989@@ -337,11 +350,6 @@ static const int valid_e_machine[] =
990 (sizeof (valid_e_machine) / sizeof (valid_e_machine[0]))
991
992
993-/* Numbers of sections and program headers. */
994-static unsigned int shnum;
995-static unsigned int phnum;
996-
997-
998 static void
999 check_elf_header (Ebl *ebl, GElf_Ehdr *ehdr, size_t size)
1000 {
1001@@ -625,7 +633,8 @@ section [%2d] '%s': symbol table cannot
1002 }
1003 }
1004
1005- if (shdr->sh_entsize != gelf_fsize (ebl->elf, ELF_T_SYM, 1, EV_CURRENT))
1006+ size_t sh_entsize = gelf_fsize (ebl->elf, ELF_T_SYM, 1, EV_CURRENT);
1007+ if (shdr->sh_entsize != sh_entsize)
1008 ERROR (gettext ("\
1009 section [%2u] '%s': entry size is does not match ElfXX_Sym\n"),
1010 idx, section_name (ebl, idx));
1011@@ -663,7 +672,7 @@ section [%2d] '%s': XINDEX for zeroth en
1012 xndxscnidx, section_name (ebl, xndxscnidx));
1013 }
1014
1015- for (size_t cnt = 1; cnt < shdr->sh_size / shdr->sh_entsize; ++cnt)
1016+ for (size_t cnt = 1; cnt < shdr->sh_size / sh_entsize; ++cnt)
1017 {
1018 sym = gelf_getsymshndx (data, xndxdata, cnt, &sym_mem, &xndx);
1019 if (sym == NULL)
1020@@ -683,7 +692,8 @@ section [%2d] '%s': symbol %zu: invalid
1021 else
1022 {
1023 name = elf_strptr (ebl->elf, shdr->sh_link, sym->st_name);
1024- assert (name != NULL);
1025+ assert (name != NULL
1026+ || strshdr->sh_type != SHT_STRTAB);
1027 }
1028
1029 if (sym->st_shndx == SHN_XINDEX)
1030@@ -1032,9 +1042,11 @@ is_rel_dyn (Ebl *ebl, const GElf_Ehdr *e
1031 {
1032 GElf_Shdr rcshdr_mem;
1033 const GElf_Shdr *rcshdr = gelf_getshdr (scn, &rcshdr_mem);
1034- assert (rcshdr != NULL);
1035
1036- if (rcshdr->sh_type == SHT_DYNAMIC)
1037+ if (rcshdr == NULL)
1038+ break;
1039+
1040+ if (rcshdr->sh_type == SHT_DYNAMIC && rcshdr->sh_entsize)
1041 {
1042 /* Found the dynamic section. Look through it. */
1043 Elf_Data *d = elf_getdata (scn, NULL);
1044@@ -1044,7 +1056,9 @@ is_rel_dyn (Ebl *ebl, const GElf_Ehdr *e
1045 {
1046 GElf_Dyn dyn_mem;
1047 GElf_Dyn *dyn = gelf_getdyn (d, cnt, &dyn_mem);
1048- assert (dyn != NULL);
1049+
1050+ if (dyn == NULL)
1051+ break;
1052
1053 if (dyn->d_tag == DT_RELCOUNT)
1054 {
1055@@ -1058,7 +1072,9 @@ section [%2d] '%s': DT_RELCOUNT used for
1056 /* Does the number specified number of relative
1057 relocations exceed the total number of
1058 relocations? */
1059- if (dyn->d_un.d_val > shdr->sh_size / shdr->sh_entsize)
1060+ if (shdr->sh_entsize != 0
1061+ && dyn->d_un.d_val > (shdr->sh_size
1062+ / shdr->sh_entsize))
1063 ERROR (gettext ("\
1064 section [%2d] '%s': DT_RELCOUNT value %d too high for this section\n"),
1065 idx, section_name (ebl, idx),
1066@@ -1218,7 +1234,8 @@ section [%2d] '%s': no relocations for m
1067 }
1068 }
1069
1070- if (shdr->sh_entsize != gelf_fsize (ebl->elf, reltype, 1, EV_CURRENT))
1071+ size_t sh_entsize = gelf_fsize (ebl->elf, reltype, 1, EV_CURRENT);
1072+ if (shdr->sh_entsize != sh_entsize)
1073 ERROR (gettext (reltype == ELF_T_RELA ? "\
1074 section [%2d] '%s': section entry size does not match ElfXX_Rela\n" : "\
1075 section [%2d] '%s': section entry size does not match ElfXX_Rel\n"),
1076@@ -1441,7 +1458,8 @@ check_rela (Ebl *ebl, GElf_Ehdr *ehdr, G
1077 Elf_Data *symdata = elf_getdata (symscn, NULL);
1078 enum load_state state = state_undecided;
1079
1080- for (size_t cnt = 0; cnt < shdr->sh_size / shdr->sh_entsize; ++cnt)
1081+ size_t sh_entsize = gelf_fsize (ebl->elf, ELF_T_RELA, 1, EV_CURRENT);
1082+ for (size_t cnt = 0; cnt < shdr->sh_size / sh_entsize; ++cnt)
1083 {
1084 GElf_Rela rela_mem;
1085 GElf_Rela *rela = gelf_getrela (data, cnt, &rela_mem);
1086@@ -1491,7 +1509,8 @@ check_rel (Ebl *ebl, GElf_Ehdr *ehdr, GE
1087 Elf_Data *symdata = elf_getdata (symscn, NULL);
1088 enum load_state state = state_undecided;
1089
1090- for (size_t cnt = 0; cnt < shdr->sh_size / shdr->sh_entsize; ++cnt)
1091+ size_t sh_entsize = gelf_fsize (ebl->elf, ELF_T_REL, 1, EV_CURRENT);
1092+ for (size_t cnt = 0; cnt < shdr->sh_size / sh_entsize; ++cnt)
1093 {
1094 GElf_Rel rel_mem;
1095 GElf_Rel *rel = gelf_getrel (data, cnt, &rel_mem);
1096@@ -1590,7 +1609,8 @@ section [%2d] '%s': referenced as string
1097 shdr->sh_link, section_name (ebl, shdr->sh_link),
1098 idx, section_name (ebl, idx));
1099
1100- if (shdr->sh_entsize != gelf_fsize (ebl->elf, ELF_T_DYN, 1, EV_CURRENT))
1101+ size_t sh_entsize = gelf_fsize (ebl->elf, ELF_T_DYN, 1, EV_CURRENT);
1102+ if (shdr->sh_entsize != sh_entsize)
1103 ERROR (gettext ("\
1104 section [%2d] '%s': section entry size does not match ElfXX_Dyn\n"),
1105 idx, section_name (ebl, idx));
1106@@ -1600,7 +1620,7 @@ section [%2d] '%s': section entry size d
1107 idx, section_name (ebl, idx));
1108
1109 bool non_null_warned = false;
1110- for (cnt = 0; cnt < shdr->sh_size / shdr->sh_entsize; ++cnt)
1111+ for (cnt = 0; cnt < shdr->sh_size / sh_entsize; ++cnt)
1112 {
1113 GElf_Dyn dyn_mem;
1114 GElf_Dyn *dyn = gelf_getdyn (data, cnt, &dyn_mem);
1115@@ -1872,6 +1892,8 @@ section [%2d] '%s': entry size does not
1116 idx, section_name (ebl, idx));
1117
1118 if (symshdr != NULL
1119+ && shdr->sh_entsize
1120+ && symshdr->sh_entsize
1121 && (shdr->sh_size / shdr->sh_entsize
1122 < symshdr->sh_size / symshdr->sh_entsize))
1123 ERROR (gettext ("\
1124@@ -1898,6 +1920,12 @@ section [%2d] '%s': extended section ind
1125 }
1126
1127 Elf_Data *data = elf_getdata (elf_getscn (ebl->elf, idx), NULL);
1128+ if (data == NULL)
1129+ {
1130+ ERROR (gettext ("section [%2d] '%s': cannot get section data\n"),
1131+ idx, section_name (ebl, idx));
1132+ return;
1133+ }
1134
1135 if (*((Elf32_Word *) data->d_buf) != 0)
1136 ERROR (gettext ("symbol 0 should have zero extended section index\n"));
1137@@ -1940,7 +1968,7 @@ section [%2d] '%s': hash table section i
1138
1139 size_t maxidx = nchain;
1140
1141- if (symshdr != NULL)
1142+ if (symshdr != NULL && symshdr->sh_entsize != 0)
1143 {
1144 size_t symsize = symshdr->sh_size / symshdr->sh_entsize;
1145
1146@@ -1951,18 +1979,28 @@ section [%2d] '%s': hash table section i
1147 maxidx = symsize;
1148 }
1149
1150+ Elf32_Word *buf = (Elf32_Word *) data->d_buf;
1151+ Elf32_Word *end = (Elf32_Word *) ((char *) data->d_buf + shdr->sh_size);
1152 size_t cnt;
1153 for (cnt = 2; cnt < 2 + nbucket; ++cnt)
1154- if (((Elf32_Word *) data->d_buf)[cnt] >= maxidx)
1155+ {
1156+ if (buf + cnt >= end)
1157+ break;
1158+ else if (buf[cnt] >= maxidx)
1159 ERROR (gettext ("\
1160 section [%2d] '%s': hash bucket reference %zu out of bounds\n"),
1161 idx, section_name (ebl, idx), cnt - 2);
1162+ }
1163
1164 for (; cnt < 2 + nbucket + nchain; ++cnt)
1165- if (((Elf32_Word *) data->d_buf)[cnt] >= maxidx)
1166+ {
1167+ if (buf + cnt >= end)
1168+ break;
1169+ else if (buf[cnt] >= maxidx)
1170 ERROR (gettext ("\
1171 section [%2d] '%s': hash chain reference %zu out of bounds\n"),
1172 idx, section_name (ebl, idx), cnt - 2 - nbucket);
1173+ }
1174 }
1175
1176
1177@@ -1992,18 +2030,28 @@ section [%2d] '%s': hash table section i
1178 maxidx = symsize;
1179 }
1180
1181+ Elf64_Xword *buf = (Elf64_Xword *) data->d_buf;
1182+ Elf64_Xword *end = (Elf64_Xword *) ((char *) data->d_buf + shdr->sh_size);
1183 size_t cnt;
1184 for (cnt = 2; cnt < 2 + nbucket; ++cnt)
1185- if (((Elf64_Xword *) data->d_buf)[cnt] >= maxidx)
1186+ {
1187+ if (buf + cnt >= end)
1188+ break;
1189+ else if (buf[cnt] >= maxidx)
1190 ERROR (gettext ("\
1191 section [%2d] '%s': hash bucket reference %zu out of bounds\n"),
1192 idx, section_name (ebl, idx), cnt - 2);
1193+ }
1194
1195 for (; cnt < 2 + nbucket + nchain; ++cnt)
1196- if (((Elf64_Xword *) data->d_buf)[cnt] >= maxidx)
1197+ {
1198+ if (buf + cnt >= end)
1199+ break;
1200+ else if (buf[cnt] >= maxidx)
1201 ERROR (gettext ("\
1202 section [%2d] '%s': hash chain reference %" PRIu64 " out of bounds\n"),
1203- idx, section_name (ebl, idx), (uint64_t) (cnt - 2 - nbucket));
1204+ idx, section_name (ebl, idx), (uint64_t) cnt - 2 - nbucket);
1205+ }
1206 }
1207
1208
1209@@ -2028,7 +2076,7 @@ section [%2d] '%s': bitmask size not pow
1210 if (shdr->sh_size < (4 + bitmask_words + nbuckets) * sizeof (Elf32_Word))
1211 {
1212 ERROR (gettext ("\
1213-section [%2d] '%s': hash table section is too small (is %ld, expected at least%ld)\n"),
1214+section [%2d] '%s': hash table section is too small (is %ld, expected at least %ld)\n"),
1215 idx, section_name (ebl, idx), (long int) shdr->sh_size,
1216 (long int) ((4 + bitmask_words + nbuckets) * sizeof (Elf32_Word)));
1217 return;
1218@@ -2700,8 +2748,9 @@ section [%2d] '%s' refers in sh_link to
1219
1220 /* The number of elements in the version symbol table must be the
1221 same as the number of symbols. */
1222- if (shdr->sh_size / shdr->sh_entsize
1223- != symshdr->sh_size / symshdr->sh_entsize)
1224+ if (shdr->sh_entsize && symshdr->sh_entsize
1225+ && (shdr->sh_size / shdr->sh_entsize
1226+ != symshdr->sh_size / symshdr->sh_entsize))
1227 ERROR (gettext ("\
1228 section [%2d] '%s' has different number of entries than symbol table [%2d] '%s'\n"),
1229 idx, section_name (ebl, idx),
1230--- elfutils/src/readelf.c
1231+++ elfutils/src/readelf.c
1232@@ -1189,6 +1189,8 @@ handle_scngrp (Ebl *ebl, Elf_Scn *scn, G
1233 Elf32_Word *grpref = (Elf32_Word *) data->d_buf;
1234
1235 GElf_Sym sym_mem;
1236+ GElf_Sym *sym = gelf_getsym (symdata, shdr->sh_info, &sym_mem);
1237+
1238 printf ((grpref[0] & GRP_COMDAT)
1239 ? ngettext ("\
1240 \nCOMDAT section group [%2zu] '%s' with signature '%s' contains %zu entry:\n",
1241@@ -1201,8 +1203,8 @@ handle_scngrp (Ebl *ebl, Elf_Scn *scn, G
1242 data->d_size / sizeof (Elf32_Word) - 1),
1243 elf_ndxscn (scn),
1244 elf_strptr (ebl->elf, shstrndx, shdr->sh_name),
1245- elf_strptr (ebl->elf, symshdr->sh_link,
1246- gelf_getsym (symdata, shdr->sh_info, &sym_mem)->st_name)
1247+ (sym == NULL ? NULL
1248+ : elf_strptr (ebl->elf, symshdr->sh_link, sym->st_name))
1249 ?: gettext ("<INVALID SYMBOL>"),
1250 data->d_size / sizeof (Elf32_Word) - 1);
1251
1252@@ -1353,10 +1355,12 @@ static void
1253 handle_dynamic (Ebl *ebl, Elf_Scn *scn, GElf_Shdr *shdr)
1254 {
1255 int class = gelf_getclass (ebl->elf);
1256- GElf_Shdr glink;
1257+ GElf_Shdr glink_mem;
1258+ GElf_Shdr *glink;
1259 Elf_Data *data;
1260 size_t cnt;
1261 size_t shstrndx;
1262+ size_t sh_entsize;
1263
1264 /* Get the data of the section. */
1265 data = elf_getdata (scn, NULL);
1266@@ -1368,21 +1372,26 @@ handle_dynamic (Ebl *ebl, Elf_Scn *scn,
1267 error (EXIT_FAILURE, 0,
1268 gettext ("cannot get section header string table index"));
1269
1270+ sh_entsize = gelf_fsize (ebl->elf, ELF_T_DYN, 1, EV_CURRENT);
1271+
1272+ glink = gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link), &glink_mem);
1273+ if (glink == NULL)
1274+ error (EXIT_FAILURE, 0, gettext ("invalid sh_link value in section %Zu"),
1275+ elf_ndxscn (scn));
1276+
1277 printf (ngettext ("\
1278 \nDynamic segment contains %lu entry:\n Addr: %#0*" PRIx64 " Offset: %#08" PRIx64 " Link to section: [%2u] '%s'\n",
1279 "\
1280 \nDynamic segment contains %lu entries:\n Addr: %#0*" PRIx64 " Offset: %#08" PRIx64 " Link to section: [%2u] '%s'\n",
1281- shdr->sh_size / shdr->sh_entsize),
1282- (unsigned long int) (shdr->sh_size / shdr->sh_entsize),
1283+ shdr->sh_size / sh_entsize),
1284+ (unsigned long int) (shdr->sh_size / sh_entsize),
1285 class == ELFCLASS32 ? 10 : 18, shdr->sh_addr,
1286 shdr->sh_offset,
1287 (int) shdr->sh_link,
1288- elf_strptr (ebl->elf, shstrndx,
1289- gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link),
1290- &glink)->sh_name));
1291+ elf_strptr (ebl->elf, shstrndx, glink->sh_name));
1292 fputs_unlocked (gettext (" Type Value\n"), stdout);
1293
1294- for (cnt = 0; cnt < shdr->sh_size / shdr->sh_entsize; ++cnt)
1295+ for (cnt = 0; cnt < shdr->sh_size / sh_entsize; ++cnt)
1296 {
1297 GElf_Dyn dynmem;
1298 GElf_Dyn *dyn = gelf_getdyn (data, cnt, &dynmem);
1299@@ -1531,7 +1540,8 @@ static void
1300 handle_relocs_rel (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn, GElf_Shdr *shdr)
1301 {
1302 int class = gelf_getclass (ebl->elf);
1303- int nentries = shdr->sh_size / shdr->sh_entsize;
1304+ size_t sh_entsize = gelf_fsize (ebl->elf, ELF_T_REL, 1, EV_CURRENT);
1305+ int nentries = shdr->sh_size / sh_entsize;
1306
1307 /* Get the data of the section. */
1308 Elf_Data *data = elf_getdata (scn, NULL);
1309@@ -1717,7 +1727,8 @@ static void
1310 handle_relocs_rela (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn, GElf_Shdr *shdr)
1311 {
1312 int class = gelf_getclass (ebl->elf);
1313- int nentries = shdr->sh_size / shdr->sh_entsize;
1314+ size_t sh_entsize = gelf_fsize (ebl->elf, ELF_T_RELA, 1, EV_CURRENT);
1315+ int nentries = shdr->sh_size / sh_entsize;
1316
1317 /* Get the data of the section. */
1318 Elf_Data *data = elf_getdata (scn, NULL);
1319@@ -1964,6 +1975,13 @@ handle_symtab (Ebl *ebl, Elf_Scn *scn, G
1320 error (EXIT_FAILURE, 0,
1321 gettext ("cannot get section header string table index"));
1322
1323+ GElf_Shdr glink_mem;
1324+ GElf_Shdr *glink = gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link),
1325+ &glink_mem);
1326+ if (glink == NULL)
1327+ error (EXIT_FAILURE, 0, gettext ("invalid sh_link value in section %Zu"),
1328+ elf_ndxscn (scn));
1329+
1330 /* Now we can compute the number of entries in the section. */
1331 unsigned int nsyms = data->d_size / (class == ELFCLASS32
1332 ? sizeof (Elf32_Sym)
1333@@ -1974,15 +1992,12 @@ handle_symtab (Ebl *ebl, Elf_Scn *scn, G
1334 nsyms),
1335 (unsigned int) elf_ndxscn (scn),
1336 elf_strptr (ebl->elf, shstrndx, shdr->sh_name), nsyms);
1337- GElf_Shdr glink;
1338 printf (ngettext (" %lu local symbol String table: [%2u] '%s'\n",
1339 " %lu local symbols String table: [%2u] '%s'\n",
1340 shdr->sh_info),
1341 (unsigned long int) shdr->sh_info,
1342 (unsigned int) shdr->sh_link,
1343- elf_strptr (ebl->elf, shstrndx,
1344- gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link),
1345- &glink)->sh_name));
1346+ elf_strptr (ebl->elf, shstrndx, glink->sh_name));
1347
1348 fputs_unlocked (class == ELFCLASS32
1349 ? gettext ("\
1350@@ -2218,7 +2233,13 @@ handle_verneed (Ebl *ebl, Elf_Scn *scn,
1351 error (EXIT_FAILURE, 0,
1352 gettext ("cannot get section header string table index"));
1353
1354- GElf_Shdr glink;
1355+ GElf_Shdr glink_mem;
1356+ GElf_Shdr *glink = gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link),
1357+ &glink_mem);
1358+ if (glink == NULL)
1359+ error (EXIT_FAILURE, 0, gettext ("invalid sh_link value in section %Zu"),
1360+ elf_ndxscn (scn));
1361+
1362 printf (ngettext ("\
1363 \nVersion needs section [%2u] '%s' contains %d entry:\n Addr: %#0*" PRIx64 " Offset: %#08" PRIx64 " Link to section: [%2u] '%s'\n",
1364 "\
1365@@ -2229,9 +2250,7 @@ handle_verneed (Ebl *ebl, Elf_Scn *scn,
1366 class == ELFCLASS32 ? 10 : 18, shdr->sh_addr,
1367 shdr->sh_offset,
1368 (unsigned int) shdr->sh_link,
1369- elf_strptr (ebl->elf, shstrndx,
1370- gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link),
1371- &glink)->sh_name));
1372+ elf_strptr (ebl->elf, shstrndx, glink->sh_name));
1373
1374 unsigned int offset = 0;
1375 for (int cnt = shdr->sh_info; --cnt >= 0; )
1376@@ -2284,8 +2303,14 @@ handle_verdef (Ebl *ebl, Elf_Scn *scn, G
1377 error (EXIT_FAILURE, 0,
1378 gettext ("cannot get section header string table index"));
1379
1380+ GElf_Shdr glink_mem;
1381+ GElf_Shdr *glink = gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link),
1382+ &glink_mem);
1383+ if (glink == NULL)
1384+ error (EXIT_FAILURE, 0, gettext ("invalid sh_link value in section %Zu"),
1385+ elf_ndxscn (scn));
1386+
1387 int class = gelf_getclass (ebl->elf);
1388- GElf_Shdr glink;
1389 printf (ngettext ("\
1390 \nVersion definition section [%2u] '%s' contains %d entry:\n Addr: %#0*" PRIx64 " Offset: %#08" PRIx64 " Link to section: [%2u] '%s'\n",
1391 "\
1392@@ -2297,9 +2322,7 @@ handle_verdef (Ebl *ebl, Elf_Scn *scn, G
1393 class == ELFCLASS32 ? 10 : 18, shdr->sh_addr,
1394 shdr->sh_offset,
1395 (unsigned int) shdr->sh_link,
1396- elf_strptr (ebl->elf, shstrndx,
1397- gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link),
1398- &glink)->sh_name));
1399+ elf_strptr (ebl->elf, shstrndx, glink->sh_name));
1400
1401 unsigned int offset = 0;
1402 for (int cnt = shdr->sh_info; --cnt >= 0; )
1403@@ -2561,25 +2584,30 @@ handle_versym (Ebl *ebl, Elf_Scn *scn, G
1404 filename = NULL;
1405 }
1406
1407+ GElf_Shdr glink_mem;
1408+ GElf_Shdr *glink = gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link),
1409+ &glink_mem);
1410+ size_t sh_entsize = gelf_fsize (ebl->elf, ELF_T_HALF, 1, EV_CURRENT);
1411+ if (glink == NULL)
1412+ error (EXIT_FAILURE, 0, gettext ("invalid sh_link value in section %Zu"),
1413+ elf_ndxscn (scn));
1414+
1415 /* Print the header. */
1416- GElf_Shdr glink;
1417 printf (ngettext ("\
1418 \nVersion symbols section [%2u] '%s' contains %d entry:\n Addr: %#0*" PRIx64 " Offset: %#08" PRIx64 " Link to section: [%2u] '%s'",
1419 "\
1420 \nVersion symbols section [%2u] '%s' contains %d entries:\n Addr: %#0*" PRIx64 " Offset: %#08" PRIx64 " Link to section: [%2u] '%s'",
1421- shdr->sh_size / shdr->sh_entsize),
1422+ shdr->sh_size / sh_entsize),
1423 (unsigned int) elf_ndxscn (scn),
1424 elf_strptr (ebl->elf, shstrndx, shdr->sh_name),
1425- (int) (shdr->sh_size / shdr->sh_entsize),
1426+ (int) (shdr->sh_size / sh_entsize),
1427 class == ELFCLASS32 ? 10 : 18, shdr->sh_addr,
1428 shdr->sh_offset,
1429 (unsigned int) shdr->sh_link,
1430- elf_strptr (ebl->elf, shstrndx,
1431- gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link),
1432- &glink)->sh_name));
1433+ elf_strptr (ebl->elf, shstrndx, glink->sh_name));
1434
1435 /* Now we can finally look at the actual contents of this section. */
1436- for (unsigned int cnt = 0; cnt < shdr->sh_size / shdr->sh_entsize; ++cnt)
1437+ for (unsigned int cnt = 0; cnt < shdr->sh_size / sh_entsize; ++cnt)
1438 {
1439 if (cnt % 2 == 0)
1440 printf ("\n %4d:", cnt);
1441@@ -2628,7 +2656,17 @@ print_hash_info (Ebl *ebl, Elf_Scn *scn,
1442 for (Elf32_Word cnt = 0; cnt < nbucket; ++cnt)
1443 ++counts[lengths[cnt]];
1444
1445- GElf_Shdr glink;
1446+ GElf_Shdr glink_mem;
1447+ GElf_Shdr *glink = gelf_getshdr (elf_getscn (ebl->elf,
1448+ shdr->sh_link),
1449+ &glink_mem);
1450+ if (glink == NULL)
1451+ {
1452+ error (0, 0, gettext ("invalid sh_link value in section %Zu"),
1453+ elf_ndxscn (scn));
1454+ return;
1455+ }
1456+
1457 printf (ngettext ("\
1458 \nHistogram for bucket list length in section [%2u] '%s' (total of %d bucket):\n Addr: %#0*" PRIx64 " Offset: %#08" PRIx64 " Link to section: [%2u] '%s'\n",
1459 "\
1460@@ -2641,9 +2679,7 @@ print_hash_info (Ebl *ebl, Elf_Scn *scn,
1461 shdr->sh_addr,
1462 shdr->sh_offset,
1463 (unsigned int) shdr->sh_link,
1464- elf_strptr (ebl->elf, shstrndx,
1465- gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link),
1466- &glink)->sh_name));
1467+ elf_strptr (ebl->elf, shstrndx, glink->sh_name));
1468
1469 if (extrastr != NULL)
1470 fputs (extrastr, stdout);
1471@@ -2903,7 +2939,8 @@ print_liblist (Ebl *ebl)
1472
1473 if (shdr != NULL && shdr->sh_type == SHT_GNU_LIBLIST)
1474 {
1475- int nentries = shdr->sh_size / shdr->sh_entsize;
1476+ size_t sh_entsize = gelf_fsize (ebl->elf, ELF_T_LIB, 1, EV_CURRENT);
1477+ int nentries = shdr->sh_size / sh_entsize;
1478 printf (ngettext ("\
1479 \nLibrary list section [%2zu] '%s' at offset %#0" PRIx64 " contains %d entry:\n",
1480 "\
1481@@ -4164,6 +4201,16 @@ print_debug_aranges_section (Dwfl_Module
1482 return;
1483 }
1484
1485+ GElf_Shdr glink_mem;
1486+ GElf_Shdr *glink;
1487+ glink = gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link), &glink_mem);
1488+ if (glink == NULL)
1489+ {
1490+ error (0, 0, gettext ("invalid sh_link value in section %Zu"),
1491+ elf_ndxscn (scn));
1492+ return;
1493+ }
1494+
1495 printf (ngettext ("\
1496 \nDWARF section [%2zu] '%s' at offset %#" PRIx64 " contains %zu entry:\n",
1497 "\
1498--- elfutils/src/strip.c
1499+++ elfutils/src/strip.c
1500@@ -564,6 +564,11 @@ handle_elf (int fd, Elf *elf, const char
1501 goto fail_close;
1502 }
1503
1504+ if (shstrndx >= shnum)
1505+ goto illformed;
1506+
1507+#define elf_assert(test) do { if (!(test)) goto illformed; } while (0)
1508+
1509 /* Storage for section information. We leave room for two more
1510 entries since we unconditionally create a section header string
1511 table. Maybe some weird tool created an ELF file without one.
1512@@ -585,7 +590,7 @@ handle_elf (int fd, Elf *elf, const char
1513 {
1514 /* This should always be true (i.e., there should not be any
1515 holes in the numbering). */
1516- assert (elf_ndxscn (scn) == cnt);
1517+ elf_assert (elf_ndxscn (scn) == cnt);
1518
1519 shdr_info[cnt].scn = scn;
1520
1521@@ -598,6 +603,7 @@ handle_elf (int fd, Elf *elf, const char
1522 shdr_info[cnt].shdr.sh_name);
1523 if (shdr_info[cnt].name == NULL)
1524 {
1525+ illformed:
1526 error (0, 0, gettext ("illformed file '%s'"), fname);
1527 goto fail_close;
1528 }
1529@@ -607,6 +613,8 @@ handle_elf (int fd, Elf *elf, const char
1530
1531 /* Remember the shdr.sh_link value. */
1532 shdr_info[cnt].old_sh_link = shdr_info[cnt].shdr.sh_link;
1533+ if (shdr_info[cnt].old_sh_link >= shnum)
1534+ goto illformed;
1535
1536 /* Sections in files other than relocatable object files which
1537 are not loaded can be freely moved by us. In relocatable
1538@@ -619,7 +627,7 @@ handle_elf (int fd, Elf *elf, const char
1539 appropriate reference. */
1540 if (unlikely (shdr_info[cnt].shdr.sh_type == SHT_SYMTAB_SHNDX))
1541 {
1542- assert (shdr_info[shdr_info[cnt].shdr.sh_link].symtab_idx == 0);
1543+ elf_assert (shdr_info[shdr_info[cnt].shdr.sh_link].symtab_idx == 0);
1544 shdr_info[shdr_info[cnt].shdr.sh_link].symtab_idx = cnt;
1545 }
1546 else if (unlikely (shdr_info[cnt].shdr.sh_type == SHT_GROUP))
1547@@ -636,7 +644,12 @@ handle_elf (int fd, Elf *elf, const char
1548 for (inner = 1;
1549 inner < shdr_info[cnt].data->d_size / sizeof (Elf32_Word);
1550 ++inner)
1551+ {
1552+ if (grpref[inner] < shnum)
1553 shdr_info[grpref[inner]].group_idx = cnt;
1554+ else
1555+ goto illformed;
1556+ }
1557
1558 if (inner == 1 || (inner == 2 && (grpref[0] & GRP_COMDAT) == 0))
1559 /* If the section group contains only one element and this
1560@@ -647,7 +660,7 @@ handle_elf (int fd, Elf *elf, const char
1561 }
1562 else if (unlikely (shdr_info[cnt].shdr.sh_type == SHT_GNU_versym))
1563 {
1564- assert (shdr_info[shdr_info[cnt].shdr.sh_link].version_idx == 0);
1565+ elf_assert (shdr_info[shdr_info[cnt].shdr.sh_link].version_idx == 0);
1566 shdr_info[shdr_info[cnt].shdr.sh_link].version_idx = cnt;
1567 }
1568
1569@@ -655,7 +668,7 @@ handle_elf (int fd, Elf *elf, const char
1570 discarded right away. */
1571 if ((shdr_info[cnt].shdr.sh_flags & SHF_GROUP) != 0)
1572 {
1573- assert (shdr_info[cnt].group_idx != 0);
1574+ elf_assert (shdr_info[cnt].group_idx != 0);
1575
1576 if (shdr_info[shdr_info[cnt].group_idx].idx == 0)
1577 {
1578@@ -731,10 +744,14 @@ handle_elf (int fd, Elf *elf, const char
1579 {
1580 /* If a relocation section is marked as being removed make
1581 sure the section it is relocating is removed, too. */
1582- if ((shdr_info[cnt].shdr.sh_type == SHT_REL
1583+ if (shdr_info[cnt].shdr.sh_type == SHT_REL
1584 || shdr_info[cnt].shdr.sh_type == SHT_RELA)
1585- && shdr_info[shdr_info[cnt].shdr.sh_info].idx != 0)
1586- shdr_info[cnt].idx = 1;
1587+ {
1588+ if (shdr_info[cnt].shdr.sh_info >= shnum)
1589+ goto illformed;
1590+ else if (shdr_info[shdr_info[cnt].shdr.sh_info].idx != 0)
1591+ shdr_info[cnt].idx = 1;
1592+ }
1593
1594 /* If a group section is marked as being removed make
1595 sure all the sections it contains are being removed, too. */
1596@@ -778,7 +795,7 @@ handle_elf (int fd, Elf *elf, const char
1597 if (shdr_info[cnt].symtab_idx != 0
1598 && shdr_info[shdr_info[cnt].symtab_idx].data == NULL)
1599 {
1600- assert (shdr_info[cnt].shdr.sh_type == SHT_SYMTAB);
1601+ elf_assert (shdr_info[cnt].shdr.sh_type == SHT_SYMTAB);
1602
1603 shdr_info[shdr_info[cnt].symtab_idx].data
1604 = elf_getdata (shdr_info[shdr_info[cnt].symtab_idx].scn,
1605@@ -818,6 +835,9 @@ handle_elf (int fd, Elf *elf, const char
1606 else if (scnidx == SHN_XINDEX)
1607 scnidx = xndx;
1608
1609+ if (scnidx >= shnum)
1610+ goto illformed;
1611+
1612 if (shdr_info[scnidx].idx == 0)
1613 /* This symbol table has a real symbol in
1614 a discarded section. So preserve the
1615@@ -848,12 +868,16 @@ handle_elf (int fd, Elf *elf, const char
1616 }
1617
1618 /* Handle references through sh_info. */
1619- if (SH_INFO_LINK_P (&shdr_info[cnt].shdr)
1620- && shdr_info[shdr_info[cnt].shdr.sh_info].idx == 0)
1621+ if (SH_INFO_LINK_P (&shdr_info[cnt].shdr))
1622+ {
1623+ if (shdr_info[cnt].shdr.sh_info >= shnum)
1624+ goto illformed;
1625+ else if ( shdr_info[shdr_info[cnt].shdr.sh_info].idx == 0)
1626 {
1627 shdr_info[shdr_info[cnt].shdr.sh_info].idx = 1;
1628 changes |= shdr_info[cnt].shdr.sh_info < cnt;
1629 }
1630+ }
1631
1632 /* Mark the section as investigated. */
1633 shdr_info[cnt].idx = 2;
1634@@ -994,7 +1018,7 @@ handle_elf (int fd, Elf *elf, const char
1635 error (EXIT_FAILURE, 0, gettext ("while generating output file: %s"),
1636 elf_errmsg (-1));
1637
1638- assert (elf_ndxscn (shdr_info[cnt].newscn) == shdr_info[cnt].idx);
1639+ elf_assert (elf_ndxscn (shdr_info[cnt].newscn) == shdr_info[cnt].idx);
1640
1641 /* Add this name to the section header string table. */
1642 shdr_info[cnt].se = ebl_strtabadd (shst, shdr_info[cnt].name, 0);
1643@@ -1031,7 +1055,7 @@ handle_elf (int fd, Elf *elf, const char
1644 error (EXIT_FAILURE, 0,
1645 gettext ("while create section header section: %s"),
1646 elf_errmsg (-1));
1647- assert (elf_ndxscn (shdr_info[cnt].newscn) == shdr_info[cnt].idx);
1648+ elf_assert (elf_ndxscn (shdr_info[cnt].newscn) == shdr_info[cnt].idx);
1649
1650 shdr_info[cnt].data = elf_newdata (shdr_info[cnt].newscn);
1651 if (shdr_info[cnt].data == NULL)
1652@@ -1087,7 +1111,7 @@ handle_elf (int fd, Elf *elf, const char
1653 error (EXIT_FAILURE, 0,
1654 gettext ("while create section header section: %s"),
1655 elf_errmsg (-1));
1656- assert (elf_ndxscn (shdr_info[cnt].newscn) == idx);
1657+ elf_assert (elf_ndxscn (shdr_info[cnt].newscn) == idx);
1658
1659 /* Finalize the string table and fill in the correct indices in the
1660 section headers. */
1661@@ -1177,20 +1201,20 @@ handle_elf (int fd, Elf *elf, const char
1662 shndxdata = elf_getdata (shdr_info[shdr_info[cnt].symtab_idx].scn,
1663 NULL);
1664
1665- assert ((versiondata->d_size / sizeof (Elf32_Word))
1666+ elf_assert ((versiondata->d_size / sizeof (Elf32_Word))
1667 >= shdr_info[cnt].data->d_size / elsize);
1668 }
1669
1670 if (shdr_info[cnt].version_idx != 0)
1671 {
1672- assert (shdr_info[cnt].shdr.sh_type == SHT_DYNSYM);
1673+ elf_assert (shdr_info[cnt].shdr.sh_type == SHT_DYNSYM);
1674 /* This section has associated version
1675 information. We have to modify that
1676 information, too. */
1677 versiondata = elf_getdata (shdr_info[shdr_info[cnt].version_idx].scn,
1678 NULL);
1679
1680- assert ((versiondata->d_size / sizeof (GElf_Versym))
1681+ elf_assert ((versiondata->d_size / sizeof (GElf_Versym))
1682 >= shdr_info[cnt].data->d_size / elsize);
1683 }
1684
1685@@ -1245,7 +1269,7 @@ handle_elf (int fd, Elf *elf, const char
1686 sec = shdr_info[sym->st_shndx].idx;
1687 else
1688 {
1689- assert (shndxdata != NULL);
1690+ elf_assert (shndxdata != NULL);
1691
1692 sec = shdr_info[xshndx].idx;
1693 }
1694@@ -1266,7 +1290,7 @@ handle_elf (int fd, Elf *elf, const char
1695 nxshndx = sec;
1696 }
1697
1698- assert (sec < SHN_LORESERVE || shndxdata != NULL);
1699+ elf_assert (sec < SHN_LORESERVE || shndxdata != NULL);
1700
1701 if ((inner != destidx || nshndx != sym->st_shndx
1702 || (shndxdata != NULL && nxshndx != xshndx))
1703@@ -1293,9 +1317,11 @@ handle_elf (int fd, Elf *elf, const char
1704 {
1705 size_t sidx = (sym->st_shndx != SHN_XINDEX
1706 ? sym->st_shndx : xshndx);
1707- assert (GELF_ST_TYPE (sym->st_info) == STT_SECTION
1708- || (shdr_info[sidx].shdr.sh_type == SHT_GROUP
1709- && shdr_info[sidx].shdr.sh_info == inner));
1710+ elf_assert (GELF_ST_TYPE (sym->st_info) == STT_SECTION
1711+ || ((shdr_info[sidx].shdr.sh_type
1712+ == SHT_GROUP)
1713+ && (shdr_info[sidx].shdr.sh_info
1714+ == inner)));
1715 }
1716 }
1717
1718@@ -1483,11 +1509,11 @@ handle_elf (int fd, Elf *elf, const char
1719 {
1720 GElf_Sym sym_mem;
1721 GElf_Sym *sym = gelf_getsym (symd, inner, &sym_mem);
1722- assert (sym != NULL);
1723+ elf_assert (sym != NULL);
1724
1725 const char *name = elf_strptr (elf, strshndx,
1726 sym->st_name);
1727- assert (name != NULL);
1728+ elf_assert (name != NULL);
1729 size_t hidx = elf_hash (name) % nbucket;
1730
1731 if (bucket[hidx] == 0)
1732@@ -1506,8 +1532,8 @@ handle_elf (int fd, Elf *elf, const char
1733 else
1734 {
1735 /* Alpha and S390 64-bit use 64-bit SHT_HASH entries. */
1736- assert (shdr_info[cnt].shdr.sh_entsize
1737- == sizeof (Elf64_Xword));
1738+ elf_assert (shdr_info[cnt].shdr.sh_entsize
1739+ == sizeof (Elf64_Xword));
1740
1741 Elf64_Xword *bucket = (Elf64_Xword *) hashd->d_buf;
1742
1743@@ -1537,11 +1563,11 @@ handle_elf (int fd, Elf *elf, const char
1744 {
1745 GElf_Sym sym_mem;
1746 GElf_Sym *sym = gelf_getsym (symd, inner, &sym_mem);
1747- assert (sym != NULL);
1748+ elf_assert (sym != NULL);
1749
1750 const char *name = elf_strptr (elf, strshndx,
1751 sym->st_name);
1752- assert (name != NULL);
1753+ elf_assert (name != NULL);
1754 size_t hidx = elf_hash (name) % nbucket;
1755
1756 if (bucket[hidx] == 0)
diff --git a/meta/recipes-devtools/gdb/gdb/libiberty-cross.patch b/meta/recipes-devtools/gdb/gdb/libiberty-cross.patch
deleted file mode 100644
index d051fdf1ba..0000000000
--- a/meta/recipes-devtools/gdb/gdb/libiberty-cross.patch
+++ /dev/null
@@ -1,632 +0,0 @@
1Upstream-Status: Pending
2
3--- libiberty/configure.in.old 2004-03-31 21:25:25.000000000 +0100
4+++ libiberty/configure.in 2004-03-31 21:18:02.000000000 +0100
5@@ -100,6 +100,7 @@
6 AC_CHECK_TOOL(RANLIB, ranlib, :)
7
8 LIB_AC_PROG_CC
9+AC_PROG_CC_WORKS
10
11 AC_PROG_CC_C_O
12 # autoconf is lame and doesn't give us any substitution variable for this.
13@@ -402,7 +403,6 @@
14
15 # We haven't set the list of objects yet. Use the standard autoconf
16 # tests. This will only work if the compiler works.
17- AC_PROG_CC_WORKS
18 AC_REPLACE_FUNCS($funcs)
19 libiberty_AC_FUNC_C_ALLOCA
20 AC_FUNC_VFORK
21
22--- libiberty/configure.old 2003-06-19 21:05:35.000000000 +0100
23+++ libiberty/configure 2004-03-31 21:35:12.000000000 +0100
24@@ -1000,13 +1000,60 @@
25 fi
26
27
28+echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
29+echo "configure:1005: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
30+
31+ac_ext=c
32+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
33+ac_cpp='$CPP $CPPFLAGS'
34+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
35+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
36+cross_compiling=$ac_cv_prog_cc_cross
37+
38+cat > conftest.$ac_ext << EOF
39+
40+#line 1016 "configure"
41+#include "confdefs.h"
42+
43+main(){return(0);}
44+EOF
45+if { (eval echo configure:1021: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
46+ ac_cv_prog_cc_works=yes
47+ # If we can't run a trivial program, we are probably using a cross compiler.
48+ if (./conftest; exit) 2>/dev/null; then
49+ ac_cv_prog_cc_cross=no
50+ else
51+ ac_cv_prog_cc_cross=yes
52+ fi
53+else
54+ echo "configure: failed program was:" >&5
55+ cat conftest.$ac_ext >&5
56+ ac_cv_prog_cc_works=no
57+fi
58+rm -fr conftest*
59+ac_ext=c
60+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
61+ac_cpp='$CPP $CPPFLAGS'
62+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
63+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
64+cross_compiling=$ac_cv_prog_cc_cross
65+
66+echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
67+if test $ac_cv_prog_cc_works = no; then
68+ { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
69+fi
70+echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
71+echo "configure:1047: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
72+echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
73+cross_compiling=$ac_cv_prog_cc_cross
74+
75
76 if test "x$CC" != xcc; then
77 echo $ac_n "checking whether $CC and cc understand -c and -o together""... $ac_c" 1>&6
78-echo "configure:1007: checking whether $CC and cc understand -c and -o together" >&5
79+echo "configure:1054: checking whether $CC and cc understand -c and -o together" >&5
80 else
81 echo $ac_n "checking whether cc understands -c and -o together""... $ac_c" 1>&6
82-echo "configure:1010: checking whether cc understands -c and -o together" >&5
83+echo "configure:1057: checking whether cc understands -c and -o together" >&5
84 fi
85 set dummy $CC; ac_cc="`echo $2 |
86 sed -e 's/[^a-zA-Z0-9_]/_/g' -e 's/^[0-9]/_/'`"
87@@ -1018,16 +1065,16 @@
88 # We do the test twice because some compilers refuse to overwrite an
89 # existing .o file with -o, though they will create one.
90 ac_try='${CC-cc} -c conftest.c -o conftest.o 1>&5'
91-if { (eval echo configure:1022: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } &&
92- test -f conftest.o && { (eval echo configure:1023: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; };
93+if { (eval echo configure:1069: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } &&
94+ test -f conftest.o && { (eval echo configure:1070: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; };
95 then
96 eval ac_cv_prog_cc_${ac_cc}_c_o=yes
97 if test "x$CC" != xcc; then
98 # Test first that cc exists at all.
99- if { ac_try='cc -c conftest.c 1>&5'; { (eval echo configure:1028: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
100+ if { ac_try='cc -c conftest.c 1>&5'; { (eval echo configure:1075: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
101 ac_try='cc -c conftest.c -o conftest.o 1>&5'
102- if { (eval echo configure:1030: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } &&
103- test -f conftest.o && { (eval echo configure:1031: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; };
104+ if { (eval echo configure:1077: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } &&
105+ test -f conftest.o && { (eval echo configure:1078: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; };
106 then
107 # cc works too.
108 :
109@@ -1063,7 +1110,7 @@
110
111
112 echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
113-echo "configure:1067: checking for POSIXized ISC" >&5
114+echo "configure:1114: checking for POSIXized ISC" >&5
115 if test -d /etc/conf/kconfig.d &&
116 grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
117 then
118@@ -1084,12 +1131,12 @@
119 fi
120
121 echo $ac_n "checking for working const""... $ac_c" 1>&6
122-echo "configure:1088: checking for working const" >&5
123+echo "configure:1135: checking for working const" >&5
124 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
125 echo $ac_n "(cached) $ac_c" 1>&6
126 else
127 cat > conftest.$ac_ext <<EOF
128-#line 1093 "configure"
129+#line 1140 "configure"
130 #include "confdefs.h"
131
132 int main() {
133@@ -1138,7 +1185,7 @@
134
135 ; return 0; }
136 EOF
137-if { (eval echo configure:1142: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
138+if { (eval echo configure:1189: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
139 rm -rf conftest*
140 ac_cv_c_const=yes
141 else
142@@ -1159,21 +1206,21 @@
143 fi
144
145 echo $ac_n "checking for inline""... $ac_c" 1>&6
146-echo "configure:1163: checking for inline" >&5
147+echo "configure:1210: checking for inline" >&5
148 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
149 echo $ac_n "(cached) $ac_c" 1>&6
150 else
151 ac_cv_c_inline=no
152 for ac_kw in inline __inline__ __inline; do
153 cat > conftest.$ac_ext <<EOF
154-#line 1170 "configure"
155+#line 1217 "configure"
156 #include "confdefs.h"
157
158 int main() {
159 } $ac_kw foo() {
160 ; return 0; }
161 EOF
162-if { (eval echo configure:1177: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
163+if { (eval echo configure:1224: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
164 rm -rf conftest*
165 ac_cv_c_inline=$ac_kw; break
166 else
167@@ -1199,14 +1246,14 @@
168 esac
169
170 echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
171-echo "configure:1203: checking whether byte ordering is bigendian" >&5
172+echo "configure:1250: checking whether byte ordering is bigendian" >&5
173 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
174 echo $ac_n "(cached) $ac_c" 1>&6
175 else
176 ac_cv_c_bigendian=unknown
177 # See if sys/param.h defines the BYTE_ORDER macro.
178 cat > conftest.$ac_ext <<EOF
179-#line 1210 "configure"
180+#line 1257 "configure"
181 #include "confdefs.h"
182 #include <sys/types.h>
183 #include <sys/param.h>
184@@ -1217,11 +1264,11 @@
185 #endif
186 ; return 0; }
187 EOF
188-if { (eval echo configure:1221: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
189+if { (eval echo configure:1268: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
190 rm -rf conftest*
191 # It does; now see whether it defined to BIG_ENDIAN or not.
192 cat > conftest.$ac_ext <<EOF
193-#line 1225 "configure"
194+#line 1272 "configure"
195 #include "confdefs.h"
196 #include <sys/types.h>
197 #include <sys/param.h>
198@@ -1232,7 +1279,7 @@
199 #endif
200 ; return 0; }
201 EOF
202-if { (eval echo configure:1236: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
203+if { (eval echo configure:1283: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
204 rm -rf conftest*
205 ac_cv_c_bigendian=yes
206 else
207@@ -1252,7 +1299,7 @@
208 echo $ac_n "cross-compiling... " 2>&6
209 else
210 cat > conftest.$ac_ext <<EOF
211-#line 1256 "configure"
212+#line 1303 "configure"
213 #include "confdefs.h"
214 main () {
215 /* Are we little or big endian? From Harbison&Steele. */
216@@ -1265,7 +1312,7 @@
217 exit (u.c[sizeof (long) - 1] == 1);
218 }
219 EOF
220-if { (eval echo configure:1269: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
221+if { (eval echo configure:1316: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
222 then
223 ac_cv_c_bigendian=no
224 else
225@@ -1283,7 +1330,7 @@
226 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
227 if test $ac_cv_c_bigendian = unknown; then
228 echo $ac_n "checking to probe for byte ordering""... $ac_c" 1>&6
229-echo "configure:1287: checking to probe for byte ordering" >&5
230+echo "configure:1334: checking to probe for byte ordering" >&5
231
232 cat >conftest.c <<EOF
233 short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
234@@ -1352,7 +1399,7 @@
235 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
236 # ./install, which can be erroneously created by make from ./install.sh.
237 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
238-echo "configure:1356: checking for a BSD compatible install" >&5
239+echo "configure:1403: checking for a BSD compatible install" >&5
240 if test -z "$INSTALL"; then
241 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
242 echo $ac_n "(cached) $ac_c" 1>&6
243@@ -1413,7 +1460,7 @@
244 # able to link anything, it had better be able to at least compile
245 # something.
246 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
247-echo "configure:1417: checking how to run the C preprocessor" >&5
248+echo "configure:1464: checking how to run the C preprocessor" >&5
249 # On Suns, sometimes $CPP names a directory.
250 if test -n "$CPP" && test -d "$CPP"; then
251 CPP=
252@@ -1428,13 +1475,13 @@
253 # On the NeXT, cc -E runs the code through the compiler's parser,
254 # not just through cpp.
255 cat > conftest.$ac_ext <<EOF
256-#line 1432 "configure"
257+#line 1479 "configure"
258 #include "confdefs.h"
259 #include <assert.h>
260 Syntax Error
261 EOF
262 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
263-{ (eval echo configure:1438: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
264+{ (eval echo configure:1485: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
265 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
266 if test -z "$ac_err"; then
267 :
268@@ -1445,13 +1492,13 @@
269 rm -rf conftest*
270 CPP="${CC-cc} -E -traditional-cpp"
271 cat > conftest.$ac_ext <<EOF
272-#line 1449 "configure"
273+#line 1496 "configure"
274 #include "confdefs.h"
275 #include <assert.h>
276 Syntax Error
277 EOF
278 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
279-{ (eval echo configure:1455: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
280+{ (eval echo configure:1502: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
281 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
282 if test -z "$ac_err"; then
283 :
284@@ -1462,13 +1509,13 @@
285 rm -rf conftest*
286 CPP="${CC-cc} -nologo -E"
287 cat > conftest.$ac_ext <<EOF
288-#line 1466 "configure"
289+#line 1513 "configure"
290 #include "confdefs.h"
291 #include <assert.h>
292 Syntax Error
293 EOF
294 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
295-{ (eval echo configure:1472: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
296+{ (eval echo configure:1519: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
297 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
298 if test -z "$ac_err"; then
299 :
300@@ -1496,17 +1543,17 @@
301 do
302 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
303 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
304-echo "configure:1500: checking for $ac_hdr" >&5
305+echo "configure:1547: checking for $ac_hdr" >&5
306 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
307 echo $ac_n "(cached) $ac_c" 1>&6
308 else
309 cat > conftest.$ac_ext <<EOF
310-#line 1505 "configure"
311+#line 1552 "configure"
312 #include "confdefs.h"
313 #include <$ac_hdr>
314 EOF
315 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
316-{ (eval echo configure:1510: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
317+{ (eval echo configure:1557: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
318 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
319 if test -z "$ac_err"; then
320 rm -rf conftest*
321@@ -1533,12 +1580,12 @@
322 done
323
324 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
325-echo "configure:1537: checking for sys/wait.h that is POSIX.1 compatible" >&5
326+echo "configure:1584: checking for sys/wait.h that is POSIX.1 compatible" >&5
327 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
328 echo $ac_n "(cached) $ac_c" 1>&6
329 else
330 cat > conftest.$ac_ext <<EOF
331-#line 1542 "configure"
332+#line 1589 "configure"
333 #include "confdefs.h"
334 #include <sys/types.h>
335 #include <sys/wait.h>
336@@ -1554,7 +1601,7 @@
337 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
338 ; return 0; }
339 EOF
340-if { (eval echo configure:1558: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
341+if { (eval echo configure:1605: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
342 rm -rf conftest*
343 ac_cv_header_sys_wait_h=yes
344 else
345@@ -1575,12 +1622,12 @@
346 fi
347
348 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
349-echo "configure:1579: checking whether time.h and sys/time.h may both be included" >&5
350+echo "configure:1626: checking whether time.h and sys/time.h may both be included" >&5
351 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
352 echo $ac_n "(cached) $ac_c" 1>&6
353 else
354 cat > conftest.$ac_ext <<EOF
355-#line 1584 "configure"
356+#line 1631 "configure"
357 #include "confdefs.h"
358 #include <sys/types.h>
359 #include <sys/time.h>
360@@ -1589,7 +1636,7 @@
361 struct tm *tp;
362 ; return 0; }
363 EOF
364-if { (eval echo configure:1593: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
365+if { (eval echo configure:1640: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
366 rm -rf conftest*
367 ac_cv_header_time=yes
368 else
369@@ -1611,19 +1658,19 @@
370
371
372 echo $ac_n "checking whether errno must be declared""... $ac_c" 1>&6
373-echo "configure:1615: checking whether errno must be declared" >&5
374+echo "configure:1662: checking whether errno must be declared" >&5
375 if eval "test \"`echo '$''{'libiberty_cv_declare_errno'+set}'`\" = set"; then
376 echo $ac_n "(cached) $ac_c" 1>&6
377 else
378 cat > conftest.$ac_ext <<EOF
379-#line 1620 "configure"
380+#line 1667 "configure"
381 #include "confdefs.h"
382 #include <errno.h>
383 int main() {
384 int x = errno;
385 ; return 0; }
386 EOF
387-if { (eval echo configure:1627: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
388+if { (eval echo configure:1674: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
389 rm -rf conftest*
390 libiberty_cv_declare_errno=no
391 else
392@@ -1645,12 +1692,12 @@
393
394
395 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
396-echo "configure:1649: checking for ANSI C header files" >&5
397+echo "configure:1696: checking for ANSI C header files" >&5
398 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
399 echo $ac_n "(cached) $ac_c" 1>&6
400 else
401 cat > conftest.$ac_ext <<EOF
402-#line 1654 "configure"
403+#line 1701 "configure"
404 #include "confdefs.h"
405 #include <stdlib.h>
406 #include <stdarg.h>
407@@ -1658,7 +1705,7 @@
408 #include <float.h>
409 EOF
410 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
411-{ (eval echo configure:1662: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
412+{ (eval echo configure:1709: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
413 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
414 if test -z "$ac_err"; then
415 rm -rf conftest*
416@@ -1675,7 +1722,7 @@
417 if test $ac_cv_header_stdc = yes; then
418 # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
419 cat > conftest.$ac_ext <<EOF
420-#line 1679 "configure"
421+#line 1726 "configure"
422 #include "confdefs.h"
423 #include <string.h>
424 EOF
425@@ -1693,7 +1740,7 @@
426 if test $ac_cv_header_stdc = yes; then
427 # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
428 cat > conftest.$ac_ext <<EOF
429-#line 1697 "configure"
430+#line 1744 "configure"
431 #include "confdefs.h"
432 #include <stdlib.h>
433 EOF
434@@ -1714,7 +1761,7 @@
435 :
436 else
437 cat > conftest.$ac_ext <<EOF
438-#line 1718 "configure"
439+#line 1765 "configure"
440 #include "confdefs.h"
441 #include <ctype.h>
442 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
443@@ -1725,7 +1772,7 @@
444 exit (0); }
445
446 EOF
447-if { (eval echo configure:1729: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
448+if { (eval echo configure:1776: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
449 then
450 :
451 else
452@@ -1749,12 +1796,12 @@
453 fi
454
455 echo $ac_n "checking for uintptr_t""... $ac_c" 1>&6
456-echo "configure:1753: checking for uintptr_t" >&5
457+echo "configure:1800: checking for uintptr_t" >&5
458 if eval "test \"`echo '$''{'ac_cv_type_uintptr_t'+set}'`\" = set"; then
459 echo $ac_n "(cached) $ac_c" 1>&6
460 else
461 cat > conftest.$ac_ext <<EOF
462-#line 1758 "configure"
463+#line 1805 "configure"
464 #include "confdefs.h"
465 #include <sys/types.h>
466 #if STDC_HEADERS
467@@ -1790,12 +1837,12 @@
468
469
470 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
471-echo "configure:1794: checking for pid_t" >&5
472+echo "configure:1841: checking for pid_t" >&5
473 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
474 echo $ac_n "(cached) $ac_c" 1>&6
475 else
476 cat > conftest.$ac_ext <<EOF
477-#line 1799 "configure"
478+#line 1846 "configure"
479 #include "confdefs.h"
480 #include <sys/types.h>
481 #if STDC_HEADERS
482@@ -1895,12 +1942,12 @@
483 realpath canonicalize_file_name
484 do
485 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
486-echo "configure:1899: checking for $ac_func" >&5
487+echo "configure:1946: checking for $ac_func" >&5
488 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
489 echo $ac_n "(cached) $ac_c" 1>&6
490 else
491 cat > conftest.$ac_ext <<EOF
492-#line 1904 "configure"
493+#line 1951 "configure"
494 #include "confdefs.h"
495 /* System header to define __stub macros and hopefully few prototypes,
496 which can conflict with char $ac_func(); below. */
497@@ -1923,7 +1970,7 @@
498
499 ; return 0; }
500 EOF
501-if { (eval echo configure:1927: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
502+if { (eval echo configure:1974: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
503 rm -rf conftest*
504 eval "ac_cv_func_$ac_func=yes"
505 else
506@@ -2152,53 +2199,6 @@
507
508 # We haven't set the list of objects yet. Use the standard autoconf
509 # tests. This will only work if the compiler works.
510- echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
511-echo "configure:2157: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
512-
513-ac_ext=c
514-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
515-ac_cpp='$CPP $CPPFLAGS'
516-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
517-ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
518-cross_compiling=$ac_cv_prog_cc_cross
519-
520-cat > conftest.$ac_ext << EOF
521-
522-#line 2168 "configure"
523-#include "confdefs.h"
524-
525-main(){return(0);}
526-EOF
527-if { (eval echo configure:2173: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
528- ac_cv_prog_cc_works=yes
529- # If we can't run a trivial program, we are probably using a cross compiler.
530- if (./conftest; exit) 2>/dev/null; then
531- ac_cv_prog_cc_cross=no
532- else
533- ac_cv_prog_cc_cross=yes
534- fi
535-else
536- echo "configure: failed program was:" >&5
537- cat conftest.$ac_ext >&5
538- ac_cv_prog_cc_works=no
539-fi
540-rm -fr conftest*
541-ac_ext=c
542-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
543-ac_cpp='$CPP $CPPFLAGS'
544-ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
545-ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
546-cross_compiling=$ac_cv_prog_cc_cross
547-
548-echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
549-if test $ac_cv_prog_cc_works = no; then
550- { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
551-fi
552-echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
553-echo "configure:2199: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
554-echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
555-cross_compiling=$ac_cv_prog_cc_cross
556-
557 for ac_func in $funcs
558 do
559 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
560@@ -2900,7 +2900,7 @@
561 esac
562
563
564-for ac_hdr in stdlib.h unistd.h sys/stat.h sys/types.h
565+for ac_hdr in unistd.h
566 do
567 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
568 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
569@@ -3032,24 +3032,11 @@
570 #include <fcntl.h>
571 #include <sys/mman.h>
572
573-#if HAVE_SYS_TYPES_H
574-# include <sys/types.h>
575-#endif
576-
577-#if HAVE_STDLIB_H
578-# include <stdlib.h>
579-#endif
580-
581-#if HAVE_SYS_STAT_H
582-# include <sys/stat.h>
583-#endif
584-
585-#if HAVE_UNISTD_H
586-# include <unistd.h>
587-#endif
588-
589 /* This mess was copied from the GNU getpagesize.h. */
590 #ifndef HAVE_GETPAGESIZE
591+# ifdef HAVE_UNISTD_H
592+# include <unistd.h>
593+# endif
594
595 /* Assume that all systems that can run configure have sys/param.h. */
596 # ifndef HAVE_SYS_PARAM_H
597@@ -3157,7 +3144,7 @@
598 }
599
600 EOF
601-if { (eval echo configure:3161: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
602+if { (eval echo configure:3148: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
603 then
604 ac_cv_func_mmap_fixed_mapped=yes
605 else
606@@ -3181,7 +3168,7 @@
607
608
609 echo $ac_n "checking for working strncmp""... $ac_c" 1>&6
610-echo "configure:3185: checking for working strncmp" >&5
611+echo "configure:3172: checking for working strncmp" >&5
612 if eval "test \"`echo '$''{'ac_cv_func_strncmp_works'+set}'`\" = set"; then
613 echo $ac_n "(cached) $ac_c" 1>&6
614 else
615@@ -3189,7 +3176,7 @@
616 ac_cv_func_strncmp_works=no
617 else
618 cat > conftest.$ac_ext <<EOF
619-#line 3193 "configure"
620+#line 3180 "configure"
621 #include "confdefs.h"
622
623 /* Test by Jim Wilson and Kaveh Ghazi.
624@@ -3253,7 +3240,7 @@
625 }
626
627 EOF
628-if { (eval echo configure:3257: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
629+if { (eval echo configure:3244: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
630 then
631 ac_cv_func_strncmp_works=yes
632 else
diff --git a/meta/recipes-devtools/perl/perl-5.14.3/asm-pageh-fix.patch b/meta/recipes-devtools/perl/perl-5.14.3/asm-pageh-fix.patch
deleted file mode 100644
index c65b1a1fe3..0000000000
--- a/meta/recipes-devtools/perl/perl-5.14.3/asm-pageh-fix.patch
+++ /dev/null
@@ -1,21 +0,0 @@
1Upstream-Status:Pending
2
3Perl inclues asm/page.h in order to get the definition for getpagesize which
4has been definied in unistd.h since glibc 2.1. Some recent version of linux
5libc headers removed the asm/page.h resulting in failures here for some
6people.
7
8Index: perl-5.12.3/cpan/IPC-SysV/SysV.xs
9===================================================================
10--- perl-5.12.3.orig/cpan/IPC-SysV/SysV.xs 2001-07-01 04:46:07.000000000 +1000
11+++ perl-5.12.3/cpan/IPC-SysV/SysV.xs 2001-07-01 04:46:07.000000000 +1000
12@@ -3,9 +3,6 @@
13 #include "XSUB.h"
14
15 #include <sys/types.h>
16-#ifdef __linux__
17-# include <asm/page.h>
18-#endif
19 #if defined(HAS_MSG) || defined(HAS_SEM) || defined(HAS_SHM)
20 #ifndef HAS_SEM
21 # include <sys/ipc.h>
diff --git a/meta/recipes-devtools/python/python-native/sys_platform_is_now_always_linux2.patch b/meta/recipes-devtools/python/python-native/sys_platform_is_now_always_linux2.patch
deleted file mode 100644
index 1cb8fea50f..0000000000
--- a/meta/recipes-devtools/python/python-native/sys_platform_is_now_always_linux2.patch
+++ /dev/null
@@ -1,28 +0,0 @@
1Upstream-Status: Accepted [http://hg.python.org/cpython/rev/c816479f6aaf/]
2Bugtracker: http://bugs.python.org/issue12326
3
4[Removed "Misc/NEWS" hunk]
5
6Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
7
8# HG changeset patch
9# User Victor Stinner <victor.stinner@haypocalc.com>
10# Date 1313841758 -7200
11# Node ID c816479f6aaf71dbd3f3fe4b239186d60c55ce48
12# Parent 3e093590ac57fdda428c7da3f72ddf0c475ecf2b
13Issue #12326: sys.platform is now always 'linux2' on Linux
14
15Even if Python is compiled on Linux 3.
16
17diff --git a/configure.in b/configure.in
18--- a/configure.in
19+++ b/configure.in
20@@ -293,6 +293,7 @@ then
21 MACHDEP="$ac_md_system$ac_md_release"
22
23 case $MACHDEP in
24+ linux*) MACHDEP="linux2";;
25 cygwin*) MACHDEP="cygwin";;
26 darwin*) MACHDEP="darwin";;
27 atheos*) MACHDEP="atheos";;
28
diff --git a/meta/recipes-devtools/python/python-pygobject/generate-constants.patch b/meta/recipes-devtools/python/python-pygobject/generate-constants.patch
deleted file mode 100644
index be2ecd3b7c..0000000000
--- a/meta/recipes-devtools/python/python-pygobject/generate-constants.patch
+++ /dev/null
@@ -1,20 +0,0 @@
1Upstream-Status: Pending
2
3Index: pygobject-2.14.2/gobject/Makefile.am
4===================================================================
5--- pygobject-2.14.2.orig/gobject/Makefile.am
6+++ pygobject-2.14.2/gobject/Makefile.am
7@@ -21,11 +21,11 @@ if PLATFORM_WIN32
8 common_ldflags += -no-undefined
9 endif
10
11-constants.py: generate-constants$(EXEEXT) constants.py.in
12+constants.py: constants.py.in
13 rm -f constants.py
14 cp $(srcdir)/constants.py.in constants.py
15 chmod 644 constants.py
16- $(top_builddir)/gobject/generate-constants$(EXEEXT) >> constants.py
17+ gobject-generate-constants$(EXEEXT) >> constants.py
18 chmod 444 constants.py
19
20 generate_constants_CFLAGS = $(GLIB_CFLAGS)
diff --git a/meta/recipes-devtools/qemu/files/3f08ffb4a4741d147634761dc053ed386243a0de.patch b/meta/recipes-devtools/qemu/files/3f08ffb4a4741d147634761dc053ed386243a0de.patch
deleted file mode 100644
index 4390b943b9..0000000000
--- a/meta/recipes-devtools/qemu/files/3f08ffb4a4741d147634761dc053ed386243a0de.patch
+++ /dev/null
@@ -1,42 +0,0 @@
1Upstream-Status: Backport
2
3[Appears to fix the random segfaults we were seeing in a variety of architectures:
4https://bugzilla.yoctoproject.org/show_bug.cgi?id=4216 ]
5
6
7From: Yeongkyoon Lee <yeongkyoon.lee@samsung.com>
8Date: Fri, 22 Mar 2013 12:50:17 +0000 (+0900)
9Subject: tcg: Fix occasional TCG broken problem when ldst optimization enabled
10X-Git-Url: http://git.qemu.org/?p=qemu.git;a=commitdiff_plain;h=52ae646d4a3ebdcdcc973492c6a56f2c49b6578f;hp=3f08ffb4a4741d147634761dc053ed386243a0de
11
12tcg: Fix occasional TCG broken problem when ldst optimization enabled
13
14is_tcg_gen_code() checks the upper limit of TCG generated code range wrong, so
15that TCG could get broken occasionally only when CONFIG_QEMU_LDST_OPTIMIZATION
16enabled. The reason is code_gen_buffer_max_size does not cover the upper range
17up to (TCG_MAX_OP_SIZE * OPC_BUF_SIZE), thus code_gen_buffer_max_size should be
18modified to code_gen_buffer_size.
19
20CC: qemu-stable@nongnu.org
21Signed-off-by: Yeongkyoon Lee <yeongkyoon.lee@samsung.com>
22Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
23Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
24---
25
26Index: qemu-1.4.0/translate-all.c
27===================================================================
28--- qemu-1.4.0.orig/translate-all.c 2013-04-09 10:58:19.000000000 +0000
29+++ qemu-1.4.0/translate-all.c 2013-04-09 10:58:34.783203406 +0000
30@@ -1310,10 +1310,10 @@
31 /* check whether the given addr is in TCG generated code buffer or not */
32 bool is_tcg_gen_code(uintptr_t tc_ptr)
33 {
34- /* This can be called during code generation, code_gen_buffer_max_size
35+ /* This can be called during code generation, code_gen_buffer_size
36 is used instead of code_gen_ptr for upper boundary checking */
37 return (tc_ptr >= (uintptr_t)code_gen_buffer &&
38- tc_ptr < (uintptr_t)(code_gen_buffer + code_gen_buffer_max_size));
39+ tc_ptr < (uintptr_t)(code_gen_buffer + code_gen_buffer_size));
40 }
41 #endif
42
diff --git a/meta/recipes-devtools/qemu/files/enable-i386-linux-user.patch b/meta/recipes-devtools/qemu/files/enable-i386-linux-user.patch
deleted file mode 100644
index bb0d6a3848..0000000000
--- a/meta/recipes-devtools/qemu/files/enable-i386-linux-user.patch
+++ /dev/null
@@ -1,55 +0,0 @@
1Enable i386-linux-user
2
3Signed-off-by: Zhai Edwin <edwin.zhai@intel.com>
4
5Upstream-Status: Inappropriate [configuration]
6
7Index: qemu-0.14.0/Makefile.target
8===================================================================
9--- qemu-0.14.0.orig/Makefile.target
10+++ qemu-0.14.0/Makefile.target
11@@ -78,8 +78,13 @@ ifeq ($(TARGET_BASE_ARCH), i386)
12 libobj-y += cpuid.o
13 endif
14 libobj-$(CONFIG_NEED_MMU) += mmu.o
15+ifndef CONFIG_LINUX_USER
16 libobj-$(TARGET_I386) += helper_opengl.o opengl_exec.o
17 libobj-$(TARGET_X86_64) += helper_opengl.o opengl_exec.o
18+else
19+libobj-$(TARGET_I386) += dummygl.o
20+libobj-$(TARGET_X86_64) += dummygl.o
21+endif #CONFIG_LINUX_USER
22 libobj-$(TARGET_ARM) += dummygl.o
23 libobj-$(TARGET_MIPS) += dummygl.o
24 libobj-$(TARGET_PPC) += dummygl.o
25Index: qemu-0.14.0/target-i386/dummygl.c
26===================================================================
27--- /dev/null
28+++ qemu-0.14.0/target-i386/dummygl.c
29@@ -0,0 +1,26 @@
30+#include <string.h>
31+#include <stdlib.h>
32+#include <assert.h>
33+#include <stdint.h>
34+#include <X11/Xlib.h>
35+#include <X11/Xutil.h>
36+
37+void opengl_exec_set_parent_window(Display* _dpy, Window _parent_window)
38+{
39+
40+}
41+
42+void opengl_process_enable(void)
43+{
44+
45+}
46+
47+
48+void mem_opengl(uint64_t ptr)
49+{
50+
51+}
52+
53+void helper_opengl(void)
54+{
55+}
diff --git a/meta/recipes-devtools/qemu/files/init-info.patch b/meta/recipes-devtools/qemu/files/init-info.patch
deleted file mode 100644
index 2250444a2b..0000000000
--- a/meta/recipes-devtools/qemu/files/init-info.patch
+++ /dev/null
@@ -1,18 +0,0 @@
1# This is a workaround to the crashes seen on Ubuntu. Setting info to zero
2# makes info.info.x11.display zero and avoids the calls to
3# opengl_exec_set_parent_window, one of which is crashing.
4
5Upstream-Status: Pending
6
7Index: qemu-0.14.0/ui/sdl.c
8===================================================================
9--- qemu-0.14.0.orig/ui/sdl.c
10+++ qemu-0.14.0/ui/sdl.c
11@@ -863,6 +863,7 @@ void sdl_display_init(DisplayState *ds,
12 vi = SDL_GetVideoInfo();
13 host_format = *(vi->vfmt);
14
15+ bzero(&info, sizeof(info));
16 SDL_GetWMInfo(&info);
17 if (info.subsystem == SDL_SYSWM_X11 && info.info.x11.display)
18 opengl_exec_set_parent_window(info.info.x11.display,
diff --git a/meta/recipes-devtools/rpm/rpm/rpm_fix_for_automake-1.12.patch b/meta/recipes-devtools/rpm/rpm/rpm_fix_for_automake-1.12.patch
deleted file mode 100644
index abbb15d5bf..0000000000
--- a/meta/recipes-devtools/rpm/rpm/rpm_fix_for_automake-1.12.patch
+++ /dev/null
@@ -1,21 +0,0 @@
1Upstream-Status: 2012/05/02
2
3automake 1.12 has depricated automatic de-ANSI-fication.
4
5fix this issue:
6| configure.ac:564: error: automatic de-ANSI-fication support has been removed
7
8Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
92012/05/02
10Index: rpm-5.4.0/configure.ac
11===================================================================
12--- rpm-5.4.0.orig/configure.ac
13+++ rpm-5.4.0/configure.ac
14@@ -561,7 +561,6 @@ dnl # platform specific checks
15 AC_SEARCH_LIBS([strerror],[cposix])
16
17 dnl # standard checks
18-AM_C_PROTOTYPES
19 AC_C_INLINE
20 AC_C_BIGENDIAN
21
diff --git a/meta/recipes-devtools/tcf-agent/tcf-agent/fix_tcf-agent.init.patch b/meta/recipes-devtools/tcf-agent/tcf-agent/fix_tcf-agent.init.patch
deleted file mode 100644
index 8ea5b43d53..0000000000
--- a/meta/recipes-devtools/tcf-agent/tcf-agent/fix_tcf-agent.init.patch
+++ /dev/null
@@ -1,96 +0,0 @@
1Upstream-Status: Inappropriate [poky-specific script]
2
3--- a/Makefile
4+++ b/Makefile
5@@ -64,7 +64,7 @@
6 install -d -m 755 $(INSTALLROOT)$(INCLUDE)/tcf/services
7 install -c $(BINDIR)/agent -m 755 $(INSTALLROOT)$(SBIN)/tcf-agent
8 install -c $(BINDIR)/client -m 755 $(INSTALLROOT)$(SBIN)/tcf-client
9- install -c main/tcf-agent.init -m 755 $(INSTALLROOT)$(INIT)/tcf-agent
10+ install -c tcf-agent.init -m 755 $(INSTALLROOT)$(INIT)/tcf-agent
11 install -c config.h -m 755 $(INSTALLROOT)$(INCLUDE)/tcf/config.h
12 install -c -t $(INSTALLROOT)$(INCLUDE)/tcf/framework -m 644 framework/*.h
13 install -c -t $(INSTALLROOT)$(INCLUDE)/tcf/services -m 644 services/*.h
14--- /dev/null
15+++ b/tcf-agent.init
16@@ -0,0 +1,80 @@
17+#!/bin/sh
18+### BEGIN INIT INFO
19+# Provides: tcf-agent
20+# Default-Start: 3 5
21+# Default-Stop: 0 1 2 6
22+# Short-Description: Target Communication Framework agent
23+### END INIT INFO
24+
25+DAEMON_PATH=/usr/sbin/tcf-agent
26+DAEMON_NAME=`basename $DAEMON_PATH`
27+
28+. /etc/init.d/functions
29+
30+test -x $DAEMON_PATH || exit 0
31+
32+PATH=/sbin:/usr/sbin:/bin:/usr/bin
33+export PATH
34+
35+RETVAL=0
36+
37+case "$1" in
38+ start)
39+ echo -n "Starting $DAEMON_NAME: "
40+ $DAEMON_PATH -d -L- -l0
41+ RETVAL=$?
42+ if [ $RETVAL -eq 0 ] ; then
43+ echo "OK"
44+ touch /var/lock/subsys/$DAEMON_NAME
45+ else
46+ echo "FAIL"
47+ fi
48+ ;;
49+
50+ stop)
51+ echo -n "Stopping $DAEMON_NAME: "
52+ count=0
53+ pid=$(/bin/pidof $DAEMON_PATH)
54+ while [ -n "`/bin/pidof $DAEMON_PATH`" -a $count -lt 10 ] ; do
55+ kill $pid > /dev/null 2>&1
56+ sleep 1
57+ RETVAL=$?
58+ if [ $RETVAL != 0 -o -n "`/bin/pidof $DAEMON_PATH`" ] ; then
59+ sleep 3
60+ fi
61+ count=`expr $count + 1`
62+ pid=$(/bin/pidof $DAEMON_PATH)
63+ done
64+ rm -f /var/lock/subsys/$DAEMON_NAME
65+ if [ -n "`/bin/pidof $DAEMON_PATH`" ] ; then
66+ echo "FAIL"
67+ else
68+ echo "OK"
69+ fi
70+ ;;
71+
72+ restart)
73+ $0 stop
74+ sleep 1
75+ $0 start
76+ ;;
77+
78+ status)
79+ if [ -n "`/bin/pidof $DAEMON_PATH`" ] ; then
80+ echo "$DAEMON_NAME is running"
81+ else
82+ echo "$DAEMON_NAME is not running"
83+ fi
84+ ;;
85+
86+ condrestart)
87+ [ -f /var/lock/subsys/$DAEMON_NAME ] && $0 restart
88+ ;;
89+
90+ *)
91+ echo "usage: $0 { start | stop | restart | condrestart | status }"
92+ ;;
93+esac
94+
95+exit $RETVAL
96+
diff --git a/meta/recipes-extended/iputils/files/arping-break-libsysfs-dependency.patch b/meta/recipes-extended/iputils/files/arping-break-libsysfs-dependency.patch
deleted file mode 100644
index 37325ee0ae..0000000000
--- a/meta/recipes-extended/iputils/files/arping-break-libsysfs-dependency.patch
+++ /dev/null
@@ -1,296 +0,0 @@
1arping: Break libsysfs dependency
2
3Port Fedora 17's iputils-20071127-infiniband.patch, which inlines sysfs
4access previously done by libsysfs (which is in /usr, and thus not
5usable by /bin/arping).
6
7Upstream-Status: Inappropriate [not author]
8Signed-off-by: Andy Ross <andy.ross@windriver.com>
9---
10 Makefile | 2 +-
11 arping.c | 152 ++++++++++++++++++++++++++++++++++++++++++++------------------
12 2 files changed, 109 insertions(+), 45 deletions(-)
13
14diff --git a/Makefile b/Makefile
15index d9a5ca5..943f048 100644
16--- a/Makefile
17+++ b/Makefile
18@@ -27,7 +27,7 @@ all: $(TARGETS)
19
20
21 tftpd: tftpd.o tftpsubs.o
22-arping: arping.o -lsysfs
23+arping: arping.o
24 ping: ping.o ping_common.o
25 ping6: ping6.o ping_common.o -lresolv -lcrypto
26 ping.o ping6.o ping_common.o: ping_common.h
27diff --git a/arping.c b/arping.c
28index 13484de..6379354 100644
29--- a/arping.c
30+++ b/arping.c
31@@ -32,8 +32,6 @@
32 #include <netinet/in.h>
33 #include <arpa/inet.h>
34
35-#include <sysfs/libsysfs.h>
36-
37 #include "SNAPSHOT.h"
38
39 static void usage(void) __attribute__((noreturn));
40@@ -52,14 +50,22 @@ int unicasting;
41 int s;
42 int broadcast_only;
43
44-struct sockaddr_storage me;
45-struct sockaddr_storage he;
46+struct sockaddr_ll *me=NULL;
47+struct sockaddr_ll *he=NULL;
48
49 struct timeval start, last;
50
51 int sent, brd_sent;
52 int received, brd_recv, req_recv;
53
54+#define SYSFS_MNT_PATH "/sys"
55+#define SYSFS_CLASS "class"
56+#define SYSFS_NET "net"
57+#define SYSFS_BROADCAST "broadcast"
58+#define SYSFS_PATH_ENV "SYSFS_PATH"
59+#define SYSFS_PATH_LEN 256
60+#define SOCKADDR_LEN (2 * sizeof(struct sockaddr_ll))
61+
62 #define MS_TDIFF(tv1,tv2) ( ((tv1).tv_sec-(tv2).tv_sec)*1000 + \
63 ((tv1).tv_usec-(tv2).tv_usec)/1000 )
64
65@@ -166,6 +172,10 @@ void finish(void)
66 printf("\n");
67 fflush(stdout);
68 }
69+
70+ free(me);
71+ free(he);
72+
73 if (dad)
74 exit(!!received);
75 if (unsolicited)
76@@ -189,8 +199,7 @@ void catcher(void)
77 finish();
78
79 if ( count!=0 && (last.tv_sec==0 || MS_TDIFF(tv,last) > 500 ) ) {
80- send_pack(s, src, dst,
81- (struct sockaddr_ll *)&me, (struct sockaddr_ll *)&he);
82+ send_pack(s, src, dst, me, he);
83 if (count >= 0)
84 count--;
85 if (count == 0 && unsolicited)
86@@ -239,7 +248,7 @@ int recv_pack(unsigned char *buf, int len, struct sockaddr_ll *FROM)
87 return 0;
88 if (ah->ar_pln != 4)
89 return 0;
90- if (ah->ar_hln != ((struct sockaddr_ll *)&me)->sll_halen)
91+ if (ah->ar_hln != me->sll_halen)
92 return 0;
93 if (len < sizeof(*ah) + 2*(4 + ah->ar_hln))
94 return 0;
95@@ -250,7 +259,7 @@ int recv_pack(unsigned char *buf, int len, struct sockaddr_ll *FROM)
96 return 0;
97 if (src.s_addr != dst_ip.s_addr)
98 return 0;
99- if (memcmp(p+ah->ar_hln+4, ((struct sockaddr_ll *)&me)->sll_addr, ah->ar_hln))
100+ if (memcmp(p+ah->ar_hln+4, me->sll_addr, ah->ar_hln))
101 return 0;
102 } else {
103 /* DAD packet was:
104@@ -268,7 +277,7 @@ int recv_pack(unsigned char *buf, int len, struct sockaddr_ll *FROM)
105 */
106 if (src_ip.s_addr != dst.s_addr)
107 return 0;
108- if (memcmp(p, ((struct sockaddr_ll *)&me)->sll_addr, ((struct sockaddr_ll *)&me)->sll_halen) == 0)
109+ if (memcmp(p, me->sll_addr, me->sll_halen) == 0)
110 return 0;
111 if (src.s_addr && src.s_addr != dst_ip.s_addr)
112 return 0;
113@@ -284,7 +293,7 @@ int recv_pack(unsigned char *buf, int len, struct sockaddr_ll *FROM)
114 printf("for %s ", inet_ntoa(dst_ip));
115 s_printed = 1;
116 }
117- if (memcmp(p+ah->ar_hln+4, ((struct sockaddr_ll *)&me)->sll_addr, ah->ar_hln)) {
118+ if (memcmp(p+ah->ar_hln+4, me->sll_addr, ah->ar_hln)) {
119 if (!s_printed)
120 printf("for ");
121 printf("[");
122@@ -310,40 +319,67 @@ int recv_pack(unsigned char *buf, int len, struct sockaddr_ll *FROM)
123 if (quit_on_reply)
124 finish();
125 if(!broadcast_only) {
126- memcpy(((struct sockaddr_ll *)&he)->sll_addr, p, ((struct sockaddr_ll *)&me)->sll_halen);
127+ memcpy(he->sll_addr, p, me->sll_halen);
128 unicasting=1;
129 }
130 return 1;
131 }
132
133-void set_device_broadcast(char *device, unsigned char *ba, size_t balen)
134+int get_sysfs_mnt_path(char *mnt_path, size_t len)
135 {
136- struct sysfs_class_device *dev;
137- struct sysfs_attribute *brdcast;
138- unsigned char *p;
139- int ch;
140+ const char *sysfs_path_env;
141+ int pth_len=0;
142
143- dev = sysfs_open_class_device("net", device);
144- if (!dev) {
145- perror("sysfs_open_class_device(net)");
146- exit(2);
147- }
148+ if (len == 0 || mnt_path == NULL)
149+ return -1;
150
151- brdcast = sysfs_get_classdev_attr(dev, "broadcast");
152- if (!brdcast) {
153- perror("sysfs_get_classdev_attr(broadcast)");
154- exit(2);
155- }
156+ /* possible overrride of real mount path */
157+ sysfs_path_env = getenv(SYSFS_PATH_ENV);
158+ memset(mnt_path, 0, len);
159+ strncpy(mnt_path,
160+ sysfs_path_env != NULL ? sysfs_path_env : SYSFS_MNT_PATH,
161+ len-1);
162
163- if (sysfs_read_attribute(brdcast)) {
164- perror("sysfs_read_attribute");
165- exit(2);
166- }
167+ if ((pth_len = strlen(mnt_path)) > 0 && mnt_path[pth_len-1] == '/')
168+ mnt_path[pth_len-1] = '\0';
169+
170+ return 0;
171+}
172+
173+int make_sysfs_broadcast_path(char *broadcast_path, size_t len)
174+{
175+ char mnt_path[SYSFS_PATH_LEN];
176+
177+ if (get_sysfs_mnt_path(mnt_path, len) != 0)
178+ return -1;
179
180- for (p = ba, ch = 0; p < ba + balen; p++, ch += 3)
181- *p = strtoul(brdcast->value + ch, NULL, 16);
182+ snprintf(broadcast_path, len,
183+ "%s/" SYSFS_CLASS "/" SYSFS_NET "/%s/" SYSFS_BROADCAST,
184+ mnt_path, device);
185
186- return;
187+ return 0;
188+}
189+
190+char * read_sysfs_broadcast(char *brdcast_path)
191+{
192+ int fd;
193+ int len_to_read;
194+ char *brdcast = NULL;
195+
196+ if ((fd = open(brdcast_path, O_RDONLY)) > -1) {
197+ len_to_read = lseek(fd, 0L, SEEK_END);
198+ if ((brdcast = malloc(len_to_read+1)) != NULL) {
199+ lseek(fd, 0L, SEEK_SET);
200+ memset(brdcast, 0, len_to_read+1);
201+ if (read(fd, brdcast, len_to_read) == -1) {
202+ free(brdcast);
203+ brdcast = NULL;
204+ }
205+ }
206+ close(fd);
207+ }
208+
209+ return brdcast;
210 }
211
212 int
213@@ -361,6 +397,17 @@ main(int argc, char **argv)
214 exit(-1);
215 }
216
217+ me = malloc(SOCKADDR_LEN);
218+ if (!me) {
219+ fprintf(stderr, "arping: could not allocate memory\n");
220+ exit(1);
221+ }
222+ he = malloc(SOCKADDR_LEN);
223+ if (!he) {
224+ fprintf(stderr, "arping: could not allocate memory\n");
225+ exit(1);
226+ }
227+
228 while ((ch = getopt(argc, argv, "h?bfDUAqc:w:s:I:V")) != EOF) {
229 switch(ch) {
230 case 'b':
231@@ -509,34 +556,51 @@ main(int argc, char **argv)
232 close(probe_fd);
233 };
234
235- ((struct sockaddr_ll *)&me)->sll_family = AF_PACKET;
236- ((struct sockaddr_ll *)&me)->sll_ifindex = ifindex;
237- ((struct sockaddr_ll *)&me)->sll_protocol = htons(ETH_P_ARP);
238- if (bind(s, (struct sockaddr*)&me, sizeof(me)) == -1) {
239+ me->sll_family = AF_PACKET;
240+ me->sll_ifindex = ifindex;
241+ me->sll_protocol = htons(ETH_P_ARP);
242+ if (bind(s, (struct sockaddr*)me, SOCKADDR_LEN) == -1) {
243 perror("bind");
244 exit(2);
245 }
246
247 if (1) {
248- socklen_t alen = sizeof(me);
249- if (getsockname(s, (struct sockaddr*)&me, &alen) == -1) {
250+ socklen_t alen = SOCKADDR_LEN;
251+ if (getsockname(s, (struct sockaddr*)me, &alen) == -1) {
252 perror("getsockname");
253 exit(2);
254 }
255 }
256- if (((struct sockaddr_ll *)&me)->sll_halen == 0) {
257+ if (me->sll_halen == 0) {
258 if (!quiet)
259 printf("Interface \"%s\" is not ARPable (no ll address)\n", device);
260 exit(dad?0:2);
261 }
262
263- he = me;
264+ memcpy(he, me, SOCKADDR_LEN);
265
266 #if 1
267- set_device_broadcast(device, ((struct sockaddr_ll *)&he)->sll_addr,
268- ((struct sockaddr_ll *)&he)->sll_halen);
269+ char brdcast_path[SYSFS_PATH_LEN];
270+ char *brdcast_val=NULL;
271+ char *next_ch;
272+
273+ if (make_sysfs_broadcast_path(brdcast_path, sizeof brdcast_path) != 0) {
274+ perror("sysfs attribute broadcast");
275+ exit(2);
276+ }
277+
278+ if ((brdcast_val = read_sysfs_broadcast(brdcast_path)) == NULL) {
279+ perror("sysfs read broadcast value");
280+ exit(2);
281+ }
282+
283+ for (ch=0; ch<he->sll_halen; ch++) {
284+ he->sll_addr[ch] = strtol(brdcast_val + (ch*3), &next_ch, 16);
285+ }
286+
287+ free(brdcast_val);
288 #else
289- memset(((struct sockaddr_ll *)&he)->sll_addr, -1, ((struct sockaddr_ll *)&he)->sll_halen);
290+ memset(he->sll_addr, -1, he->sll_halen);
291 #endif
292
293 if (!quiet) {
294--
2951.7.10.4
296
diff --git a/meta/recipes-extended/libarchive/libarchive/0003-Patch-from-upstream-rev-2516.patch b/meta/recipes-extended/libarchive/libarchive/0003-Patch-from-upstream-rev-2516.patch
deleted file mode 100644
index 0193a07d19..0000000000
--- a/meta/recipes-extended/libarchive/libarchive/0003-Patch-from-upstream-rev-2516.patch
+++ /dev/null
@@ -1,63 +0,0 @@
1libarchive: Backport patch from upstream (rev 2516)
2
3Fix Issue 100: Allow a zero for the Type M Path Table Location, since
4WinISO (and probably other programs) set it this way.
5
6http://code.google.com/p/libarchive/source/detail?r=2516
7
8Upstream-Status: Backport
9
10Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
11
12diff --git a/libarchive/archive_read_support_format_iso9660.c b/libarchive/archive_read_support_format_iso9660.c
13index 0c640c8..fdef3fb 100644
14--- a/libarchive/archive_read_support_format_iso9660.c
15+++ b/libarchive/archive_read_support_format_iso9660.c
16@@ -714,11 +714,13 @@ isSVD(struct iso9660 *iso9660, const unsigned char *h)
17 if (location <= SYSTEM_AREA_BLOCK+2 || location >= volume_block)
18 return (0);
19
20- /* Location of Occurrence of Type M Path Table must be
21- * available location,
22+ /* The Type M Path Table must be at a valid location (WinISO
23+ * and probably other programs omit this, so we allow zero)
24+ *
25 * > SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */
26 location = archive_be32dec(h+SVD_type_M_path_table_offset);
27- if (location <= SYSTEM_AREA_BLOCK+2 || location >= volume_block)
28+ if ((location > 0 && location <= SYSTEM_AREA_BLOCK+2)
29+ || location >= volume_block)
30 return (0);
31
32 /* Read Root Directory Record in Volume Descriptor. */
33@@ -790,7 +792,8 @@ isEVD(struct iso9660 *iso9660, const unsigned char *h)
34 * available location,
35 * > SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */
36 location = archive_be32dec(h+PVD_type_m_path_table_offset);
37- if (location <= SYSTEM_AREA_BLOCK+2 || location >= volume_block)
38+ if ((location > 0 && location <= SYSTEM_AREA_BLOCK+2)
39+ || location >= volume_block)
40 return (0);
41
42 /* Reserved field must be 0. */
43@@ -865,11 +868,14 @@ isPVD(struct iso9660 *iso9660, const unsigned char *h)
44 if (location <= SYSTEM_AREA_BLOCK+2 || location >= volume_block)
45 return (0);
46
47- /* Location of Occurrence of Type M Path Table must be
48- * available location,
49+ /* The Type M Path Table must also be at a valid location
50+ * (although ECMA 119 requires a Type M Path Table, WinISO and
51+ * probably other programs omit it, so we permit a zero here)
52+ *
53 * > SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */
54 location = archive_be32dec(h+PVD_type_m_path_table_offset);
55- if (location <= SYSTEM_AREA_BLOCK+2 || location >= volume_block)
56+ if ((location > 0 && location <= SYSTEM_AREA_BLOCK+2)
57+ || location >= volume_block)
58 return (0);
59
60 /* Reserved field must be 0. */
61--
621.7.1
63
diff --git a/meta/recipes-extended/procps/procps-3.2.8/pagesz-not-constant.patch b/meta/recipes-extended/procps/procps-3.2.8/pagesz-not-constant.patch
deleted file mode 100644
index b1418518b2..0000000000
--- a/meta/recipes-extended/procps/procps-3.2.8/pagesz-not-constant.patch
+++ /dev/null
@@ -1,24 +0,0 @@
1Upstream-Status: Pending
2
3Index: procps-3.2.1/proc/devname.c
4===================================================================
5--- procps-3.2.1.orig/proc/devname.c 2004-03-18 05:43:50.000000000 +1100
6+++ procps-3.2.1/proc/devname.c 2005-04-02 10:40:17.462138000 +1000
7@@ -227,7 +227,7 @@
8
9 /* number --> name */
10 unsigned dev_to_tty(char *restrict ret, unsigned chop, dev_t dev_t_dev, int pid, unsigned int flags) {
11- static char buf[PAGE_SIZE];
12+ static char buf[4096];
13 char *restrict tmp = buf;
14 unsigned dev = dev_t_dev;
15 unsigned i = 0;
16@@ -249,7 +249,7 @@
17 if((flags&ABBREV_TTY) && !strncmp(tmp,"tty", 3) && tmp[3]) tmp += 3;
18 if((flags&ABBREV_PTS) && !strncmp(tmp,"pts/", 4) && tmp[4]) tmp += 4;
19 /* gotta check before we chop or we may chop someone else's memory */
20- if(chop + (unsigned long)(tmp-buf) <= sizeof buf)
21+ if(chop + (unsigned long)(tmp-buf) < sizeof buf)
22 tmp[chop] = '\0';
23 /* replace non-ASCII characters with '?' and return the number of chars */
24 for(;;){
diff --git a/meta/recipes-gnome/gtk+/gtk+-2.24.22/no-demos.patch b/meta/recipes-gnome/gtk+/gtk+-2.24.22/no-demos.patch
deleted file mode 100644
index abd348ea99..0000000000
--- a/meta/recipes-gnome/gtk+/gtk+-2.24.22/no-demos.patch
+++ /dev/null
@@ -1,15 +0,0 @@
1Upstream-Status: Inappropriate [configuration]
2
3Index: gtk+-2.23.2/Makefile.am
4===================================================================
5--- gtk+-2.23.2.orig/Makefile.am 2010-11-10 20:34:42.000000000 +0800
6+++ gtk+-2.23.2/Makefile.am 2010-11-25 13:39:22.000000000 +0800
7@@ -1,7 +1,7 @@
8 ## Makefile.am for GTK+
9 include $(top_srcdir)/Makefile.decl
10
11-SRC_SUBDIRS = gdk gtk modules demos tests perf
12+SRC_SUBDIRS = gdk gtk modules tests perf
13 SUBDIRS = po po-properties $(SRC_SUBDIRS) docs m4macros build
14
15 # require automake 1.4
diff --git a/meta/recipes-gnome/libglade/libglade-2.6.4/no-deprecation.patch b/meta/recipes-gnome/libglade/libglade-2.6.4/no-deprecation.patch
deleted file mode 100644
index fdea2b0f48..0000000000
--- a/meta/recipes-gnome/libglade/libglade-2.6.4/no-deprecation.patch
+++ /dev/null
@@ -1,13 +0,0 @@
1Upstream-Status: Inappropriate [configuration]
2
3--- libglade-2.5.1/glade/Makefile.am.old 2006-04-25 21:03:25.000000000 +0100
4+++ libglade-2.5.1/glade/Makefile.am 2006-04-25 21:03:45.000000000 +0100
5@@ -30,10 +30,6 @@
6 -I$(top_srcdir) \
7 $(LIBGLADE_CFLAGS) \
8 -DGLADE_LIBDIR=\""$(libdir)"\" \
9- -DG_DISABLE_DEPRECATED \
10- -DGDK_DISABLE_DEPRECATED \
11- -DGDK_PIXBUF_DISABLE_DEPRECATED \
12- -DGTK_DISABLE_DEPRECATED \
13 -DGNOME_DISABLE_DEPRECATED
diff --git a/meta/recipes-graphics/mesa/mesa/0005-llvmpipe-remove-the-power-of-two-sizeof-struct-cmd_b.patch b/meta/recipes-graphics/mesa/mesa/0005-llvmpipe-remove-the-power-of-two-sizeof-struct-cmd_b.patch
deleted file mode 100644
index d86421b767..0000000000
--- a/meta/recipes-graphics/mesa/mesa/0005-llvmpipe-remove-the-power-of-two-sizeof-struct-cmd_b.patch
+++ /dev/null
@@ -1,41 +0,0 @@
1From 33098ef45e6035f3348040a25641f95c95266103 Mon Sep 17 00:00:00 2001
2From: Brian Paul <brianp@vmware.com>
3Date: Wed, 6 Mar 2013 16:57:20 -0700
4Subject: [PATCH 5/5] llvmpipe: remove the power of two sizeof(struct
5 cmd_block) assertion
6MIME-Version: 1.0
7Content-Type: text/plain; charset=UTF-8
8Content-Transfer-Encoding: 8bit
9
10It fails on 32-bit systems (I only tested on 64-bit). Power of two
11size isn't required, so just remove the assertion.
12
13Reviewed-by: José Fonseca <jfonseca@vmware.com>
14
15Upstream-Status: Backport
16http://cgit.freedesktop.org/mesa/mesa/commit/?id=9915636fb8afe75ee2e8e013e4f495a4cb937afb
17---
18 src/gallium/drivers/llvmpipe/lp_scene.c | 7 -------
19 1 file changed, 7 deletions(-)
20
21diff --git a/src/gallium/drivers/llvmpipe/lp_scene.c b/src/gallium/drivers/llvmpipe/lp_scene.c
22index e145391..c88bc95 100644
23--- a/src/gallium/drivers/llvmpipe/lp_scene.c
24+++ b/src/gallium/drivers/llvmpipe/lp_scene.c
25@@ -76,13 +76,6 @@ lp_scene_create( struct pipe_context *pipe )
26 assert(maxCommandBytes < LP_SCENE_MAX_SIZE);
27 /* We'll also need space for at least one other data block */
28 assert(maxCommandPlusData <= LP_SCENE_MAX_SIZE);
29-
30- /* Ideally, the size of a cmd_block object will be a power of two
31- * in order to avoid wasting space when we allocation them from
32- * data blocks (which are power of two also).
33- */
34- assert(sizeof(struct cmd_block) ==
35- util_next_power_of_two(sizeof(struct cmd_block)));
36 }
37 #endif
38
39--
401.8.2.1
41
diff --git a/meta/recipes-graphics/xorg-lib/libxxf86dga/libxxf86dga-1.1.3_fix_for_x32.patch b/meta/recipes-graphics/xorg-lib/libxxf86dga/libxxf86dga-1.1.3_fix_for_x32.patch
deleted file mode 100644
index 4a0c682554..0000000000
--- a/meta/recipes-graphics/xorg-lib/libxxf86dga/libxxf86dga-1.1.3_fix_for_x32.patch
+++ /dev/null
@@ -1,30 +0,0 @@
1Upstream-Status: pending
2
3Fix type conversion for x32. For x32 the off_t is 64bit and pointers are 32bit.
4so the conversion of pointer to off_t was resulting into this error:
5
6| XF86DGA2.c:931:24: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
7| cc1: some warnings being treated as errors
8|
9| make[2]: *** [XF86DGA2.lo] Error 1
10
11Fixed it by typecasting pointer into unsigned long 1st and then again typecasting
12unsigned long to off_t.
13
14Signed-Off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
152012/01/04
16
17
18Index: libXxf86dga-1.1.3/src/XF86DGA2.c
19===================================================================
20--- libXxf86dga-1.1.3.orig/src/XF86DGA2.c
21+++ libXxf86dga-1.1.3/src/XF86DGA2.c
22@@ -928,7 +928,7 @@ DGAMapPhysical(
23 if ((pMap->fd = open(name, O_RDWR)) < 0)
24 return False;
25 pMap->virtual = mmap(NULL, size, PROT_READ | PROT_WRITE,
26- MAP_FILE | MAP_SHARED, pMap->fd, (off_t)base);
27+ MAP_FILE | MAP_SHARED, pMap->fd, (off_t)(unsigned long)base);
28 if (pMap->virtual == (void *)-1)
29 return False;
30 mprotect(pMap->virtual, size, PROT_READ | PROT_WRITE);
diff --git a/meta/recipes-kernel/kmod/kmod/fix-undefined-O_CLOEXEC.patch b/meta/recipes-kernel/kmod/kmod/fix-undefined-O_CLOEXEC.patch
deleted file mode 100644
index 0268216230..0000000000
--- a/meta/recipes-kernel/kmod/kmod/fix-undefined-O_CLOEXEC.patch
+++ /dev/null
@@ -1,17 +0,0 @@
1Upstream-Status: Not applicable
2
3Index: git/libkmod/libkmod-private.h
4===================================================================
5--- git.orig/libkmod/libkmod-private.h 2013-08-21 10:07:51.000000000 -0700
6+++ git/libkmod/libkmod-private.h 2013-08-21 14:34:04.558278849 -0700
7@@ -9,6 +9,10 @@
8 #include "macro.h"
9 #include "libkmod.h"
10
11+#ifndef O_CLOEXEC
12+# define O_CLOEXEC 0
13+#endif
14+
15 static _always_inline_ _printf_format_(2, 3) void
16 kmod_log_null(struct kmod_ctx *ctx, const char *format, ...) {}
17
diff --git a/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/connector-msg-size-fix.patch b/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/connector-msg-size-fix.patch
deleted file mode 100644
index 5d531d65e4..0000000000
--- a/meta/recipes-kernel/linux-libc-headers/linux-libc-headers/connector-msg-size-fix.patch
+++ /dev/null
@@ -1,29 +0,0 @@
1Upstream-Status: Inappropriate [embedded specific]
2
3Currently default header is linux-libc-header, which leads the dismatch
4with wrs kernel.
5
6The different headers for same file cause trouble between kerenl module and
7user level binary. E.g. segfault in v86d due to different
8CONNECTOR_MAX_MSG_SIZE in connector.h from the one used by uvesafb.
9
10This fix is work around to sync with wrs kernel headers, and should be removed
11after switching to linux-libc-headers-wrs.
12
13[BUGID #279] fixed by this.
14
15Signed-off-by: Zhai Edwin <edwin.zhai@intel.com>
16
17Index: linux-2.6.34/include/linux/connector.h
18===================================================================
19--- linux-2.6.34.orig/include/linux/connector.h 2010-09-30 14:15:25.000000000 +0800
20+++ linux-2.6.34/include/linux/connector.h 2010-09-30 14:15:43.000000000 +0800
21@@ -48,7 +48,7 @@
22 /*
23 * Maximum connector's message size.
24 */
25-#define CONNECTOR_MAX_MSG_SIZE 16384
26+#define CONNECTOR_MAX_MSG_SIZE 65536
27
28 /*
29 * idx and val are unique identifiers which
diff --git a/meta/recipes-kernel/linux/linux-yocto/tools-perf-no-scripting.patch b/meta/recipes-kernel/linux/linux-yocto/tools-perf-no-scripting.patch
deleted file mode 100644
index d07335a5f7..0000000000
--- a/meta/recipes-kernel/linux/linux-yocto/tools-perf-no-scripting.patch
+++ /dev/null
@@ -1,52 +0,0 @@
1
2Upstream-Status: Inappropriate [configuration]
3
4Index: tools/perf/Makefile
5===================================================================
6--- a/tools/perf/Makefile 2011-01-14 14:17:33.127008554 -0600
7+++ b/tools/perf/Makefile 2011-01-14 14:18:14.227008548 -0600
8@@ -588,42 +588,8 @@
9 endif
10 endif
11
12-ifdef NO_LIBPERL
13- BASIC_CFLAGS += -DNO_LIBPERL
14-else
15- PERL_EMBED_LDOPTS = $(shell perl -MExtUtils::Embed -e ldopts 2>/dev/null)
16- PERL_EMBED_LDFLAGS = $(call strip-libs,$(PERL_EMBED_LDOPTS))
17- PERL_EMBED_LIBADD = $(call grep-libs,$(PERL_EMBED_LDOPTS))
18- PERL_EMBED_CCOPTS = `perl -MExtUtils::Embed -e ccopts 2>/dev/null`
19- FLAGS_PERL_EMBED=$(PERL_EMBED_CCOPTS) $(PERL_EMBED_LDOPTS)
20-
21- ifneq ($(call try-cc,$(SOURCE_PERL_EMBED),$(FLAGS_PERL_EMBED)),y)
22- BASIC_CFLAGS += -DNO_LIBPERL
23- else
24- ALL_LDFLAGS += $(PERL_EMBED_LDFLAGS)
25- EXTLIBS += $(PERL_EMBED_LIBADD)
26- LIB_OBJS += $(OUTPUT)util/scripting-engines/trace-event-perl.o
27- LIB_OBJS += $(OUTPUT)scripts/perl/Perf-Trace-Util/Context.o
28- endif
29-endif
30-
31-ifdef NO_LIBPYTHON
32- BASIC_CFLAGS += -DNO_LIBPYTHON
33-else
34- PYTHON_EMBED_LDOPTS = $(shell python-config --ldflags 2>/dev/null)
35- PYTHON_EMBED_LDFLAGS = $(call strip-libs,$(PYTHON_EMBED_LDOPTS))
36- PYTHON_EMBED_LIBADD = $(call grep-libs,$(PYTHON_EMBED_LDOPTS))
37- PYTHON_EMBED_CCOPTS = `python-config --cflags 2>/dev/null`
38- FLAGS_PYTHON_EMBED=$(PYTHON_EMBED_CCOPTS) $(PYTHON_EMBED_LDOPTS)
39- ifneq ($(call try-cc,$(SOURCE_PYTHON_EMBED),$(FLAGS_PYTHON_EMBED)),y)
40- BASIC_CFLAGS += -DNO_LIBPYTHON
41- else
42- ALL_LDFLAGS += $(PYTHON_EMBED_LDFLAGS)
43- EXTLIBS += $(PYTHON_EMBED_LIBADD)
44- LIB_OBJS += $(OUTPUT)util/scripting-engines/trace-event-python.o
45- LIB_OBJS += $(OUTPUT)scripts/python/Perf-Trace-Util/Context.o
46- endif
47-endif
48+BASIC_CFLAGS += -DNO_LIBPERL
49+BASIC_CFLAGS += -DNO_LIBPYTHON
50
51 ifdef NO_DEMANGLE
52 BASIC_CFLAGS += -DNO_DEMANGLE
diff --git a/meta/recipes-support/gnutls/gnutls/gnutls-texinfo-euro.patch b/meta/recipes-support/gnutls/gnutls/gnutls-texinfo-euro.patch
deleted file mode 100644
index 10e377407a..0000000000
--- a/meta/recipes-support/gnutls/gnutls/gnutls-texinfo-euro.patch
+++ /dev/null
@@ -1,18 +0,0 @@
1Upstream-Status: Backport
2
3The version of texinfo in Debian Sarge does not understand the @euro{} command.
4This patch replaces the @euro{} command with the word "euro".
5
6--- gnutls-1.3.5/doc/gnutls.texi.orig 2006-04-26 08:06:40.918268000 +0930
7+++ gnutls-1.3.5/doc/gnutls.texi 2006-04-26 08:06:52.446515440 +0930
8@@ -11,8 +11,8 @@
9 long as it is difficult enough to generate two different messages with
10 the same hash algorithm output. In that case the same signature could
11 be used as a proof for both messages. Nobody wants to sign an innocent
12-message of donating 1 @euro{} to Greenpeace and find out that he
13-donated 1.000.000 @euro{} to Bad Inc.
14+message of donating 1 euro to Greenpeace and find out that he
15+donated 1.000.000 euro to Bad Inc.
16
17 For a hash algorithm to be called cryptographic the following three
18 requirements must hold
diff --git a/meta/recipes-support/nspr/nspr/fix-build-on-aarch64.patch b/meta/recipes-support/nspr/nspr/fix-build-on-aarch64.patch
deleted file mode 100644
index ccad0a1a14..0000000000
--- a/meta/recipes-support/nspr/nspr/fix-build-on-aarch64.patch
+++ /dev/null
@@ -1,101 +0,0 @@
1Add Aarch64 support
2
3Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
4
5Upstream-Status: Submitted https://bugzilla.mozilla.org/show_bug.cgi?id=827271
6---
7 configure.in | 12 ++++++------
8 1 files changed, 6 insertions(+), 6 deletions(-)
9--- a/pr/include/md/_linux.cfg
10+++ b/pr/include/md/_linux.cfg
11@@ -861,6 +861,59 @@
12 #define PR_BYTES_PER_WORD_LOG2 2
13 #define PR_BYTES_PER_DWORD_LOG2 3
14
15+#elif defined(__aarch64__)
16+
17+#ifdef __AARCH64EB__
18+#undef IS_LITTLE_ENDIAN
19+#define IS_BIG_ENDIAN 1
20+#elif defined(__AARCH64EL__)
21+#define IS_LITTLE_ENDIAN 1
22+#undef IS_BIG_ENDIAN
23+#else
24+#error "Unknown Aarch64 endianness."
25+#endif
26+#define IS_64
27+
28+#define PR_BYTES_PER_BYTE 1
29+#define PR_BYTES_PER_SHORT 2
30+#define PR_BYTES_PER_INT 4
31+#define PR_BYTES_PER_INT64 8
32+#define PR_BYTES_PER_LONG 8
33+#define PR_BYTES_PER_FLOAT 4
34+#define PR_BYTES_PER_DOUBLE 8
35+#define PR_BYTES_PER_WORD 8
36+#define PR_BYTES_PER_DWORD 8
37+
38+#define PR_BITS_PER_BYTE 8
39+#define PR_BITS_PER_SHORT 16
40+#define PR_BITS_PER_INT 32
41+#define PR_BITS_PER_INT64 64
42+#define PR_BITS_PER_LONG 64
43+#define PR_BITS_PER_FLOAT 32
44+#define PR_BITS_PER_DOUBLE 64
45+#define PR_BITS_PER_WORD 64
46+
47+#define PR_BITS_PER_BYTE_LOG2 3
48+#define PR_BITS_PER_SHORT_LOG2 4
49+#define PR_BITS_PER_INT_LOG2 5
50+#define PR_BITS_PER_INT64_LOG2 6
51+#define PR_BITS_PER_LONG_LOG2 6
52+#define PR_BITS_PER_FLOAT_LOG2 5
53+#define PR_BITS_PER_DOUBLE_LOG2 6
54+#define PR_BITS_PER_WORD_LOG2 6
55+
56+#define PR_ALIGN_OF_SHORT 2
57+#define PR_ALIGN_OF_INT 4
58+#define PR_ALIGN_OF_LONG 8
59+#define PR_ALIGN_OF_INT64 8
60+#define PR_ALIGN_OF_FLOAT 4
61+#define PR_ALIGN_OF_DOUBLE 8
62+#define PR_ALIGN_OF_POINTER 8
63+#define PR_ALIGN_OF_WORD 8
64+
65+#define PR_BYTES_PER_WORD_LOG2 3
66+#define PR_BYTES_PER_DWORD_LOG2 3
67+
68 #else
69
70 #error "Unknown CPU architecture"
71--- a/pr/include/md/_linux.h
72+++ b/pr/include/md/_linux.h
73@@ -53,6 +53,8 @@
74 #define _PR_SI_ARCHITECTURE "avr32"
75 #elif defined(__m32r__)
76 #define _PR_SI_ARCHITECTURE "m32r"
77+#elif defined(__aarch64__)
78+#define _PR_SI_ARCHITECTURE "aarch64"
79 #else
80 #error "Unknown CPU architecture"
81 #endif
82@@ -186,7 +188,7 @@
83 })
84 #endif
85
86-#if defined(__arm__)
87+#if defined(__arm__) || defined(__aarch64__)
88 #if defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4)
89 /* Use GCC built-in functions */
90 #define _PR_HAVE_ATOMIC_OPS
91@@ -242,6 +244,10 @@
92 #endif
93 #endif /* __arm__ */
94
95+#if defined(__aarch64__)
96+#define _MD_MINIMUM_STACK_SIZE 0x20000
97+#endif
98+
99 #define USE_SETJMP
100 #if (defined(__GLIBC__) && __GLIBC__ >= 2) || defined(ANDROID)
101 #define _PR_POLL_AVAILABLE