mirror of
git://projects.qi-hardware.com/openwrt-xburst.git
synced 2024-11-23 20:55:19 +02:00
[toolchain]: remove support for binutils 2.18 and 2.20
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@23685 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
f1ffd86550
commit
a1fde30bf3
@ -6,17 +6,9 @@ choice
|
||||
help
|
||||
Select the version of binutils you wish to use.
|
||||
|
||||
config BINUTILS_VERSION_2_18
|
||||
depends !ubicom32
|
||||
bool "binutils 2.18"
|
||||
|
||||
config BINUTILS_VERSION_2_19_1
|
||||
bool "binutils 2.19.1"
|
||||
|
||||
config BINUTILS_VERSION_2_20
|
||||
depends !avr32
|
||||
depends !ubicom32
|
||||
bool "binutils 2.20"
|
||||
config BINUTILS_VERSION_2_20_1
|
||||
depends !avr32
|
||||
depends !ubicom32
|
||||
@ -40,9 +32,7 @@ config EXTRA_BINUTILS_CONFIG_OPTIONS
|
||||
config BINUTILS_VERSION
|
||||
string
|
||||
prompt "Binutils Version" if (TOOLCHAINOPTS && NULL)
|
||||
default "2.18" if BINUTILS_VERSION_2_18
|
||||
default "2.19.1" if BINUTILS_VERSION_2_19_1
|
||||
default "2.20" if BINUTILS_VERSION_2_20
|
||||
default "2.20.1" if BINUTILS_VERSION_2_20_1
|
||||
default "2.19.1+cs" if BINUTILS_VERSION_CS
|
||||
default "2.19.1"
|
||||
|
@ -13,9 +13,6 @@ BIN_VERSION:=$(PKG_VERSION)
|
||||
PKG_SOURCE_URL:=@GNU/binutils/
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
|
||||
|
||||
ifeq ($(PKG_VERSION),2.18)
|
||||
PKG_MD5SUM:=9d22ee4dafa3a194457caf4706f9cf01
|
||||
endif
|
||||
ifeq ($(PKG_VERSION),2.19.1)
|
||||
PKG_MD5SUM:=09a8c5821a2dfdbb20665bc0bd680791
|
||||
endif
|
||||
@ -26,9 +23,6 @@ ifeq ($(PKG_VERSION),2.19.1+cs)
|
||||
PKG_MD5SUM:=040740e8c864dd1a15886753f9c0bc0b
|
||||
HOST_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/binutils-$(BIN_VERSION)
|
||||
endif
|
||||
ifeq ($(PKG_VERSION),2.20)
|
||||
PKG_MD5SUM:=ee2d3e996e9a2d669808713360fa96f8
|
||||
endif
|
||||
ifeq ($(PKG_VERSION),2.20.1)
|
||||
PKG_MD5SUM:=9cdfb9d6ec0578c166d3beae5e15c4e5
|
||||
endif
|
||||
|
@ -1,22 +0,0 @@
|
||||
Index: binutils-2.18/configure
|
||||
===================================================================
|
||||
--- binutils-2.18.orig/configure 2007-06-28 09:19:34.903930248 +0200
|
||||
+++ binutils-2.18/configure 2007-06-28 09:19:35.030910944 +0200
|
||||
@@ -2206,7 +2206,7 @@
|
||||
am33_2.0-*-linux*)
|
||||
noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
|
||||
;;
|
||||
- sh-*-linux*)
|
||||
+ sh*-*-linux*)
|
||||
noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
|
||||
;;
|
||||
sh*-*-pe|mips*-*-pe|*arm-wince-pe)
|
||||
@@ -2504,7 +2504,7 @@
|
||||
romp-*-*)
|
||||
noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes target-libgloss ${libgcj}"
|
||||
;;
|
||||
- sh-*-* | sh64-*-*)
|
||||
+ sh*-*-* | sh64-*-*)
|
||||
case "${host}" in
|
||||
i[3456789]86-*-vsta) ;; # don't add gprof back in
|
||||
i[3456789]86-*-go32*) ;; # don't add gprof back in
|
@ -1,13 +0,0 @@
|
||||
Index: binutils-2.18/configure
|
||||
===================================================================
|
||||
--- binutils-2.18.orig/configure 2007-06-28 09:19:35.030910944 +0200
|
||||
+++ binutils-2.18/configure 2007-06-28 09:19:35.592825520 +0200
|
||||
@@ -2235,7 +2235,7 @@
|
||||
arm-*-elf* | strongarm-*-elf* | xscale-*-elf* | arm*-*-eabi* )
|
||||
noconfigdirs="$noconfigdirs target-libffi target-qthreads"
|
||||
;;
|
||||
- arm*-*-linux-gnueabi)
|
||||
+ arm*-*-linux-gnueabi | arm*-*-linux-uclibcgnueabi)
|
||||
noconfigdirs="$noconfigdirs target-libffi target-qthreads"
|
||||
noconfigdirs="$noconfigdirs target-libjava target-libobjc"
|
||||
case ${with_newlib} in
|
@ -1,38 +0,0 @@
|
||||
Source: Khem Raj <raj.khem@gmail.com>
|
||||
Disposition: submit upstream.
|
||||
|
||||
Description:
|
||||
|
||||
We do not need to have the libtool patch anymore for binutils after
|
||||
libtool has been updated upstream it include support for it. However
|
||||
for building gas natively on uclibc systems we have to link it with
|
||||
-lm so that it picks up missing symbols.
|
||||
|
||||
/local/build_area/BUILD/arm_v5t_le_uclibc/binutils-2.17.50/objdir/libiberty/pic/libiberty.a(floatformat.o): In function `floatformat_from_double':
|
||||
floatformat.c:(.text+0x1ec): undefined reference to `frexp'
|
||||
floatformat.c:(.text+0x2f8): undefined reference to `ldexp'
|
||||
/local/build_area/BUILD/arm_v5t_le_uclibc/binutils-2.17.50/objdir/libiberty/pic/libiberty.a(floatformat.o): In function `floatformat_to_double':
|
||||
floatformat.c:(.text+0x38a): undefined reference to `ldexp'
|
||||
floatformat.c:(.text+0x3d2): undefined reference to `ldexp'
|
||||
floatformat.c:(.text+0x43e): undefined reference to `ldexp' floatformat.c:(.text+0x4e2): undefined reference to `ldexp'
|
||||
collect2: ld returned 1 exit status
|
||||
make[4]: *** [as-new] Error 1
|
||||
|
||||
Index: binutils-2.17.50/gas/configure.tgt
|
||||
===================================================================
|
||||
--- binutils-2.17.50.orig/gas/configure.tgt
|
||||
+++ binutils-2.17.50/gas/configure.tgt
|
||||
@@ -411,6 +411,12 @@ case ${generic_target} in
|
||||
*-*-netware) fmt=elf em=netware ;;
|
||||
esac
|
||||
|
||||
+case ${generic_target} in
|
||||
+ arm-*-*uclibc*)
|
||||
+ need_libm=yes
|
||||
+ ;;
|
||||
+esac
|
||||
+
|
||||
case ${cpu_type} in
|
||||
alpha | arm | i386 | ia64 | mips | ns32k | pdp11 | ppc | sparc | z80 | z8k)
|
||||
bfd_gas=yes
|
||||
|
@ -1,54 +0,0 @@
|
||||
#!/bin/sh -e
|
||||
## 001_ld_makefile_patch.dpatch
|
||||
##
|
||||
## All lines beginning with `## DP:' are a description of the patch.
|
||||
## DP: Description: correct where ld scripts are installed
|
||||
## DP: Author: Chris Chimelis <chris@debian.org>
|
||||
## DP: Upstream status: N/A
|
||||
## DP: Date: ??
|
||||
|
||||
if [ $# -ne 1 ]; then
|
||||
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
|
||||
patch_opts="${patch_opts:--f --no-backup-if-mismatch}"
|
||||
|
||||
case "$1" in
|
||||
-patch) patch $patch_opts -p1 < $0;;
|
||||
-unpatch) patch $patch_opts -p1 -R < $0;;
|
||||
*)
|
||||
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
|
||||
exit 1;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
||||
@DPATCH@
|
||||
Index: binutils-2.18/ld/Makefile.am
|
||||
===================================================================
|
||||
--- binutils-2.18.orig/ld/Makefile.am 2007-06-28 09:19:34.837940280 +0200
|
||||
+++ binutils-2.18/ld/Makefile.am 2007-06-28 09:19:35.795794664 +0200
|
||||
@@ -18,7 +18,7 @@
|
||||
# We put the scripts in the directory $(scriptdir)/ldscripts.
|
||||
# We can't put the scripts in $(datadir) because the SEARCH_DIR
|
||||
# directives need to be different for native and cross linkers.
|
||||
-scriptdir = $(tooldir)/lib
|
||||
+scriptdir = $(libdir)
|
||||
|
||||
EMUL = @EMUL@
|
||||
EMULATION_OFILES = @EMULATION_OFILES@
|
||||
Index: binutils-2.18/ld/Makefile.in
|
||||
===================================================================
|
||||
--- binutils-2.18.orig/ld/Makefile.in 2007-06-28 09:19:34.844939216 +0200
|
||||
+++ binutils-2.18/ld/Makefile.in 2007-06-28 09:19:35.796794512 +0200
|
||||
@@ -287,7 +287,7 @@
|
||||
# We put the scripts in the directory $(scriptdir)/ldscripts.
|
||||
# We can't put the scripts in $(datadir) because the SEARCH_DIR
|
||||
# directives need to be different for native and cross linkers.
|
||||
-scriptdir = $(tooldir)/lib
|
||||
+scriptdir = $(libdir)
|
||||
BASEDIR = $(srcdir)/..
|
||||
BFDDIR = $(BASEDIR)/bfd
|
||||
INCDIR = $(BASEDIR)/include
|
@ -1,44 +0,0 @@
|
||||
#!/bin/sh -e
|
||||
## 006_better_file_error.dpatch by David Kimdon <dwhedon@gordian.com>
|
||||
##
|
||||
## All lines beginning with `## DP:' are a description of the patch.
|
||||
## DP: Specify which filename is causing an error if the filename is a
|
||||
## DP: directory. (#45832)
|
||||
|
||||
if [ $# -ne 1 ]; then
|
||||
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
|
||||
patch_opts="${patch_opts:--f --no-backup-if-mismatch}"
|
||||
|
||||
case "$1" in
|
||||
-patch) patch $patch_opts -p1 < $0;;
|
||||
-unpatch) patch $patch_opts -p1 -R < $0;;
|
||||
*)
|
||||
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
|
||||
exit 1;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
||||
@DPATCH@
|
||||
Index: binutils-2.18/bfd/opncls.c
|
||||
===================================================================
|
||||
--- binutils-2.18.orig/bfd/opncls.c 2007-06-28 09:19:34.818943168 +0200
|
||||
+++ binutils-2.18/bfd/opncls.c 2007-06-28 09:19:35.993764568 +0200
|
||||
@@ -183,6 +183,13 @@
|
||||
{
|
||||
bfd *nbfd;
|
||||
const bfd_target *target_vec;
|
||||
+ struct stat s;
|
||||
+
|
||||
+ if (stat (filename, &s) == 0)
|
||||
+ if (S_ISDIR(s.st_mode)) {
|
||||
+ bfd_set_error (bfd_error_file_not_recognized);
|
||||
+ return NULL;
|
||||
+ }
|
||||
|
||||
nbfd = _bfd_new_bfd ();
|
||||
if (nbfd == NULL)
|
@ -1,48 +0,0 @@
|
||||
#!/bin/sh -e
|
||||
## 012_check_ldrunpath_length.dpatch by Chris Chimelis <chris@debian.org>
|
||||
##
|
||||
## All lines beginning with `## DP:' are a description of the patch.
|
||||
## DP: Only generate an RPATH entry if LD_RUN_PATH is not empty, for
|
||||
## DP: cases where -rpath isn't specified. (#151024)
|
||||
|
||||
if [ $# -ne 1 ]; then
|
||||
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
|
||||
patch_opts="${patch_opts:--f --no-backup-if-mismatch}"
|
||||
|
||||
case "$1" in
|
||||
-patch) patch $patch_opts -p1 < $0;;
|
||||
-unpatch) patch $patch_opts -p1 -R < $0;;
|
||||
*)
|
||||
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
|
||||
exit 1;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
||||
@DPATCH@
|
||||
Index: binutils-2.18/ld/emultempl/elf32.em
|
||||
===================================================================
|
||||
--- binutils-2.18.orig/ld/emultempl/elf32.em 2007-06-28 09:19:34.796946512 +0200
|
||||
+++ binutils-2.18/ld/emultempl/elf32.em 2007-06-28 09:19:36.178736448 +0200
|
||||
@@ -1216,6 +1216,8 @@
|
||||
&& command_line.rpath == NULL)
|
||||
{
|
||||
lib_path = (const char *) getenv ("LD_RUN_PATH");
|
||||
+ if ((lib_path) && (strlen (lib_path) == 0))
|
||||
+ lib_path = NULL;
|
||||
if (gld${EMULATION_NAME}_search_needed (lib_path, &n,
|
||||
force))
|
||||
break;
|
||||
@@ -1400,6 +1402,8 @@
|
||||
rpath = command_line.rpath;
|
||||
if (rpath == NULL)
|
||||
rpath = (const char *) getenv ("LD_RUN_PATH");
|
||||
+ if ((rpath) && (strlen (rpath) == 0))
|
||||
+ rpath = NULL;
|
||||
if (! (bfd_elf_size_dynamic_sections
|
||||
(output_bfd, command_line.soname, rpath,
|
||||
command_line.filter_shlib,
|
File diff suppressed because it is too large
Load Diff
@ -1,23 +0,0 @@
|
||||
Index: binutils-2.18/bfd/elf32-cris.c
|
||||
===================================================================
|
||||
--- binutils-2.18.orig/bfd/elf32-cris.c 2007-06-28 09:19:34.053059600 +0200
|
||||
+++ binutils-2.18/bfd/elf32-cris.c 2007-06-28 09:19:39.058298688 +0200
|
||||
@@ -2694,12 +2694,12 @@
|
||||
&& (sec->flags & SEC_READONLY) != 0)
|
||||
{
|
||||
/* FIXME: How do we make this optionally a warning only? */
|
||||
- (*_bfd_error_handler)
|
||||
- (_("%B, section %A:\n relocation %s should not"
|
||||
- " be used in a shared object; recompile with -fPIC"),
|
||||
- abfd,
|
||||
- sec,
|
||||
- cris_elf_howto_table[r_type].name);
|
||||
+ // (*_bfd_error_handler)
|
||||
+ //(_("%B, section %A:\n relocation %s should not"
|
||||
+ // " be used in a shared object; recompile with -fPIC"),
|
||||
+// abfd,
|
||||
+// sec,
|
||||
+// cris_elf_howto_table[r_type].name);
|
||||
}
|
||||
/* Fall through. */
|
||||
|
@ -1,20 +0,0 @@
|
||||
--- a/bfd/elf.c 2009-07-14 14:30:19.000000000 +0200
|
||||
+++ b/bfd/elf.c 2009-07-14 21:11:42.000000000 +0200
|
||||
@@ -5362,12 +5449,16 @@
|
||||
*pointer_to_map = map;
|
||||
pointer_to_map = &map->next;
|
||||
|
||||
+#if 0
|
||||
+ /* FIXME: It is wrong when section flags are changed. See
|
||||
+ PR binutils/5233. */
|
||||
if (matching_lma != map->p_paddr
|
||||
&& !map->includes_filehdr && !map->includes_phdrs)
|
||||
/* There is some padding before the first section in the
|
||||
segment. So, we must account for that in the output
|
||||
segment's vma. */
|
||||
map->p_vaddr_offset = matching_lma - map->p_paddr;
|
||||
+#endif
|
||||
|
||||
free (sections);
|
||||
continue;
|
||||
|
@ -1,22 +0,0 @@
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -3086,7 +3086,7 @@ case "${target}" in
|
||||
noconfigdirs="$noconfigdirs target-libffi target-qthreads"
|
||||
libgloss_dir=arm
|
||||
;;
|
||||
- arm*-*-linux-gnueabi)
|
||||
+ arm*-*-linux-*gnueabi)
|
||||
noconfigdirs="$noconfigdirs target-qthreads"
|
||||
case ${with_newlib} in
|
||||
no) noconfigdirs="$noconfigdirs target-newlib target-libgloss"
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -573,7 +573,7 @@ case "${target}" in
|
||||
noconfigdirs="$noconfigdirs target-libffi target-qthreads"
|
||||
libgloss_dir=arm
|
||||
;;
|
||||
- arm*-*-linux-gnueabi)
|
||||
+ arm*-*-linux-*gnueabi)
|
||||
noconfigdirs="$noconfigdirs target-qthreads"
|
||||
case ${with_newlib} in
|
||||
no) noconfigdirs="$noconfigdirs target-newlib target-libgloss"
|
@ -1,13 +0,0 @@
|
||||
--- a/bfd/elf32-arm.c
|
||||
+++ b/bfd/elf32-arm.c
|
||||
@@ -5511,6 +5511,10 @@ bfd_elf32_arm_init_maps (bfd *abfd)
|
||||
if (! is_arm_elf (abfd))
|
||||
return;
|
||||
|
||||
+ /* PR 7093: Make sure that we are dealing with an arm elf binary. */
|
||||
+ if (! is_arm_elf (abfd))
|
||||
+ return;
|
||||
+
|
||||
if ((abfd->flags & DYNAMIC) != 0)
|
||||
return;
|
||||
|
@ -1,38 +0,0 @@
|
||||
Source: Khem Raj <raj.khem@gmail.com>
|
||||
Disposition: submit upstream.
|
||||
|
||||
Description:
|
||||
|
||||
We do not need to have the libtool patch anymore for binutils after
|
||||
libtool has been updated upstream it include support for it. However
|
||||
for building gas natively on uclibc systems we have to link it with
|
||||
-lm so that it picks up missing symbols.
|
||||
|
||||
/local/build_area/BUILD/arm_v5t_le_uclibc/binutils-2.17.50/objdir/libiberty/pic/libiberty.a(floatformat.o): In function `floatformat_from_double':
|
||||
floatformat.c:(.text+0x1ec): undefined reference to `frexp'
|
||||
floatformat.c:(.text+0x2f8): undefined reference to `ldexp'
|
||||
/local/build_area/BUILD/arm_v5t_le_uclibc/binutils-2.17.50/objdir/libiberty/pic/libiberty.a(floatformat.o): In function `floatformat_to_double':
|
||||
floatformat.c:(.text+0x38a): undefined reference to `ldexp'
|
||||
floatformat.c:(.text+0x3d2): undefined reference to `ldexp'
|
||||
floatformat.c:(.text+0x43e): undefined reference to `ldexp' floatformat.c:(.text+0x4e2): undefined reference to `ldexp'
|
||||
collect2: ld returned 1 exit status
|
||||
make[4]: *** [as-new] Error 1
|
||||
|
||||
Index: binutils-2.17.50/gas/configure.tgt
|
||||
===================================================================
|
||||
--- binutils-2.17.50.orig/gas/configure.tgt
|
||||
+++ binutils-2.17.50/gas/configure.tgt
|
||||
@@ -431,6 +431,12 @@ case ${generic_target} in
|
||||
*-*-netware) fmt=elf em=netware ;;
|
||||
esac
|
||||
|
||||
+case ${generic_target} in
|
||||
+ arm-*-*uclibc*)
|
||||
+ need_libm=yes
|
||||
+ ;;
|
||||
+esac
|
||||
+
|
||||
case ${cpu_type} in
|
||||
alpha | arm | i386 | ia64 | microblaze | mips | ns32k | pdp11 | ppc | sparc | z80 | z8k)
|
||||
bfd_gas=yes
|
||||
|
@ -1,40 +0,0 @@
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -3054,7 +3054,7 @@ case "${target}" in
|
||||
am33_2.0-*-linux*)
|
||||
noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
|
||||
;;
|
||||
- sh-*-linux*)
|
||||
+ sh*-*-linux*)
|
||||
noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
|
||||
;;
|
||||
sh*-*-pe|mips*-*-pe|*arm-wince-pe)
|
||||
@@ -3390,7 +3390,7 @@ case "${target}" in
|
||||
romp-*-*)
|
||||
noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes target-libgloss ${libgcj}"
|
||||
;;
|
||||
- sh-*-* | sh64-*-*)
|
||||
+ sh*-*-* | sh64-*-*)
|
||||
case "${host}" in
|
||||
i[3456789]86-*-vsta) ;; # don't add gprof back in
|
||||
i[3456789]86-*-go32*) ;; # don't add gprof back in
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -541,7 +541,7 @@ case "${target}" in
|
||||
am33_2.0-*-linux*)
|
||||
noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
|
||||
;;
|
||||
- sh-*-linux*)
|
||||
+ sh*-*-linux*)
|
||||
noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
|
||||
;;
|
||||
sh*-*-pe|mips*-*-pe|*arm-wince-pe)
|
||||
@@ -877,7 +877,7 @@ case "${target}" in
|
||||
romp-*-*)
|
||||
noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes target-libgloss ${libgcj}"
|
||||
;;
|
||||
- sh-*-* | sh64-*-*)
|
||||
+ sh*-*-* | sh64-*-*)
|
||||
case "${host}" in
|
||||
i[[3456789]]86-*-vsta) ;; # don't add gprof back in
|
||||
i[[3456789]]86-*-go32*) ;; # don't add gprof back in
|
@ -1,209 +0,0 @@
|
||||
--- a/bfd/elf32-mips.c
|
||||
+++ b/bfd/elf32-mips.c
|
||||
@@ -1663,6 +1663,15 @@ static const struct ecoff_debug_swap mip
|
||||
#define elf_backend_plt_readonly 1
|
||||
#define elf_backend_plt_sym_val _bfd_mips_elf_plt_sym_val
|
||||
|
||||
+/* Most MIPS ELF files do not contain a traditional PLT; only VxWorks
|
||||
+ and non-PIC dynamic executables do. These settings only affect
|
||||
+ _bfd_elf_create_dynamic_sections, which is only called when we
|
||||
+ do want a traditional PLT. */
|
||||
+#undef elf_backend_want_plt_sym
|
||||
+#define elf_backend_want_plt_sym 1
|
||||
+#undef elf_backend_plt_readonly
|
||||
+#define elf_backend_plt_readonly 1
|
||||
+
|
||||
#define elf_backend_discard_info _bfd_mips_elf_discard_info
|
||||
#define elf_backend_ignore_discarded_relocs \
|
||||
_bfd_mips_elf_ignore_discarded_relocs
|
||||
@@ -1687,6 +1696,8 @@ static const struct ecoff_debug_swap mip
|
||||
#define bfd_elf32_bfd_print_private_bfd_data \
|
||||
_bfd_mips_elf_print_private_bfd_data
|
||||
|
||||
+#define elf_backend_plt_sym_val _bfd_mips_elf_plt_sym_val
|
||||
+
|
||||
/* Support for SGI-ish mips targets. */
|
||||
#define TARGET_LITTLE_SYM bfd_elf32_littlemips_vec
|
||||
#define TARGET_LITTLE_NAME "elf32-littlemips"
|
||||
@@ -1790,6 +1801,7 @@ mips_vxworks_final_write_processing (bfd
|
||||
#undef elf_backend_additional_program_headers
|
||||
#undef elf_backend_modify_segment_map
|
||||
#undef elf_backend_symbol_processing
|
||||
+#undef elf_backend_plt_sym_val
|
||||
/* NOTE: elf_backend_rela_normal is not defined for MIPS. */
|
||||
|
||||
#include "elf32-target.h"
|
||||
--- a/bfd/elfxx-mips.c
|
||||
+++ b/bfd/elfxx-mips.c
|
||||
@@ -694,6 +694,11 @@ static bfd *reldyn_sorting_bfd;
|
||||
/* Nonzero if ABFD is using NewABI conventions. */
|
||||
#define NEWABI_P(abfd) (ABI_N32_P (abfd) || ABI_64_P (abfd))
|
||||
|
||||
+/* Nonzero if ABFD is a non-PIC object. */
|
||||
+#define NON_PIC_P(abfd) \
|
||||
+ (((elf_elfheader (abfd)->e_flags & EF_MIPS_PIC) == 0) \
|
||||
+ && ((elf_elfheader (abfd)->e_flags & EF_MIPS_CPIC) == EF_MIPS_CPIC))
|
||||
+
|
||||
/* The IRIX compatibility level we are striving for. */
|
||||
#define IRIX_COMPAT(abfd) \
|
||||
(get_elf_backend_data (abfd)->elf_backend_mips_irix_compat (abfd))
|
||||
@@ -706,6 +711,9 @@ static bfd *reldyn_sorting_bfd;
|
||||
#define MIPS_ELF_OPTIONS_SECTION_NAME(abfd) \
|
||||
(NEWABI_P (abfd) ? ".MIPS.options" : ".options")
|
||||
|
||||
+/* The name of the section holding non-PIC to PIC call stubs. */
|
||||
+#define NON_PIC_TO_PIC_STUB_SECTION_NAME ".MIPS.pic_stubs"
|
||||
+
|
||||
/* True if NAME is the recognized name of any SHT_MIPS_OPTIONS section.
|
||||
Some IRIX system files do not use MIPS_ELF_OPTIONS_SECTION_NAME. */
|
||||
#define MIPS_ELF_OPTIONS_SECTION_NAME_P(NAME) \
|
||||
@@ -7619,7 +7627,9 @@ _bfd_mips_elf_check_relocs (bfd *abfd, s
|
||||
|
||||
/* We need a stub, not a plt entry for the undefined
|
||||
function. But we record it as if it needs plt. See
|
||||
- _bfd_elf_adjust_dynamic_symbol. */
|
||||
+ _bfd_elf_adjust_dynamic_symbol. Note that these relocations
|
||||
+ are always used for PIC calls, even when using the new
|
||||
+ non-PIC ABI. */
|
||||
h->needs_plt = 1;
|
||||
h->type = STT_FUNC;
|
||||
}
|
||||
@@ -7725,6 +7735,8 @@ _bfd_mips_elf_check_relocs (bfd *abfd, s
|
||||
case R_MIPS_32:
|
||||
case R_MIPS_REL32:
|
||||
case R_MIPS_64:
|
||||
+ if (h != NULL)
|
||||
+ h->non_got_ref = TRUE;
|
||||
/* In VxWorks executables, references to external symbols
|
||||
are handled using copy relocs or PLT stubs, so there's
|
||||
no need to add a .rela.dyn entry for this relocation. */
|
||||
@@ -7780,11 +7792,21 @@ _bfd_mips_elf_check_relocs (bfd *abfd, s
|
||||
case R_MIPS_GPREL16:
|
||||
case R_MIPS_LITERAL:
|
||||
case R_MIPS_GPREL32:
|
||||
+ if (h != NULL
|
||||
+ && (r_type == R_MIPS_GPREL16 || r_type == R_MIPS_GPREL32))
|
||||
+ h->non_got_ref = TRUE;
|
||||
+
|
||||
if (SGI_COMPAT (abfd))
|
||||
mips_elf_hash_table (info)->compact_rel_size +=
|
||||
sizeof (Elf32_External_crinfo);
|
||||
break;
|
||||
|
||||
+ case R_MIPS_HI16:
|
||||
+ case R_MIPS_LO16:
|
||||
+ if (h != NULL && strcmp (h->root.root.string, "_gp_disp") != 0)
|
||||
+ h->non_got_ref = TRUE;
|
||||
+ break;
|
||||
+
|
||||
/* This relocation describes the C++ object vtable hierarchy.
|
||||
Reconstruct it for later use during GC. */
|
||||
case R_MIPS_GNU_VTINHERIT:
|
||||
@@ -7807,20 +7829,20 @@ _bfd_mips_elf_check_relocs (bfd *abfd, s
|
||||
|
||||
/* We must not create a stub for a symbol that has relocations
|
||||
related to taking the function's address. This doesn't apply to
|
||||
- VxWorks, where CALL relocs refer to a .got.plt entry instead of
|
||||
- a normal .got entry. */
|
||||
+ VxWorks or the non-PIC ABI, where CALL relocs refer to a
|
||||
+ .got.plt entry instead of a normal .got entry. */
|
||||
if (!htab->is_vxworks && h != NULL)
|
||||
switch (r_type)
|
||||
{
|
||||
- default:
|
||||
- ((struct mips_elf_link_hash_entry *) h)->no_fn_stub = TRUE;
|
||||
- break;
|
||||
case R_MIPS16_CALL16:
|
||||
case R_MIPS_CALL16:
|
||||
case R_MIPS_CALL_HI16:
|
||||
case R_MIPS_CALL_LO16:
|
||||
case R_MIPS_JALR:
|
||||
break;
|
||||
+ default:
|
||||
+ ((struct mips_elf_link_hash_entry *) h)->no_fn_stub = TRUE;
|
||||
+ break;
|
||||
}
|
||||
|
||||
/* See if this reloc would need to refer to a MIPS16 hard-float stub,
|
||||
@@ -12514,7 +12536,9 @@ _bfd_mips_elf_merge_private_bfd_data (bf
|
||||
break;
|
||||
}
|
||||
}
|
||||
- if (null_input_bfd)
|
||||
+ /* Dynamic objects normally have no sections, and do not reach
|
||||
+ here - but they might if used as DYNOBJ. */
|
||||
+ if (null_input_bfd || (ibfd->flags & DYNAMIC) != 0)
|
||||
return TRUE;
|
||||
|
||||
ok = TRUE;
|
||||
--- a/bfd/elfxx-mips.h
|
||||
+++ b/bfd/elfxx-mips.h
|
||||
@@ -63,6 +63,9 @@ extern bfd_boolean _bfd_mips_elf_finish_
|
||||
extern bfd_boolean _bfd_mips_vxworks_finish_dynamic_symbol
|
||||
(bfd *, struct bfd_link_info *, struct elf_link_hash_entry *,
|
||||
Elf_Internal_Sym *);
|
||||
+extern bfd_boolean _bfd_mips_nonpic_finish_dynamic_symbol
|
||||
+ (bfd *, struct bfd_link_info *, struct elf_link_hash_entry *,
|
||||
+ Elf_Internal_Sym *);
|
||||
extern bfd_boolean _bfd_mips_elf_finish_dynamic_sections
|
||||
(bfd *, struct bfd_link_info *);
|
||||
extern void _bfd_mips_elf_final_write_processing
|
||||
@@ -153,6 +156,15 @@ extern const struct bfd_elf_special_sect
|
||||
|
||||
extern bfd_boolean _bfd_mips_elf_common_definition (Elf_Internal_Sym *);
|
||||
|
||||
+extern bfd_vma _bfd_mips_elf_plt_sym_val
|
||||
+ (bfd_vma, const asection *, const arelent *);
|
||||
+extern void _bfd_mips_elf_begin_write_processing
|
||||
+ (bfd *abfd, struct bfd_link_info *link_info);
|
||||
+extern bfd_boolean bfd_mips_elf_maybe_create_non_pic_to_pic_stubs_section
|
||||
+ (struct bfd_link_info *);
|
||||
+extern void _bfd_mips_post_process_headers
|
||||
+ (bfd *abfd, struct bfd_link_info *link_info);
|
||||
+
|
||||
#define elf_backend_common_definition _bfd_mips_elf_common_definition
|
||||
#define elf_backend_name_local_section_symbols \
|
||||
_bfd_mips_elf_name_local_section_symbols
|
||||
--- a/gas/config/tc-mips.c
|
||||
+++ b/gas/config/tc-mips.c
|
||||
@@ -1891,6 +1891,12 @@ md_begin (void)
|
||||
as_bad (_("-G may not be used in position-independent code"));
|
||||
g_switch_value = 0;
|
||||
}
|
||||
+ else if (mips_abicalls)
|
||||
+ {
|
||||
+ if (g_switch_seen && g_switch_value != 0)
|
||||
+ as_bad (_("-G may not be used with abicalls"));
|
||||
+ g_switch_value = 0;
|
||||
+ }
|
||||
|
||||
if (! bfd_set_arch_mach (stdoutput, bfd_arch_mips, file_mips_arch))
|
||||
as_warn (_("Could not set architecture and machine"));
|
||||
@@ -11264,6 +11264,7 @@
|
||||
OPTION_PDR,
|
||||
OPTION_NO_PDR,
|
||||
OPTION_MVXWORKS_PIC,
|
||||
+ OPTION_NON_PIC_ABICALLS,
|
||||
#endif /* OBJ_ELF */
|
||||
OPTION_END_OF_ENUM
|
||||
};
|
||||
@@ -11365,6 +11372,7 @@ struct option md_longopts[] =
|
||||
{"mpdr", no_argument, NULL, OPTION_PDR},
|
||||
{"mno-pdr", no_argument, NULL, OPTION_NO_PDR},
|
||||
{"mvxworks-pic", no_argument, NULL, OPTION_MVXWORKS_PIC},
|
||||
+ {"mnon-pic-abicalls", no_argument, NULL, OPTION_NON_PIC_ABICALLS},
|
||||
#endif /* OBJ_ELF */
|
||||
|
||||
{NULL, no_argument, NULL, 0}
|
||||
@@ -11783,6 +11791,11 @@ md_parse_option (int c, char *arg)
|
||||
case OPTION_MVXWORKS_PIC:
|
||||
mips_pic = VXWORKS_PIC;
|
||||
break;
|
||||
+
|
||||
+ case OPTION_NON_PIC_ABICALLS:
|
||||
+ mips_pic = NO_PIC;
|
||||
+ mips_abicalls = TRUE;
|
||||
+ break;
|
||||
#endif /* OBJ_ELF */
|
||||
|
||||
default:
|
@ -1,22 +0,0 @@
|
||||
--- a/ld/Makefile.am
|
||||
+++ b/ld/Makefile.am
|
||||
@@ -24,7 +24,7 @@ AM_CFLAGS = $(WARN_CFLAGS)
|
||||
# We put the scripts in the directory $(scriptdir)/ldscripts.
|
||||
# We can't put the scripts in $(datadir) because the SEARCH_DIR
|
||||
# directives need to be different for native and cross linkers.
|
||||
-scriptdir = $(tooldir)/lib
|
||||
+scriptdir = $(libdir)
|
||||
|
||||
EMUL = @EMUL@
|
||||
EMULATION_OFILES = @EMULATION_OFILES@
|
||||
--- a/ld/Makefile.in
|
||||
+++ b/ld/Makefile.in
|
||||
@@ -333,7 +333,7 @@ AM_CFLAGS = $(WARN_CFLAGS)
|
||||
# We put the scripts in the directory $(scriptdir)/ldscripts.
|
||||
# We can't put the scripts in $(datadir) because the SEARCH_DIR
|
||||
# directives need to be different for native and cross linkers.
|
||||
-scriptdir = $(tooldir)/lib
|
||||
+scriptdir = $(libdir)
|
||||
BASEDIR = $(srcdir)/..
|
||||
BFDDIR = $(BASEDIR)/bfd
|
||||
INCDIR = $(BASEDIR)/include
|
@ -1,20 +0,0 @@
|
||||
--- a/ld/emultempl/elf32.em
|
||||
+++ b/ld/emultempl/elf32.em
|
||||
@@ -1233,6 +1233,8 @@ fragment <<EOF
|
||||
&& command_line.rpath == NULL)
|
||||
{
|
||||
lib_path = (const char *) getenv ("LD_RUN_PATH");
|
||||
+ if ((lib_path) && (strlen (lib_path) == 0))
|
||||
+ lib_path = NULL;
|
||||
if (gld${EMULATION_NAME}_search_needed (lib_path, &n,
|
||||
force))
|
||||
break;
|
||||
@@ -1418,6 +1420,8 @@ gld${EMULATION_NAME}_before_allocation (
|
||||
rpath = command_line.rpath;
|
||||
if (rpath == NULL)
|
||||
rpath = (const char *) getenv ("LD_RUN_PATH");
|
||||
+ if ((rpath) && (strlen (rpath) == 0))
|
||||
+ rpath = NULL;
|
||||
if (! (bfd_elf_size_dynamic_sections
|
||||
(link_info.output_bfd, command_line.soname, rpath,
|
||||
command_line.filter_shlib,
|
Loading…
Reference in New Issue
Block a user