From 784c4679ab3e57e66c48c872a8853bc5f2c0231a Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Fri, 26 Aug 2005 03:57:29 +0000 Subject: [PATCH] patch from upstream to fix an off-by-one error in superh bfd --- .../2.15.94.0.2.2/sh-flags-off-by-one.patch | 21 +++++++++++++++++++ .../2.15.97/sh-flags-off-by-one.patch | 21 +++++++++++++++++++ .../binutils/2.16.1/sh-flags-off-by-one.patch | 21 +++++++++++++++++++ .../2.16.90.0.3/sh-flags-off-by-one.patch | 21 +++++++++++++++++++ .../2.16.91.0.2/sh-flags-off-by-one.patch | 21 +++++++++++++++++++ .../2.16.91.0.3/sh-flags-off-by-one.patch | 21 +++++++++++++++++++ .../binutils/2.16/sh-flags-off-by-one.patch | 21 +++++++++++++++++++ 7 files changed, 147 insertions(+) create mode 100644 toolchain/binutils/2.15.94.0.2.2/sh-flags-off-by-one.patch create mode 100644 toolchain/binutils/2.15.97/sh-flags-off-by-one.patch create mode 100644 toolchain/binutils/2.16.1/sh-flags-off-by-one.patch create mode 100644 toolchain/binutils/2.16.90.0.3/sh-flags-off-by-one.patch create mode 100644 toolchain/binutils/2.16.91.0.2/sh-flags-off-by-one.patch create mode 100644 toolchain/binutils/2.16.91.0.3/sh-flags-off-by-one.patch create mode 100644 toolchain/binutils/2.16/sh-flags-off-by-one.patch diff --git a/toolchain/binutils/2.15.94.0.2.2/sh-flags-off-by-one.patch b/toolchain/binutils/2.15.94.0.2.2/sh-flags-off-by-one.patch new file mode 100644 index 0000000000..19a2f54cab --- /dev/null +++ b/toolchain/binutils/2.15.94.0.2.2/sh-flags-off-by-one.patch @@ -0,0 +1,21 @@ +2005-08-25 Kaz Kojima + + * elf32-sh.c (sh_elf_get_flags_from_mach): Fix off-by-one error. + +Index: bfd/elf32-sh.c +=================================================================== +RCS file: /cvs/src/src/bfd/elf32-sh.c,v +retrieving revision 1.128 +retrieving revision 1.129 +diff -u -p -r1.128 -r1.129 +--- binutils/bfd/elf32-sh.c 25 Aug 2005 02:32:10 -0000 1.128 ++++ binutils/bfd/elf32-sh.c 25 Aug 2005 05:10:22 -0000 1.129 +@@ -6655,7 +6655,7 @@ sh_elf_set_mach_from_flags (bfd *abfd) + int + sh_elf_get_flags_from_mach (unsigned long mach) + { +- int i = ARRAY_SIZE (sh_ef_bfd_table); ++ int i = ARRAY_SIZE (sh_ef_bfd_table) - 1; + + for (; i>0; i--) + if (sh_ef_bfd_table[i] == mach) diff --git a/toolchain/binutils/2.15.97/sh-flags-off-by-one.patch b/toolchain/binutils/2.15.97/sh-flags-off-by-one.patch new file mode 100644 index 0000000000..19a2f54cab --- /dev/null +++ b/toolchain/binutils/2.15.97/sh-flags-off-by-one.patch @@ -0,0 +1,21 @@ +2005-08-25 Kaz Kojima + + * elf32-sh.c (sh_elf_get_flags_from_mach): Fix off-by-one error. + +Index: bfd/elf32-sh.c +=================================================================== +RCS file: /cvs/src/src/bfd/elf32-sh.c,v +retrieving revision 1.128 +retrieving revision 1.129 +diff -u -p -r1.128 -r1.129 +--- binutils/bfd/elf32-sh.c 25 Aug 2005 02:32:10 -0000 1.128 ++++ binutils/bfd/elf32-sh.c 25 Aug 2005 05:10:22 -0000 1.129 +@@ -6655,7 +6655,7 @@ sh_elf_set_mach_from_flags (bfd *abfd) + int + sh_elf_get_flags_from_mach (unsigned long mach) + { +- int i = ARRAY_SIZE (sh_ef_bfd_table); ++ int i = ARRAY_SIZE (sh_ef_bfd_table) - 1; + + for (; i>0; i--) + if (sh_ef_bfd_table[i] == mach) diff --git a/toolchain/binutils/2.16.1/sh-flags-off-by-one.patch b/toolchain/binutils/2.16.1/sh-flags-off-by-one.patch new file mode 100644 index 0000000000..19a2f54cab --- /dev/null +++ b/toolchain/binutils/2.16.1/sh-flags-off-by-one.patch @@ -0,0 +1,21 @@ +2005-08-25 Kaz Kojima + + * elf32-sh.c (sh_elf_get_flags_from_mach): Fix off-by-one error. + +Index: bfd/elf32-sh.c +=================================================================== +RCS file: /cvs/src/src/bfd/elf32-sh.c,v +retrieving revision 1.128 +retrieving revision 1.129 +diff -u -p -r1.128 -r1.129 +--- binutils/bfd/elf32-sh.c 25 Aug 2005 02:32:10 -0000 1.128 ++++ binutils/bfd/elf32-sh.c 25 Aug 2005 05:10:22 -0000 1.129 +@@ -6655,7 +6655,7 @@ sh_elf_set_mach_from_flags (bfd *abfd) + int + sh_elf_get_flags_from_mach (unsigned long mach) + { +- int i = ARRAY_SIZE (sh_ef_bfd_table); ++ int i = ARRAY_SIZE (sh_ef_bfd_table) - 1; + + for (; i>0; i--) + if (sh_ef_bfd_table[i] == mach) diff --git a/toolchain/binutils/2.16.90.0.3/sh-flags-off-by-one.patch b/toolchain/binutils/2.16.90.0.3/sh-flags-off-by-one.patch new file mode 100644 index 0000000000..19a2f54cab --- /dev/null +++ b/toolchain/binutils/2.16.90.0.3/sh-flags-off-by-one.patch @@ -0,0 +1,21 @@ +2005-08-25 Kaz Kojima + + * elf32-sh.c (sh_elf_get_flags_from_mach): Fix off-by-one error. + +Index: bfd/elf32-sh.c +=================================================================== +RCS file: /cvs/src/src/bfd/elf32-sh.c,v +retrieving revision 1.128 +retrieving revision 1.129 +diff -u -p -r1.128 -r1.129 +--- binutils/bfd/elf32-sh.c 25 Aug 2005 02:32:10 -0000 1.128 ++++ binutils/bfd/elf32-sh.c 25 Aug 2005 05:10:22 -0000 1.129 +@@ -6655,7 +6655,7 @@ sh_elf_set_mach_from_flags (bfd *abfd) + int + sh_elf_get_flags_from_mach (unsigned long mach) + { +- int i = ARRAY_SIZE (sh_ef_bfd_table); ++ int i = ARRAY_SIZE (sh_ef_bfd_table) - 1; + + for (; i>0; i--) + if (sh_ef_bfd_table[i] == mach) diff --git a/toolchain/binutils/2.16.91.0.2/sh-flags-off-by-one.patch b/toolchain/binutils/2.16.91.0.2/sh-flags-off-by-one.patch new file mode 100644 index 0000000000..19a2f54cab --- /dev/null +++ b/toolchain/binutils/2.16.91.0.2/sh-flags-off-by-one.patch @@ -0,0 +1,21 @@ +2005-08-25 Kaz Kojima + + * elf32-sh.c (sh_elf_get_flags_from_mach): Fix off-by-one error. + +Index: bfd/elf32-sh.c +=================================================================== +RCS file: /cvs/src/src/bfd/elf32-sh.c,v +retrieving revision 1.128 +retrieving revision 1.129 +diff -u -p -r1.128 -r1.129 +--- binutils/bfd/elf32-sh.c 25 Aug 2005 02:32:10 -0000 1.128 ++++ binutils/bfd/elf32-sh.c 25 Aug 2005 05:10:22 -0000 1.129 +@@ -6655,7 +6655,7 @@ sh_elf_set_mach_from_flags (bfd *abfd) + int + sh_elf_get_flags_from_mach (unsigned long mach) + { +- int i = ARRAY_SIZE (sh_ef_bfd_table); ++ int i = ARRAY_SIZE (sh_ef_bfd_table) - 1; + + for (; i>0; i--) + if (sh_ef_bfd_table[i] == mach) diff --git a/toolchain/binutils/2.16.91.0.3/sh-flags-off-by-one.patch b/toolchain/binutils/2.16.91.0.3/sh-flags-off-by-one.patch new file mode 100644 index 0000000000..19a2f54cab --- /dev/null +++ b/toolchain/binutils/2.16.91.0.3/sh-flags-off-by-one.patch @@ -0,0 +1,21 @@ +2005-08-25 Kaz Kojima + + * elf32-sh.c (sh_elf_get_flags_from_mach): Fix off-by-one error. + +Index: bfd/elf32-sh.c +=================================================================== +RCS file: /cvs/src/src/bfd/elf32-sh.c,v +retrieving revision 1.128 +retrieving revision 1.129 +diff -u -p -r1.128 -r1.129 +--- binutils/bfd/elf32-sh.c 25 Aug 2005 02:32:10 -0000 1.128 ++++ binutils/bfd/elf32-sh.c 25 Aug 2005 05:10:22 -0000 1.129 +@@ -6655,7 +6655,7 @@ sh_elf_set_mach_from_flags (bfd *abfd) + int + sh_elf_get_flags_from_mach (unsigned long mach) + { +- int i = ARRAY_SIZE (sh_ef_bfd_table); ++ int i = ARRAY_SIZE (sh_ef_bfd_table) - 1; + + for (; i>0; i--) + if (sh_ef_bfd_table[i] == mach) diff --git a/toolchain/binutils/2.16/sh-flags-off-by-one.patch b/toolchain/binutils/2.16/sh-flags-off-by-one.patch new file mode 100644 index 0000000000..19a2f54cab --- /dev/null +++ b/toolchain/binutils/2.16/sh-flags-off-by-one.patch @@ -0,0 +1,21 @@ +2005-08-25 Kaz Kojima + + * elf32-sh.c (sh_elf_get_flags_from_mach): Fix off-by-one error. + +Index: bfd/elf32-sh.c +=================================================================== +RCS file: /cvs/src/src/bfd/elf32-sh.c,v +retrieving revision 1.128 +retrieving revision 1.129 +diff -u -p -r1.128 -r1.129 +--- binutils/bfd/elf32-sh.c 25 Aug 2005 02:32:10 -0000 1.128 ++++ binutils/bfd/elf32-sh.c 25 Aug 2005 05:10:22 -0000 1.129 +@@ -6655,7 +6655,7 @@ sh_elf_set_mach_from_flags (bfd *abfd) + int + sh_elf_get_flags_from_mach (unsigned long mach) + { +- int i = ARRAY_SIZE (sh_ef_bfd_table); ++ int i = ARRAY_SIZE (sh_ef_bfd_table) - 1; + + for (; i>0; i--) + if (sh_ef_bfd_table[i] == mach) -- 2.30.2