summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/binutils
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@linux.intel.com>2010-08-27 15:14:24 +0100
committerRichard Purdie <rpurdie@linux.intel.com>2010-08-27 15:29:45 +0100
commit29d6678fd546377459ef75cf54abeef5b969b5cf (patch)
tree8edd65790e37a00d01c3f203f773fe4b5012db18 /meta/recipes-devtools/binutils
parentda49de6885ee1bc424e70bc02f21f6ab920efb55 (diff)
downloadpoky-29d6678fd546377459ef75cf54abeef5b969b5cf.tar.gz
Major layout change to the packages directory
Having one monolithic packages directory makes it hard to find things and is generally overwhelming. This commit splits it into several logical sections roughly based on function, recipes.txt gives more information about the classifications used. The opportunity is also used to switch from "packages" to "recipes" as used in OpenEmbedded as the term "packages" can be confusing to people and has many different meanings. Not all recipes have been classified yet, this is just a first pass at separating things out. Some packages are moved to meta-extras as they're no longer actively used or maintained. Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'meta/recipes-devtools/binutils')
-rw-r--r--meta/recipes-devtools/binutils/binutils-2.20.1/110-arm-eabi-conf.patch22
-rw-r--r--meta/recipes-devtools/binutils/binutils-2.20.1/binutils-2.16.1-e300c2c3.patch18
-rw-r--r--meta/recipes-devtools/binutils/binutils-2.20.1/binutils-libtool.patch67
-rw-r--r--meta/recipes-devtools/binutils/binutils-2.20.1/binutils-mips-pie.patch29
-rw-r--r--meta/recipes-devtools/binutils/binutils-2.20.1/binutils-uclibc-100-uclibc-conf.patch34
-rw-r--r--meta/recipes-devtools/binutils/binutils-2.20.1/binutils-uclibc-300-001_ld_makefile_patch.patch50
-rw-r--r--meta/recipes-devtools/binutils/binutils-2.20.1/binutils-uclibc-300-006_better_file_error.patch43
-rw-r--r--meta/recipes-devtools/binutils/binutils-2.20.1/binutils-uclibc-300-012_check_ldrunpath_length.patch47
-rw-r--r--meta/recipes-devtools/binutils/binutils-2.20.1/binutils-uclibc-gas-needs-libm.patch38
-rw-r--r--meta/recipes-devtools/binutils/binutils-2.20.1/binutils-x86_64_i386_biarch.patch26
-rw-r--r--meta/recipes-devtools/binutils/binutils-2.20.1/libiberty_path_fix.patch20
-rw-r--r--meta/recipes-devtools/binutils/binutils-cross-canadian.inc16
-rw-r--r--meta/recipes-devtools/binutils/binutils-cross-canadian_2.20.1.bb3
-rw-r--r--meta/recipes-devtools/binutils/binutils-cross.inc25
-rw-r--r--meta/recipes-devtools/binutils/binutils-cross_2.20.1.bb3
-rw-r--r--meta/recipes-devtools/binutils/binutils-cross_csl-arm-2008q1.bb3
-rw-r--r--meta/recipes-devtools/binutils/binutils-crosssdk_2.20.1.bb12
-rw-r--r--meta/recipes-devtools/binutils/binutils.inc146
-rw-r--r--meta/recipes-devtools/binutils/binutils_2.20.1.bb37
-rw-r--r--meta/recipes-devtools/binutils/binutils_csl-arm-2008q1.bb25
-rw-r--r--meta/recipes-devtools/binutils/files/better_file_error.patch17
-rw-r--r--meta/recipes-devtools/binutils/files/ld_makefile.patch22
-rw-r--r--meta/recipes-devtools/binutils/files/objdump_fix.patch134
-rw-r--r--meta/recipes-devtools/binutils/files/plt32trunc.patch24
-rw-r--r--meta/recipes-devtools/binutils/files/signed_char_fix.patch12
25 files changed, 873 insertions, 0 deletions
diff --git a/meta/recipes-devtools/binutils/binutils-2.20.1/110-arm-eabi-conf.patch b/meta/recipes-devtools/binutils/binutils-2.20.1/110-arm-eabi-conf.patch
new file mode 100644
index 0000000000..2623301da0
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils-2.20.1/110-arm-eabi-conf.patch
@@ -0,0 +1,22 @@
1--- /tmp/configure.ac 2008-06-22 14:14:59.000000000 +0200
2+++ binutils-2.18.50.0.7/configure.ac 2008-06-22 14:15:30.000000000 +0200
3@@ -561,7 +561,7 @@
4 noconfigdirs="$noconfigdirs target-libffi target-qthreads"
5 libgloss_dir=arm
6 ;;
7- arm*-*-linux-gnueabi)
8+ arm*-*-linux-gnueabi | arm*-*-linux-uclibcgnueabi)
9 noconfigdirs="$noconfigdirs target-qthreads"
10 noconfigdirs="$noconfigdirs target-libobjc"
11 case ${with_newlib} in
12--- /tmp/configure 2008-06-22 14:17:11.000000000 +0200
13+++ binutils-2.18.50.0.7/configure 2008-06-22 14:17:56.000000000 +0200
14@@ -2307,7 +2307,7 @@
15 noconfigdirs="$noconfigdirs target-libffi target-qthreads"
16 libgloss_dir=arm
17 ;;
18- arm*-*-linux-gnueabi)
19+ arm*-*-linux-gnueabi | arm*-*-linux-uclibcgnueabi)
20 noconfigdirs="$noconfigdirs target-qthreads"
21 noconfigdirs="$noconfigdirs target-libobjc"
22 case ${with_newlib} in
diff --git a/meta/recipes-devtools/binutils/binutils-2.20.1/binutils-2.16.1-e300c2c3.patch b/meta/recipes-devtools/binutils/binutils-2.20.1/binutils-2.16.1-e300c2c3.patch
new file mode 100644
index 0000000000..dfe9b18e17
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils-2.20.1/binutils-2.16.1-e300c2c3.patch
@@ -0,0 +1,18 @@
1Adds support for Freescale Power architecture e300c2 and e300c3 cores.
2http://www.bitshrine.org/gpp/tc-fsl-x86lnx-e300c3-nptl-4.0.2-2.src.rpm
3
4Leon Woestenberg <leonw@mailcan.com>
5
6Index: binutils-2.19.51.0.3/opcodes/ppc-dis.c
7===================================================================
8--- binutils-2.19.51.0.3.orig/opcodes/ppc-dis.c 2009-04-16 00:38:45.000000000 -0700
9+++ binutils-2.19.51.0.3/opcodes/ppc-dis.c 2009-04-16 00:43:56.000000000 -0700
10@@ -132,6 +132,8 @@
11 | PPC_OPCODE_POWER6 | PPC_OPCODE_POWER7 | PPC_OPCODE_ALTIVEC
12 | PPC_OPCODE_VSX),
13 0 },
14+ { "pmr", (PPC_OPCODE_PMR),
15+ 0 },
16 { "ppc", (PPC_OPCODE_PPC | PPC_OPCODE_CLASSIC | PPC_OPCODE_32),
17 0 },
18 { "ppc32", (PPC_OPCODE_PPC | PPC_OPCODE_CLASSIC | PPC_OPCODE_32),
diff --git a/meta/recipes-devtools/binutils/binutils-2.20.1/binutils-libtool.patch b/meta/recipes-devtools/binutils/binutils-2.20.1/binutils-libtool.patch
new file mode 100644
index 0000000000..61517d1d4c
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils-2.20.1/binutils-libtool.patch
@@ -0,0 +1,67 @@
1This is because libdir has a trailing slash which breaks the comparision.
2
3RP 2/1/10
4
5Index: binutils-2.20.1/ltmain.sh
6===================================================================
7--- binutils-2.20.1.orig/ltmain.sh 2009-09-01 00:59:32.000000000 +0800
8+++ binutils-2.20.1/ltmain.sh 2010-07-29 09:41:14.000000000 +0800
9@@ -2156,8 +2156,12 @@
10 dir="$dir$objdir"
11
12 if test -n "$relink_command"; then
13+ # Strip any trailing slash from the destination.
14+ func_stripname '' '/' "$libdir"
15+ destlibdir=$func_stripname_result
16+
17 # Determine the prefix the user has applied to our future dir.
18- inst_prefix_dir=`$ECHO "X$destdir" | $Xsed -e "s%$libdir\$%%"`
19+ inst_prefix_dir=`$ECHO "X$destdir" | $Xsed -e "s%$destlibdir\$%%"`
20
21 # Don't allow the user to place us outside of our expected
22 # location b/c this prevents finding dependent libraries that
23@@ -5570,8 +5574,14 @@
24 absdir="$abs_ladir"
25 libdir="$abs_ladir"
26 else
27- dir="$libdir"
28- absdir="$libdir"
29+ # Adding 'libdir' from the .la file to our library search paths
30+ # breaks crosscompilation horribly. We cheat here and don't add
31+ # it, instead adding the path where we found the .la. -CL
32+ dir="$abs_ladir"
33+ absdir="$abs_ladir"
34+ libdir="$abs_ladir"
35+ #dir="$libdir"
36+ #absdir="$libdir"
37 fi
38 test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
39 else
40@@ -5942,8 +5952,6 @@
41 add="$libdir/$linklib"
42 fi
43 else
44- # We cannot seem to hardcode it, guess we'll fake it.
45- add_dir="-L$libdir"
46 # Try looking first in the location we're being installed to.
47 if test -n "$inst_prefix_dir"; then
48 case $libdir in
49@@ -6089,7 +6097,17 @@
50 fi
51 ;;
52 *)
53- path="-L$absdir/$objdir"
54+ # OE sets installed=no in staging. We need to look in $objdir and $absdir,
55+ # preferring $objdir. RP 31/04/2008
56+ if test -f "$absdir/$objdir/$depdepl" ; then
57+ depdepl="$absdir/$objdir/$depdepl"
58+ path="-L$absdir/$objdir"
59+ elif test -f "$absdir/$depdepl" ; then
60+ depdepl="$absdir/$depdepl"
61+ path="-L$absdir"
62+ else
63+ path="-L$absdir/$objdir"
64+ fi
65 ;;
66 esac
67 else
diff --git a/meta/recipes-devtools/binutils/binutils-2.20.1/binutils-mips-pie.patch b/meta/recipes-devtools/binutils/binutils-2.20.1/binutils-mips-pie.patch
new file mode 100644
index 0000000000..c71f0ad4db
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils-2.20.1/binutils-mips-pie.patch
@@ -0,0 +1,29 @@
1# "-fPIE" always triggers segmentation fault in ld.so.1 on mips platform,
2# which was first saw on dbus-daemon. Below borrow the binutils fix from
3# binutils bugzilla:
4#
5# http://sourceware.org/bugzilla/show_bug.cgi?id=10858
6#
7# Its commit message says:
8# * elfxx-mips.c (mips_elf_create_dynamic_relocation): Use section
9# sym dynindx for relocs against defined syms in PIEs.
10#
11# It's in upstream CVS now (rev 1.267), but not in current release
12#
13# By Kevin Tian <kevin.tian@intel.com>, 2010-07-15
14
15diff --git a/elfxx-mips.c b/elfxx-mips.c
16index 3a1c8ba..f6c2c1c 100644
17--- binutils-2.20.1.orig/bfd/elfxx-mips.c
18+++ binutils-2.20.1/bfd/elfxx-mips.c
19@@ -5688,9 +5688,7 @@ mips_elf_create_dynamic_relocation (bfd *output_bfd,
20
21 /* We must now calculate the dynamic symbol table index to use
22 in the relocation. */
23- if (h != NULL
24- && (!h->root.def_regular
25- || (info->shared && !info->symbolic && !h->root.forced_local)))
26+ if (h != NULL && ! SYMBOL_REFERENCES_LOCAL (info, &h->root))
27 {
28 indx = h->root.dynindx;
29 if (SGI_COMPAT (output_bfd))
diff --git a/meta/recipes-devtools/binutils/binutils-2.20.1/binutils-uclibc-100-uclibc-conf.patch b/meta/recipes-devtools/binutils/binutils-2.20.1/binutils-uclibc-100-uclibc-conf.patch
new file mode 100644
index 0000000000..8de04e0fe0
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils-2.20.1/binutils-uclibc-100-uclibc-conf.patch
@@ -0,0 +1,34 @@
1--- binutils-2.18.orig/configure
2+++ binutils-2.18/configure
3@@ -2206,7 +2206,7 @@
4 am33_2.0-*-linux*)
5 noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
6 ;;
7- sh-*-linux*)
8+ sh*-*-linux*)
9 noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
10 ;;
11 sh*-*-pe|mips*-*-pe|*arm-wince-pe)
12@@ -2504,7 +2504,7 @@
13 romp-*-*)
14 noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes target-libgloss ${libgcj}"
15 ;;
16- sh-*-* | sh64-*-*)
17+ sh*-*-* | sh64-*-*)
18 case "${host}" in
19 i[3456789]86-*-vsta) ;; # don't add gprof back in
20 i[3456789]86-*-go32*) ;; # don't add gprof back in
21--- binutils-2.18.orig/gprof/configure
22+++ binutils-2.18/gprof/configure
23@@ -4124,6 +4124,11 @@
24 lt_cv_deplibs_check_method=pass_all
25 ;;
26
27+linux-uclibc*)
28+ lt_cv_deplibs_check_method=pass_all
29+ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
30+ ;;
31+
32 netbsd*)
33 if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
34 lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
diff --git a/meta/recipes-devtools/binutils/binutils-2.20.1/binutils-uclibc-300-001_ld_makefile_patch.patch b/meta/recipes-devtools/binutils/binutils-2.20.1/binutils-uclibc-300-001_ld_makefile_patch.patch
new file mode 100644
index 0000000000..04a7e61e25
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils-2.20.1/binutils-uclibc-300-001_ld_makefile_patch.patch
@@ -0,0 +1,50 @@
1#!/bin/sh -e
2## 001_ld_makefile_patch.dpatch
3##
4## All lines beginning with `## DP:' are a description of the patch.
5## DP: Description: correct where ld scripts are installed
6## DP: Author: Chris Chimelis <chris@debian.org>
7## DP: Upstream status: N/A
8## DP: Date: ??
9
10if [ $# -ne 1 ]; then
11 echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
12 exit 1
13fi
14
15[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
16patch_opts="${patch_opts:--f --no-backup-if-mismatch}"
17
18case "$1" in
19 -patch) patch $patch_opts -p1 < $0;;
20 -unpatch) patch $patch_opts -p1 -R < $0;;
21 *)
22 echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
23 exit 1;;
24esac
25
26exit 0
27
28@DPATCH@
29--- binutils-2.16.91.0.1/ld/Makefile.am
30+++ binutils-2.16.91.0.1/ld/Makefile.am
31@@ -20,7 +20,7 @@
32 # We put the scripts in the directory $(scriptdir)/ldscripts.
33 # We can't put the scripts in $(datadir) because the SEARCH_DIR
34 # directives need to be different for native and cross linkers.
35-scriptdir = $(tooldir)/lib
36+scriptdir = $(libdir)
37
38 EMUL = @EMUL@
39 EMULATION_OFILES = @EMULATION_OFILES@
40--- binutils-2.16.91.0.1/ld/Makefile.in
41+++ binutils-2.16.91.0.1/ld/Makefile.in
42@@ -268,7 +268,7 @@
43 # We put the scripts in the directory $(scriptdir)/ldscripts.
44 # We can't put the scripts in $(datadir) because the SEARCH_DIR
45 # directives need to be different for native and cross linkers.
46-scriptdir = $(tooldir)/lib
47+scriptdir = $(libdir)
48 BASEDIR = $(srcdir)/..
49 BFDDIR = $(BASEDIR)/bfd
50 INCDIR = $(BASEDIR)/include
diff --git a/meta/recipes-devtools/binutils/binutils-2.20.1/binutils-uclibc-300-006_better_file_error.patch b/meta/recipes-devtools/binutils/binutils-2.20.1/binutils-uclibc-300-006_better_file_error.patch
new file mode 100644
index 0000000000..f337611edf
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils-2.20.1/binutils-uclibc-300-006_better_file_error.patch
@@ -0,0 +1,43 @@
1#!/bin/sh -e
2## 006_better_file_error.dpatch by David Kimdon <dwhedon@gordian.com>
3##
4## All lines beginning with `## DP:' are a description of the patch.
5## DP: Specify which filename is causing an error if the filename is a
6## DP: directory. (#45832)
7
8if [ $# -ne 1 ]; then
9 echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
10 exit 1
11fi
12
13[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
14patch_opts="${patch_opts:--f --no-backup-if-mismatch}"
15
16case "$1" in
17 -patch) patch $patch_opts -p1 < $0;;
18 -unpatch) patch $patch_opts -p1 -R < $0;;
19 *)
20 echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
21 exit 1;;
22esac
23
24exit 0
25
26@DPATCH@
27diff -urNad /home/james/debian/packages/binutils/binutils-2.14.90.0.6/bfd/opncls.c binutils-2.14.90.0.6/bfd/opncls.c
28--- /home/james/debian/packages/binutils/binutils-2.14.90.0.6/bfd/opncls.c 2003-07-23 16:08:09.000000000 +0100
29+++ binutils-2.14.90.0.6/bfd/opncls.c 2003-09-10 22:35:00.000000000 +0100
30@@ -150,6 +150,13 @@
31 {
32 bfd *nbfd;
33 const bfd_target *target_vec;
34+ struct stat s;
35+
36+ if (stat (filename, &s) == 0)
37+ if (S_ISDIR(s.st_mode)) {
38+ bfd_set_error (bfd_error_file_not_recognized);
39+ return NULL;
40+ }
41
42 nbfd = _bfd_new_bfd ();
43 if (nbfd == NULL)
diff --git a/meta/recipes-devtools/binutils/binutils-2.20.1/binutils-uclibc-300-012_check_ldrunpath_length.patch b/meta/recipes-devtools/binutils/binutils-2.20.1/binutils-uclibc-300-012_check_ldrunpath_length.patch
new file mode 100644
index 0000000000..498651a90c
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils-2.20.1/binutils-uclibc-300-012_check_ldrunpath_length.patch
@@ -0,0 +1,47 @@
1#!/bin/sh -e
2## 012_check_ldrunpath_length.dpatch by Chris Chimelis <chris@debian.org>
3##
4## All lines beginning with `## DP:' are a description of the patch.
5## DP: Only generate an RPATH entry if LD_RUN_PATH is not empty, for
6## DP: cases where -rpath isn't specified. (#151024)
7
8if [ $# -ne 1 ]; then
9 echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
10 exit 1
11fi
12
13[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
14patch_opts="${patch_opts:--f --no-backup-if-mismatch}"
15
16case "$1" in
17 -patch) patch $patch_opts -p1 < $0;;
18 -unpatch) patch $patch_opts -p1 -R < $0;;
19 *)
20 echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
21 exit 1;;
22esac
23
24exit 0
25
26@DPATCH@
27diff -urNad /home/james/debian/packages/binutils/new/binutils-2.15/ld/emultempl/elf32.em binutils-2.15/ld/emultempl/elf32.em
28--- /home/james/debian/packages/binutils/new/binutils-2.15/ld/emultempl/elf32.em 2004-05-21 23:12:58.000000000 +0100
29+++ binutils-2.15/ld/emultempl/elf32.em 2004-05-21 23:12:59.000000000 +0100
30@@ -692,6 +692,8 @@
31 && command_line.rpath == NULL)
32 {
33 lib_path = (const char *) getenv ("LD_RUN_PATH");
34+ if ((lib_path) && (strlen (lib_path) == 0))
35+ lib_path = NULL;
36 if (gld${EMULATION_NAME}_search_needed (lib_path, &n,
37 force))
38 break;
39@@ -871,6 +873,8 @@
40 rpath = command_line.rpath;
41 if (rpath == NULL)
42 rpath = (const char *) getenv ("LD_RUN_PATH");
43+ if ((rpath) && (strlen (rpath) == 0))
44+ rpath = NULL;
45 if (! (bfd_elf_size_dynamic_sections
46 (output_bfd, command_line.soname, rpath,
47 command_line.filter_shlib,
diff --git a/meta/recipes-devtools/binutils/binutils-2.20.1/binutils-uclibc-gas-needs-libm.patch b/meta/recipes-devtools/binutils/binutils-2.20.1/binutils-uclibc-gas-needs-libm.patch
new file mode 100644
index 0000000000..db838cf20c
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils-2.20.1/binutils-uclibc-gas-needs-libm.patch
@@ -0,0 +1,38 @@
1Source: Khem Raj <raj.khem@gmail.com>
2Disposition: submit upstream.
3
4Description:
5
6We do not need to have the libtool patch anymore for binutils after
7libtool has been updated upstream it include support for it. However
8for building gas natively on uclibc systems we have to link it with
9-lm so that it picks up missing symbols.
10
11/local/build_area/BUILD/arm_v5t_le_uclibc/binutils-2.17.50/objdir/libiberty/pic/libiberty.a(floatformat.o): In function `floatformat_from_double':
12floatformat.c:(.text+0x1ec): undefined reference to `frexp'
13floatformat.c:(.text+0x2f8): undefined reference to `ldexp'
14/local/build_area/BUILD/arm_v5t_le_uclibc/binutils-2.17.50/objdir/libiberty/pic/libiberty.a(floatformat.o): In function `floatformat_to_double':
15floatformat.c:(.text+0x38a): undefined reference to `ldexp'
16floatformat.c:(.text+0x3d2): undefined reference to `ldexp'
17floatformat.c:(.text+0x43e): undefined reference to `ldexp' floatformat.c:(.text+0x4e2): undefined reference to `ldexp'
18collect2: ld returned 1 exit status
19make[4]: *** [as-new] Error 1
20
21Index: binutils-2.17.50/gas/configure.tgt
22===================================================================
23--- binutils-2.17.50.orig/gas/configure.tgt
24+++ binutils-2.17.50/gas/configure.tgt
25@@ -408,6 +408,12 @@ case ${generic_target} in
26 *-*-netware) fmt=elf em=netware ;;
27 esac
28
29+case ${generic_target} in
30+ arm-*-*uclibc*)
31+ need_libm=yes
32+ ;;
33+esac
34+
35 case ${cpu_type} in
36 alpha | arm | i386 | ia64 | mips | ns32k | pdp11 | ppc | sparc | z80 | z8k)
37 bfd_gas=yes
38
diff --git a/meta/recipes-devtools/binutils/binutils-2.20.1/binutils-x86_64_i386_biarch.patch b/meta/recipes-devtools/binutils/binutils-2.20.1/binutils-x86_64_i386_biarch.patch
new file mode 100644
index 0000000000..4cd9e22438
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils-2.20.1/binutils-x86_64_i386_biarch.patch
@@ -0,0 +1,26 @@
1#!/bin/sh -e
2## 127_x86_64_i386_biarch.dpatch
3##
4## DP: Description: Add (/usr)/lib32 to the search paths on x86_64.
5## DP: Author: Aurelien Jarno <aurel32.debian.org>
6## DP: Upstream status: Debian specific
7#
8# Hacked to apply with quilt
9# Adapted to binutils 2.18.50.0.7
10
11--- binutils/ld/emulparams/elf_i386.sh
12+++ binutils/ld/emulparams/elf_i386.sh
13@@ -12,3 +12,13 @@
14 SEPARATE_GOTPLT=12
15 SHARABLE_SECTIONS=yes
16 IREL_IN_PLT=
17+
18+# Linux modify the default library search path to first include
19+# a 32-bit specific directory.
20+case "$target" in
21+ x86_64*-linux* | i[3-7]86*-linux* | x86_64*-kfreebsd*-gnu | i[3-7]86*-kfreebsd*-gnu)
22+ case "$EMULATION_NAME" in
23+ *i386*) LIBPATH_SUFFIX=32 ;;
24+ esac
25+ ;;
26+esac
diff --git a/meta/recipes-devtools/binutils/binutils-2.20.1/libiberty_path_fix.patch b/meta/recipes-devtools/binutils/binutils-2.20.1/libiberty_path_fix.patch
new file mode 100644
index 0000000000..36a14d7a18
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils-2.20.1/libiberty_path_fix.patch
@@ -0,0 +1,20 @@
1don't let the distro compiler point to the wrong installation location
2
3Thanks to RP for helping find the source code causing the issue.
4
52010/08/13
6Nitin A Kamble <nitin.a.kamble@intel.com>
7Index: binutils-2.20.1/libiberty/Makefile.in
8===================================================================
9--- binutils-2.20.1.orig/libiberty/Makefile.in
10+++ binutils-2.20.1/libiberty/Makefile.in
11@@ -327,7 +327,8 @@ install: install_to_$(INSTALL_DEST) inst
12 # multilib-specific flags, it's overridden by FLAGS_TO_PASS from the
13 # default multilib, so we have to take CFLAGS into account as well,
14 # since it will be passed the multilib flags.
15-MULTIOSDIR = `$(CC) $(CFLAGS) -print-multi-os-directory`
16+#MULTIOSDIR = `$(CC) $(CFLAGS) -print-multi-os-directory`
17+MULTIOSDIR = ""
18 install_to_libdir: all
19 ${mkinstalldirs} $(DESTDIR)$(libdir)/$(MULTIOSDIR)
20 $(INSTALL_DATA) $(TARGETLIB) $(DESTDIR)$(libdir)/$(MULTIOSDIR)/$(TARGETLIB)n
diff --git a/meta/recipes-devtools/binutils/binutils-cross-canadian.inc b/meta/recipes-devtools/binutils/binutils-cross-canadian.inc
new file mode 100644
index 0000000000..4953bc2c3b
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils-cross-canadian.inc
@@ -0,0 +1,16 @@
1inherit cross-canadian
2DEPENDS = "flex-native bison-native virtual/${HOST_PREFIX}gcc-crosssdk virtual/libc-nativesdk zlib-nativesdk gettext-nativesdk"
3EXTRA_OECONF = "--with-sysroot=${SDKPATH}/sysroots/${TARGET_SYS} \
4 --program-prefix=${TARGET_PREFIX}"
5
6do_install () {
7 autotools_do_install
8
9 # We're not interested in the libs or headers, these would come from the
10 # nativesdk or target version of the binutils recipe
11 rm -rf ${D}${prefix}/${TARGET_SYS}
12 rm -f ${D}${libdir}/libbfd*
13 rm -f ${D}${libdir}/libiberty*
14 rm -f ${D}${libdir}/libopcodes*
15 rm -f ${D}${includedir}/*.h
16}
diff --git a/meta/recipes-devtools/binutils/binutils-cross-canadian_2.20.1.bb b/meta/recipes-devtools/binutils/binutils-cross-canadian_2.20.1.bb
new file mode 100644
index 0000000000..f4a7a0e619
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils-cross-canadian_2.20.1.bb
@@ -0,0 +1,3 @@
1require binutils_${PV}.bb
2require binutils-cross-canadian.inc
3PR = "r4"
diff --git a/meta/recipes-devtools/binutils/binutils-cross.inc b/meta/recipes-devtools/binutils/binutils-cross.inc
new file mode 100644
index 0000000000..4eeb6584c9
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils-cross.inc
@@ -0,0 +1,25 @@
1inherit cross
2PROVIDES = "virtual/${TARGET_PREFIX}binutils"
3
4EXTRA_OECONF = "--with-sysroot=${STAGING_DIR_TARGET} \
5 --program-prefix=${TARGET_PREFIX} \
6 --disable-install-libbfd \
7 --disable-werror"
8
9do_install () {
10 oe_runmake 'DESTDIR=${D}' install
11
12 # We don't really need these, so we'll remove them...
13 rm -rf ${D}${STAGING_DIR_NATIVE}${libdir_native}/libiberty.a
14 rm -rf ${D}${STAGING_DIR_NATIVE}${prefix_native}/${TARGET_SYS}
15 rm -rf ${D}${STAGING_DIR_NATIVE}${prefix_native}/lib/ldscripts
16 rm -rf ${D}${STAGING_DIR_NATIVE}${prefix_native}/share/info
17 rm -rf ${D}${STAGING_DIR_NATIVE}${prefix_native}/share/locale
18 rm -rf ${D}${STAGING_DIR_NATIVE}${prefix_native}/share/man
19 rmdir ${D}${STAGING_DIR_NATIVE}${prefix_native}/share || :
20 rmdir ${D}${STAGING_DIR_NATIVE}${prefix_native}/${libdir}/gcc-lib || :
21 rmdir ${D}${STAGING_DIR_NATIVE}${prefix_native}/${libdir}64/gcc-lib || :
22 rmdir ${D}${STAGING_DIR_NATIVE}${prefix_native}/${libdir} || :
23 rmdir ${D}${STAGING_DIR_NATIVE}${prefix_native}/${libdir}64 || :
24 rmdir ${D}${STAGING_DIR_NATIVE}${prefix_native}/${prefix} || :
25}
diff --git a/meta/recipes-devtools/binutils/binutils-cross_2.20.1.bb b/meta/recipes-devtools/binutils/binutils-cross_2.20.1.bb
new file mode 100644
index 0000000000..8c7e4bc1a3
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils-cross_2.20.1.bb
@@ -0,0 +1,3 @@
1require binutils_${PV}.bb
2require binutils-cross.inc
3
diff --git a/meta/recipes-devtools/binutils/binutils-cross_csl-arm-2008q1.bb b/meta/recipes-devtools/binutils/binutils-cross_csl-arm-2008q1.bb
new file mode 100644
index 0000000000..8ab1e7f63e
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils-cross_csl-arm-2008q1.bb
@@ -0,0 +1,3 @@
1require binutils_csl-arm-2008q1.bb
2require binutils-cross.inc
3PR = "r1"
diff --git a/meta/recipes-devtools/binutils/binutils-crosssdk_2.20.1.bb b/meta/recipes-devtools/binutils/binutils-crosssdk_2.20.1.bb
new file mode 100644
index 0000000000..f3bc5bfc22
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils-crosssdk_2.20.1.bb
@@ -0,0 +1,12 @@
1require binutils-cross_${PV}.bb
2
3inherit crosssdk
4
5PROVIDES = "virtual/${TARGET_PREFIX}binutils-crosssdk"
6
7PR = "r3"
8
9do_configure_prepend () {
10 sed -i 's#/usr/local/lib /lib /usr/lib#${SDKPATHNATIVE}/lib ${SDKPATHNATIVE}/usr/lib /usr/local/lib /lib /usr/lib#' ${S}/ld/configure.tgt
11}
12
diff --git a/meta/recipes-devtools/binutils/binutils.inc b/meta/recipes-devtools/binutils/binutils.inc
new file mode 100644
index 0000000000..7a352b5d3b
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils.inc
@@ -0,0 +1,146 @@
1DESCRIPTION = "A GNU collection of binary utilities"
2HOMEPAGE = "http://www.gnu.org/software/binutils/"
3BUGTRACKER = "http://sourceware.org/bugzilla/"
4SECTION = "devel"
5LICENSE = "GPLv2"
6
7DEPENDS = "flex-native bison-native"
8
9inherit autotools gettext
10
11PACKAGES += "${PN}-symlinks"
12
13FILES_${PN} = " \
14 ${bindir}/${TARGET_PREFIX}* \
15 ${libdir}/lib*-*.so \
16 ${prefix}/${TARGET_SYS}/bin/*"
17
18FILES_${PN}-dev = " \
19 ${includedir} \
20 ${libdir}/*.a \
21 ${libdir}/*.la \
22 ${libdir}/libbfd.so \
23 ${libdir}/libopcodes.so"
24
25FILES_${PN}-symlinks = " \
26 ${bindir}/addr2line \
27 ${bindir}/as \
28 ${bindir}/c++filt \
29 ${bindir}/gprof \
30 ${bindir}/ld \
31 ${bindir}/nm \
32 ${bindir}/objcopy \
33 ${bindir}/objdump \
34 ${bindir}/ranlib \
35 ${bindir}/readelf \
36 ${bindir}/size \
37 ${bindir}/strip"
38
39B = "${S}/build.${HOST_SYS}.${TARGET_SYS}"
40
41EXTRA_OECONF = "--program-prefix=${TARGET_PREFIX} \
42 --enable-install-libbfd \
43 --enable-shared"
44
45EXTRA_OECONF_virtclass-native = "--enable-target=all --enable-64-bit-bfd --enable-install-libbfd"
46
47# This is necessary due to a bug in the binutils Makefiles
48# EXTRA_OEMAKE = "configure-build-libiberty all"
49
50export AR = "${HOST_PREFIX}ar"
51export AS = "${HOST_PREFIX}as"
52export LD = "${HOST_PREFIX}ld"
53export NM = "${HOST_PREFIX}nm"
54export RANLIB = "${HOST_PREFIX}ranlib"
55export OBJCOPY = "${HOST_PREFIX}objcopy"
56export OBJDUMP = "${HOST_PREFIX}objdump"
57
58export AR_FOR_TARGET = "${TARGET_PREFIX}ar"
59export AS_FOR_TARGET = "${TARGET_PREFIX}as"
60export LD_FOR_TARGET = "${TARGET_PREFIX}ld"
61export NM_FOR_TARGET = "${TARGET_PREFIX}nm"
62export RANLIB_FOR_TARGET = "${TARGET_PREFIX}ranlib"
63
64export CC_FOR_HOST = "${CCACHE}${HOST_PREFIX}gcc ${HOST_CC_ARCH}"
65export CXX_FOR_HOST = "${CCACHE}${HOST_PREFIX}gcc ${HOST_CC_ARCH}"
66
67export CC_FOR_BUILD = "${BUILD_CC}"
68export CPP_FOR_BUILD = "${BUILD_CPP}"
69export CFLAGS_FOR_BUILD = "${BUILD_CFLAGS}"
70
71export CC = "${CCACHE}${HOST_PREFIX}gcc ${HOST_CC_ARCH}"
72
73do_configure () {
74 (cd ${S}; gnu-configize) || die "Failed to run gnu-configize"
75 oe_runconf
76#
77# must prime config.cache to ensure the build of libiberty
78#
79 mkdir -p ${B}/build-${BUILD_SYS}
80 for i in ${CONFIG_SITE}; do
81 cat $i >> ${B}/build-${BUILD_SYS}/config.cache
82 done
83}
84
85do_install () {
86 autotools_do_install
87
88 # We don't really need these, so we'll remove them...
89 rm -rf ${D}${libdir}/ldscripts
90
91 # Fix the /usr/${TARGET_SYS}/bin/* links
92 for l in ${D}${prefix}/${TARGET_SYS}/bin/*; do
93 rm -f $l
94 ln -sf `echo ${prefix}/${TARGET_SYS}/bin \
95 | tr -s / \
96 | sed -e 's,^/,,' -e 's,[^/]*,..,g'`${bindir}/${TARGET_PREFIX}`basename $l` $l
97 done
98
99 # Install the libiberty header
100 install -d ${D}${includedir}
101 install -m 644 ${S}/include/ansidecl.h ${D}${includedir}
102 install -m 644 ${S}/include/libiberty.h ${D}${includedir}
103
104 cd ${D}${bindir}
105
106 # Symlinks for ease of running these on the native target
107 for p in ${TARGET_SYS}-* ; do
108 ln -sf $p `echo $p | sed -e s,${TARGET_SYS}-,,`
109 done
110
111 rm ${D}${bindir}/ar ${D}${bindir}/strings
112}
113
114do_install_virtclass-native () {
115 autotools_do_install
116
117 # Install the libiberty header
118 install -d ${D}${includedir}
119 install -m 644 ${S}/include/ansidecl.h ${D}${includedir}
120 install -m 644 ${S}/include/libiberty.h ${D}${includedir}
121
122 # We only want libiberty, libbfd and libopcodes
123 rm -rf ${D}${bindir}
124 rm -rf ${D}${prefix}/${TARGET_SYS}
125 rm -rf ${D}${prefix}/lib/ldscripts
126 rm -rf ${D}${prefix}/share/info
127 rm -rf ${D}${prefix}/share/locale
128 rm -rf ${D}${prefix}/share/man
129 rmdir ${D}${prefix}/share || :
130 rmdir ${D}/${libdir}/gcc-lib || :
131 rmdir ${D}/${libdir}64/gcc-lib || :
132 rmdir ${D}/${libdir} || :
133 rmdir ${D}/${libdir}64 || :
134}
135
136pkg_postinst_${PN}-symlinks () {
137 update-alternatives --install ${bindir}/ar ar ${TARGET_SYS}-ar 100
138 update-alternatives --install ${bindir}/strings strings ${TARGET_SYS}-strings 100
139}
140
141
142pkg_prerm_${PN}-symlinks () {
143 update-alternatives --remove ar ${TARGET_SYS}-ar
144 update-alternatives --remove strings ${TARGET_SYS}-strings
145}
146
diff --git a/meta/recipes-devtools/binutils/binutils_2.20.1.bb b/meta/recipes-devtools/binutils/binutils_2.20.1.bb
new file mode 100644
index 0000000000..d5cd985cca
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils_2.20.1.bb
@@ -0,0 +1,37 @@
1require binutils.inc
2
3PR = "r2"
4
5LIC_FILES_CHKSUM="\
6 file://src-release;endline=17;md5=4830a9ef968f3b18dd5e9f2c00db2d35\
7 file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552\
8 file://COPYING.LIB;md5=9f604d8a4f8e74f4f5140845a21b6674\
9 file://COPYING3;md5=d32239bcb673463ab874e80d47fae504\
10 file://COPYING3.LIB;md5=6a6a8e020838b23406c81b19c1d46df6\
11 file://gas/COPYING;md5=d32239bcb673463ab874e80d47fae504\
12 file://include/COPYING;md5=59530bdf33659b29e73d4adb9f9f6552\
13 file://include/COPYING3;md5=d32239bcb673463ab874e80d47fae504\
14 file://libiberty/COPYING.LIB;md5=a916467b91076e631dd8edb7424769c7\
15 file://bfd/COPYING;md5=d32239bcb673463ab874e80d47fae504\
16 "
17
18SRC_URI = "\
19 ${GNU_MIRROR}/binutils/binutils-${PV}.tar.bz2;name=tarball \
20 file://binutils-uclibc-100-uclibc-conf.patch \
21 file://110-arm-eabi-conf.patch \
22 file://binutils-uclibc-300-001_ld_makefile_patch.patch \
23 file://binutils-uclibc-300-006_better_file_error.patch \
24 file://binutils-uclibc-300-012_check_ldrunpath_length.patch \
25 file://binutils-uclibc-gas-needs-libm.patch \
26 file://binutils-x86_64_i386_biarch.patch \
27 file://binutils-mips-pie.patch \
28 file://binutils-libtool.patch \
29 file://libiberty_path_fix.patch \
30 "
31
32# powerpc patches
33SRC_URI += "\
34 file://binutils-2.16.1-e300c2c3.patch \
35 "
36
37BBCLASSEXTEND = "native"
diff --git a/meta/recipes-devtools/binutils/binutils_csl-arm-2008q1.bb b/meta/recipes-devtools/binutils/binutils_csl-arm-2008q1.bb
new file mode 100644
index 0000000000..dd9b798306
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils_csl-arm-2008q1.bb
@@ -0,0 +1,25 @@
1require binutils.inc
2
3DEFAULT_PREFERENCE = "-1"
4
5SRC_URI = "\
6 http://www.codesourcery.com/gnu_toolchains/arm/portal/package2553/public/arm-none-eabi/arm-2008q1-126-arm-none-eabi.src.tar.bz2 \
7 file://binutils-2.16.91.0.6-objcopy-rename-errorcode.patch;patch=1 \
8 file://binutils-uclibc-100-uclibc-conf.patch;patch=1 \
9 file://110-arm-eabi-conf.patch;patch=1 \
10 file://binutils-uclibc-300-001_ld_makefile_patch.patch;patch=1 \
11 file://binutils-uclibc-300-006_better_file_error.patch;patch=1 \
12 file://binutils-uclibc-300-012_check_ldrunpath_length.patch;patch=1 \
13 file://docs_hack2.patch;patch=1 \
14 "
15
16PV = "2.18+csl-arm-2008q1-126"
17
18S = "${WORKDIR}/binutils-stable"
19
20do_unpack2() {
21 cd ${WORKDIR}
22 tar -xvjf ./arm-2008q1-126-arm-none-eabi/binutils-2008q1-126.tar.bz2
23}
24
25addtask unpack2 after do_unpack before do_patch
diff --git a/meta/recipes-devtools/binutils/files/better_file_error.patch b/meta/recipes-devtools/binutils/files/better_file_error.patch
new file mode 100644
index 0000000000..38ef52966e
--- /dev/null
+++ b/meta/recipes-devtools/binutils/files/better_file_error.patch
@@ -0,0 +1,17 @@
1diff -urN binutils-2.11.92.0.5/bfd/opncls.c binutils-2.11.92.0.5.new/bfd/opncls.c
2--- binutils-2.11.92.0.5/bfd/opncls.c Mon Oct 1 18:25:21 2001
3+++ binutils-2.11.92.0.5.new/bfd/opncls.c Sat Oct 13 11:26:59 2001
4@@ -127,6 +127,13 @@
5 {
6 bfd *nbfd;
7 const bfd_target *target_vec;
8+ struct stat s;
9+
10+ if (stat (filename, &s) == 0)
11+ if (S_ISDIR(s.st_mode)) {
12+ bfd_set_error (bfd_error_file_not_recognized);
13+ return NULL;
14+ }
15
16 nbfd = _bfd_new_bfd ();
17 if (nbfd == NULL)
diff --git a/meta/recipes-devtools/binutils/files/ld_makefile.patch b/meta/recipes-devtools/binutils/files/ld_makefile.patch
new file mode 100644
index 0000000000..c1d2ac1ece
--- /dev/null
+++ b/meta/recipes-devtools/binutils/files/ld_makefile.patch
@@ -0,0 +1,22 @@
1--- binutils-2.11.90.0.19.orig/ld/Makefile.am
2+++ binutils-2.11.90.0.19/ld/Makefile.am
3@@ -19,7 +19,7 @@
4 # We put the scripts in the directory $(scriptdir)/ldscripts.
5 # We can't put the scripts in $(datadir) because the SEARCH_DIR
6 # directives need to be different for native and cross linkers.
7-scriptdir = $(tooldir)/lib
8+scriptdir = $(libdir)
9
10 EMUL = @EMUL@
11 EMULATION_OFILES = @EMULATION_OFILES@
12--- binutils-2.11.90.0.19.orig/ld/Makefile.in
13+++ binutils-2.11.90.0.19/ld/Makefile.in
14@@ -123,7 +123,7 @@
15 # We put the scripts in the directory $(scriptdir)/ldscripts.
16 # We can't put the scripts in $(datadir) because the SEARCH_DIR
17 # directives need to be different for native and cross linkers.
18-scriptdir = $(tooldir)/lib
19+scriptdir = $(libdir)
20
21 EMUL = @EMUL@
22 EMULATION_OFILES = @EMULATION_OFILES@
diff --git a/meta/recipes-devtools/binutils/files/objdump_fix.patch b/meta/recipes-devtools/binutils/files/objdump_fix.patch
new file mode 100644
index 0000000000..90ad732c06
--- /dev/null
+++ b/meta/recipes-devtools/binutils/files/objdump_fix.patch
@@ -0,0 +1,134 @@
1From binutils-return-38148-listarch-binutils=sources dot redhat dot com at sources dot redhat dot com Tue Feb 22 19:24:15 2005
2Return-Path: <binutils-return-38148-listarch-binutils=sources dot redhat dot com at sources dot redhat dot com>
3Delivered-To: listarch-binutils at sources dot redhat dot com
4Received: (qmail 4446 invoked by alias); 22 Feb 2005 19:24:15 -0000
5Mailing-List: contact binutils-help at sources dot redhat dot com; run by ezmlm
6Precedence: bulk
7List-Subscribe: <mailto:binutils-subscribe at sources dot redhat dot com>
8List-Archive: <http://sources.redhat.com/ml/binutils/>
9List-Post: <mailto:binutils at sources dot redhat dot com>
10List-Help: <mailto:binutils-help at sources dot redhat dot com>, <http://sources dot redhat dot com/ml/#faqs>
11Sender: binutils-owner at sources dot redhat dot com
12Delivered-To: mailing list binutils at sources dot redhat dot com
13Received: (qmail 4401 invoked from network); 22 Feb 2005 19:24:08 -0000
14Received: from unknown (HELO bgo1smout1.broadpark.no) (217.13.4.94)
15 by sourceware dot org with SMTP; 22 Feb 2005 19:24:08 -0000
16Received: from bgo1sminn1.broadpark.no ([217.13.4.93])
17 by bgo1smout1 dot broadpark dot no
18 (Sun Java System Messaging Server 6 dot 1 HotFix 0 dot 05 (built Oct 21 2004))
19 with ESMTP id <0ICB007QZUZCC0C0 at bgo1smout1 dot broadpark dot no> for
20 binutils at sources dot redhat dot com; Tue, 22 Feb 2005 20:18:48 +0100 (CET)
21Received: from [127.0.0.1] ([80.202.165.9]) by bgo1sminn1.broadpark.no
22 (Sun Java System Messaging Server 6 dot 1 HotFix 0 dot 05 (built Oct 21 2004))
23 with ESMTP id <0ICB006NCVBVHE21 at bgo1sminn1 dot broadpark dot no> for
24 binutils at sources dot redhat dot com; Tue, 22 Feb 2005 20:26:20 +0100 (CET)
25Date: Tue, 22 Feb 2005 20:24:08 +0100
26From: =?ISO-8859-1?Q?Stig_Petter_Olsr=F8d?= <stigpo at users dot sourceforge dot net>
27Subject: [PATCH] objdump relocation fixes for ARM disassembly
28To: binutils at sources dot redhat dot com
29Message-id: <421B86D8.8080604@users.sourceforge.net>
30MIME-version: 1.0
31Content-type: text/plain; charset=ISO-8859-1; format=flowed
32Content-transfer-encoding: 7BIT
33User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206)
34
35Hello,
36
37objdump disassembly did not relocate correctly for the ARM processor. It seems
38that the test for triggering the INSN_HAS_RELOC flag was void (one test killed the other,
39since octets would always be zero) and all relocations would thus fail. I changed the test
40so the flag is set when we are about to disassemble an insn that the current relocation
41entry points to. I also changed objdump_print_addr to use the current relocation entry if
42the insn has such an entry. This causes the symbol printed to be correct for both external
43symbols (from the undefined section) and local symbols.
44
45This has only been tested for the ARM processor, but I don't think it should break other
46DISASSEMBLER_NEEDS_RELOCS processors either.
47
48
49binutils/
50
512005-02-22 Stig Petter Olsroed <stigpo@users.sourceforge.net>
52
53 * objdump.c (disassemble_bytes): Fixed relocation check for
54 DISASSEMBLER_NEEDS_RELOCS platforms to properly trigger the
55 INSN_HAS_RELOC flag. Set the current relocation entry in
56 objdump_disasm_info to allow printing the proper symbol.
57 (objdump_print_addr): Use the relocation entry in
58 objdump_disasm_info to lookup the correct symbol for
59 DISASSEMBLER_NEEDS_RELOCS platforms.
60
61--- 1/binutils/objdump.c 2005-02-22 01:50:06.000000000 +0100
62+++ 2/binutils/objdump.c 2005-02-22 14:27:33.066960900 +0100
63@@ -128,6 +128,7 @@
64 arelent ** dynrelbuf;
65 long dynrelcount;
66 disassembler_ftype disassemble_fn;
67+ arelent * reloc;
68 };
69
70 /* Architecture to disassemble for, or default if NULL. */
71@@ -852,6 +853,8 @@
72 {
73 struct objdump_disasm_info *aux;
74 asymbol *sym;
75+ arelent *q;
76+ int skip_find = 0;
77
78 if (sorted_symcount < 1)
79 {
80@@ -861,6 +864,22 @@
81 }
82
83 aux = (struct objdump_disasm_info *) info->application_data;
84+
85+ q = aux->reloc;
86+ if (q != NULL)
87+ {
88+ if (q->sym_ptr_ptr != NULL && *q->sym_ptr_ptr != NULL)
89+ {
90+ /* Adjust the vma to the reloc */
91+ vma += bfd_asymbol_value (*q->sym_ptr_ptr);
92+ if (bfd_is_und_section (bfd_get_section (*q->sym_ptr_ptr)))
93+ {
94+ skip_find = 1;
95+ sym = *q->sym_ptr_ptr;
96+ }
97+ }
98+ }
99+ if (!skip_find)
100 sym = find_symbol_for_address (vma, info, NULL);
101 objdump_print_addr_with_sym (aux->abfd, aux->sec, sym, vma, info,
102 skip_zeroes);
103@@ -1350,16 +1369,22 @@
104 info->bytes_per_chunk = 0;
105
106 #ifdef DISASSEMBLER_NEEDS_RELOCS
107- /* FIXME: This is wrong. It tests the number of octets
108- in the last instruction, not the current one. */
109- if (*relppp < relppend
110- && (**relppp)->address >= rel_offset + addr_offset
111- && ((**relppp)->address
112- < rel_offset + addr_offset + octets / opb))
113+ /* Check if the current relocation entry applies to the
114+ instruction we are about to disassemble.
115+ This works for ARM at least.
116+ */
117+ if ((*relppp) < relppend
118+ && ((**relppp)->address == rel_offset + addr_offset))
119+ {
120 info->flags = INSN_HAS_RELOC;
121+ aux->reloc = **relppp;
122+ }
123 else
124 #endif
125+ {
126 info->flags = 0;
127+ aux->reloc = NULL;
128+ }
129
130 octets = (*disassemble_fn) (section->vma + addr_offset, info);
131 info->fprintf_func = (fprintf_ftype) fprintf;
132
133
134
diff --git a/meta/recipes-devtools/binutils/files/plt32trunc.patch b/meta/recipes-devtools/binutils/files/plt32trunc.patch
new file mode 100644
index 0000000000..4990f5dbb6
--- /dev/null
+++ b/meta/recipes-devtools/binutils/files/plt32trunc.patch
@@ -0,0 +1,24 @@
1--- binutils/bfd/elf32-arm.h.orig 2004-04-22 22:11:15.000000000 -0400
2+++ binutils/bfd/elf32-arm.h 2004-04-22 22:28:37.000000000 -0400
3@@ -2229,6 +2229,8 @@ elf32_arm_relocate_section (output_bfd,
4 case R_ARM_PC24:
5 case R_ARM_ABS32:
6 case R_ARM_THM_PC22:
7+ case R_ARM_PLT32:
8+
9 if (info->shared
10 && (
11 (!info->symbolic && h->dynindx != -1)
12@@ -2262,11 +2264,6 @@ elf32_arm_relocate_section (output_bfd,
13 relocation = 0;
14 break;
15
16- case R_ARM_PLT32:
17- if (h->plt.offset != (bfd_vma)-1)
18- relocation = 0;
19- break;
20-
21 default:
22 if (unresolved_reloc)
23 _bfd_error_handler
24
diff --git a/meta/recipes-devtools/binutils/files/signed_char_fix.patch b/meta/recipes-devtools/binutils/files/signed_char_fix.patch
new file mode 100644
index 0000000000..b3709dabed
--- /dev/null
+++ b/meta/recipes-devtools/binutils/files/signed_char_fix.patch
@@ -0,0 +1,12 @@
1diff -urN binutils-2.11.92.0.12.3/opcodes/i386-dis.c binutils-2.11.92.0.12.3.new/opcodes/i386-dis.c
2--- binutils-2.11.92.0.12.3/opcodes/i386-dis.c Fri Nov 16 17:05:55 2001
3+++ binutils-2.11.92.0.12.3.new/opcodes/i386-dis.c Mon Dec 31 15:55:04 2001
4@@ -1830,7 +1830,7 @@
5 * The function returns the length of this instruction in bytes.
6 */
7
8-static char intel_syntax;
9+static signed char intel_syntax;
10 static char open_char;
11 static char close_char;
12 static char separator_char;