From 83a5eb4084b4a4ec2249e7ff10e480d3c75d65f7 Mon Sep 17 00:00:00 2001 From: Alexey Neyman Date: Fri, 28 Sep 2018 15:43:17 -0700 Subject: Patches to fix ld's abort on xtensa Also while there, fix the naming (some patches ended up with two sequence numbers somehow). Signed-off-by: Alexey Neyman diff --git a/packages/binutils/2.23.2/0001-001_ld_makefile_patch.patch b/packages/binutils/2.23.2/0001-001_ld_makefile_patch.patch deleted file mode 100644 index 3992be3..0000000 --- a/packages/binutils/2.23.2/0001-001_ld_makefile_patch.patch +++ /dev/null @@ -1,27 +0,0 @@ ---- - ld/Makefile.am | 2 +- - ld/Makefile.in | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - ---- a/ld/Makefile.am -+++ b/ld/Makefile.am -@@ -37,7 +37,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@ ---- a/ld/Makefile.in -+++ b/ld/Makefile.in -@@ -367,7 +367,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 diff --git a/packages/binutils/2.23.2/0001-ld_makefile_patch.patch b/packages/binutils/2.23.2/0001-ld_makefile_patch.patch new file mode 100644 index 0000000..3992be3 --- /dev/null +++ b/packages/binutils/2.23.2/0001-ld_makefile_patch.patch @@ -0,0 +1,27 @@ +--- + ld/Makefile.am | 2 +- + ld/Makefile.in | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +--- a/ld/Makefile.am ++++ b/ld/Makefile.am +@@ -37,7 +37,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@ +--- a/ld/Makefile.in ++++ b/ld/Makefile.in +@@ -367,7 +367,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 diff --git a/packages/binutils/2.23.2/0002-012_check_ldrunpath_length.patch b/packages/binutils/2.23.2/0002-012_check_ldrunpath_length.patch deleted file mode 100644 index a24df5e..0000000 --- a/packages/binutils/2.23.2/0002-012_check_ldrunpath_length.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- - ld/emultempl/elf32.em | 4 ++++ - 1 file changed, 4 insertions(+) - ---- a/ld/emultempl/elf32.em -+++ b/ld/emultempl/elf32.em -@@ -1278,6 +1278,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; -@@ -1505,6 +1507,8 @@ - rpath = command_line.rpath; - if (rpath == NULL) - rpath = (const char *) getenv ("LD_RUN_PATH"); -+ if ((rpath) && (strlen (rpath) == 0)) -+ rpath = NULL; - - for (abfd = link_info.input_bfds; abfd; abfd = abfd->link_next) - if (bfd_get_flavour (abfd) == bfd_target_elf_flavour) diff --git a/packages/binutils/2.23.2/0002-check_ldrunpath_length.patch b/packages/binutils/2.23.2/0002-check_ldrunpath_length.patch new file mode 100644 index 0000000..a24df5e --- /dev/null +++ b/packages/binutils/2.23.2/0002-check_ldrunpath_length.patch @@ -0,0 +1,24 @@ +--- + ld/emultempl/elf32.em | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/ld/emultempl/elf32.em ++++ b/ld/emultempl/elf32.em +@@ -1278,6 +1278,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; +@@ -1505,6 +1507,8 @@ + rpath = command_line.rpath; + if (rpath == NULL) + rpath = (const char *) getenv ("LD_RUN_PATH"); ++ if ((rpath) && (strlen (rpath) == 0)) ++ rpath = NULL; + + for (abfd = link_info.input_bfds; abfd; abfd = abfd->link_next) + if (bfd_get_flavour (abfd) == bfd_target_elf_flavour) diff --git a/packages/binutils/2.24/0003-001_ld_makefile_patch.patch b/packages/binutils/2.24/0003-001_ld_makefile_patch.patch deleted file mode 100644 index ab6a74f..0000000 --- a/packages/binutils/2.24/0003-001_ld_makefile_patch.patch +++ /dev/null @@ -1,27 +0,0 @@ ---- - ld/Makefile.am | 2 +- - ld/Makefile.in | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - ---- a/ld/Makefile.am -+++ b/ld/Makefile.am -@@ -54,7 +54,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@ ---- a/ld/Makefile.in -+++ b/ld/Makefile.in -@@ -386,7 +386,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 diff --git a/packages/binutils/2.24/0003-ld_makefile_patch.patch b/packages/binutils/2.24/0003-ld_makefile_patch.patch new file mode 100644 index 0000000..ab6a74f --- /dev/null +++ b/packages/binutils/2.24/0003-ld_makefile_patch.patch @@ -0,0 +1,27 @@ +--- + ld/Makefile.am | 2 +- + ld/Makefile.in | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +--- a/ld/Makefile.am ++++ b/ld/Makefile.am +@@ -54,7 +54,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@ +--- a/ld/Makefile.in ++++ b/ld/Makefile.in +@@ -386,7 +386,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 diff --git a/packages/binutils/2.24/0004-012_check_ldrunpath_length.patch b/packages/binutils/2.24/0004-012_check_ldrunpath_length.patch deleted file mode 100644 index ce28120..0000000 --- a/packages/binutils/2.24/0004-012_check_ldrunpath_length.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- - ld/emultempl/elf32.em | 4 ++++ - 1 file changed, 4 insertions(+) - ---- a/ld/emultempl/elf32.em -+++ b/ld/emultempl/elf32.em -@@ -1267,6 +1267,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; -@@ -1518,6 +1520,8 @@ - rpath = command_line.rpath; - if (rpath == NULL) - rpath = (const char *) getenv ("LD_RUN_PATH"); -+ if ((rpath) && (strlen (rpath) == 0)) -+ rpath = NULL; - - for (abfd = link_info.input_bfds; abfd; abfd = abfd->link_next) - if (bfd_get_flavour (abfd) == bfd_target_elf_flavour) diff --git a/packages/binutils/2.24/0004-check_ldrunpath_length.patch b/packages/binutils/2.24/0004-check_ldrunpath_length.patch new file mode 100644 index 0000000..ce28120 --- /dev/null +++ b/packages/binutils/2.24/0004-check_ldrunpath_length.patch @@ -0,0 +1,24 @@ +--- + ld/emultempl/elf32.em | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/ld/emultempl/elf32.em ++++ b/ld/emultempl/elf32.em +@@ -1267,6 +1267,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; +@@ -1518,6 +1520,8 @@ + rpath = command_line.rpath; + if (rpath == NULL) + rpath = (const char *) getenv ("LD_RUN_PATH"); ++ if ((rpath) && (strlen (rpath) == 0)) ++ rpath = NULL; + + for (abfd = link_info.input_bfds; abfd; abfd = abfd->link_next) + if (bfd_get_flavour (abfd) == bfd_target_elf_flavour) diff --git a/packages/binutils/2.25.1/0001-001_ld_makefile_patch.patch b/packages/binutils/2.25.1/0001-001_ld_makefile_patch.patch deleted file mode 100644 index c47d7d1..0000000 --- a/packages/binutils/2.25.1/0001-001_ld_makefile_patch.patch +++ /dev/null @@ -1,27 +0,0 @@ ---- - ld/Makefile.am | 2 +- - ld/Makefile.in | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - ---- a/ld/Makefile.am -+++ b/ld/Makefile.am -@@ -54,7 +54,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@ ---- a/ld/Makefile.in -+++ b/ld/Makefile.in -@@ -388,7 +388,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 diff --git a/packages/binutils/2.25.1/0001-ld_makefile_patch.patch b/packages/binutils/2.25.1/0001-ld_makefile_patch.patch new file mode 100644 index 0000000..c47d7d1 --- /dev/null +++ b/packages/binutils/2.25.1/0001-ld_makefile_patch.patch @@ -0,0 +1,27 @@ +--- + ld/Makefile.am | 2 +- + ld/Makefile.in | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +--- a/ld/Makefile.am ++++ b/ld/Makefile.am +@@ -54,7 +54,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@ +--- a/ld/Makefile.in ++++ b/ld/Makefile.in +@@ -388,7 +388,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 diff --git a/packages/binutils/2.25.1/0002-012_check_ldrunpath_length.patch b/packages/binutils/2.25.1/0002-012_check_ldrunpath_length.patch deleted file mode 100644 index 712eb19..0000000 --- a/packages/binutils/2.25.1/0002-012_check_ldrunpath_length.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- - ld/emultempl/elf32.em | 4 ++++ - 1 file changed, 4 insertions(+) - ---- a/ld/emultempl/elf32.em -+++ b/ld/emultempl/elf32.em -@@ -1198,6 +1198,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; -@@ -1461,6 +1463,8 @@ - rpath = command_line.rpath; - if (rpath == NULL) - rpath = (const char *) getenv ("LD_RUN_PATH"); -+ if ((rpath) && (*rpath == '\0')) -+ rpath = NULL; - - for (abfd = link_info.input_bfds; abfd; abfd = abfd->link.next) - if (bfd_get_flavour (abfd) == bfd_target_elf_flavour) diff --git a/packages/binutils/2.25.1/0002-check_ldrunpath_length.patch b/packages/binutils/2.25.1/0002-check_ldrunpath_length.patch new file mode 100644 index 0000000..712eb19 --- /dev/null +++ b/packages/binutils/2.25.1/0002-check_ldrunpath_length.patch @@ -0,0 +1,24 @@ +--- + ld/emultempl/elf32.em | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/ld/emultempl/elf32.em ++++ b/ld/emultempl/elf32.em +@@ -1198,6 +1198,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; +@@ -1461,6 +1463,8 @@ + rpath = command_line.rpath; + if (rpath == NULL) + rpath = (const char *) getenv ("LD_RUN_PATH"); ++ if ((rpath) && (*rpath == '\0')) ++ rpath = NULL; + + for (abfd = link_info.input_bfds; abfd; abfd = abfd->link.next) + if (bfd_get_flavour (abfd) == bfd_target_elf_flavour) diff --git a/packages/binutils/2.26.1/0001-001_ld_makefile_patch.patch b/packages/binutils/2.26.1/0001-001_ld_makefile_patch.patch deleted file mode 100644 index d2e1cd9..0000000 --- a/packages/binutils/2.26.1/0001-001_ld_makefile_patch.patch +++ /dev/null @@ -1,27 +0,0 @@ ---- - ld/Makefile.am | 2 +- - ld/Makefile.in | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - ---- a/ld/Makefile.am -+++ b/ld/Makefile.am -@@ -57,7 +57,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@ ---- a/ld/Makefile.in -+++ b/ld/Makefile.in -@@ -413,7 +413,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 diff --git a/packages/binutils/2.26.1/0001-ld_makefile_patch.patch b/packages/binutils/2.26.1/0001-ld_makefile_patch.patch new file mode 100644 index 0000000..d2e1cd9 --- /dev/null +++ b/packages/binutils/2.26.1/0001-ld_makefile_patch.patch @@ -0,0 +1,27 @@ +--- + ld/Makefile.am | 2 +- + ld/Makefile.in | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +--- a/ld/Makefile.am ++++ b/ld/Makefile.am +@@ -57,7 +57,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@ +--- a/ld/Makefile.in ++++ b/ld/Makefile.in +@@ -413,7 +413,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 diff --git a/packages/binutils/2.26.1/0002-012_check_ldrunpath_length.patch b/packages/binutils/2.26.1/0002-012_check_ldrunpath_length.patch deleted file mode 100644 index e3d6508..0000000 --- a/packages/binutils/2.26.1/0002-012_check_ldrunpath_length.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- - ld/emultempl/elf32.em | 4 ++++ - 1 file changed, 4 insertions(+) - ---- a/ld/emultempl/elf32.em -+++ b/ld/emultempl/elf32.em -@@ -1242,6 +1242,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; -@@ -1523,6 +1525,8 @@ - rpath = command_line.rpath; - if (rpath == NULL) - rpath = (const char *) getenv ("LD_RUN_PATH"); -+ if ((rpath) && (*rpath == '\0')) -+ rpath = NULL; - - for (abfd = link_info.input_bfds; abfd; abfd = abfd->link.next) - if (bfd_get_flavour (abfd) == bfd_target_elf_flavour) diff --git a/packages/binutils/2.26.1/0002-check_ldrunpath_length.patch b/packages/binutils/2.26.1/0002-check_ldrunpath_length.patch new file mode 100644 index 0000000..e3d6508 --- /dev/null +++ b/packages/binutils/2.26.1/0002-check_ldrunpath_length.patch @@ -0,0 +1,24 @@ +--- + ld/emultempl/elf32.em | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/ld/emultempl/elf32.em ++++ b/ld/emultempl/elf32.em +@@ -1242,6 +1242,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; +@@ -1523,6 +1525,8 @@ + rpath = command_line.rpath; + if (rpath == NULL) + rpath = (const char *) getenv ("LD_RUN_PATH"); ++ if ((rpath) && (*rpath == '\0')) ++ rpath = NULL; + + for (abfd = link_info.input_bfds; abfd; abfd = abfd->link.next) + if (bfd_get_flavour (abfd) == bfd_target_elf_flavour) diff --git a/packages/binutils/2.27/0002-001_ld_makefile_patch.patch b/packages/binutils/2.27/0002-001_ld_makefile_patch.patch deleted file mode 100644 index 79c4719..0000000 --- a/packages/binutils/2.27/0002-001_ld_makefile_patch.patch +++ /dev/null @@ -1,27 +0,0 @@ ---- - ld/Makefile.am | 2 +- - ld/Makefile.in | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - ---- a/ld/Makefile.am -+++ b/ld/Makefile.am -@@ -57,7 +57,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@ ---- a/ld/Makefile.in -+++ b/ld/Makefile.in -@@ -451,7 +451,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 diff --git a/packages/binutils/2.27/0002-ld_makefile_patch.patch b/packages/binutils/2.27/0002-ld_makefile_patch.patch new file mode 100644 index 0000000..79c4719 --- /dev/null +++ b/packages/binutils/2.27/0002-ld_makefile_patch.patch @@ -0,0 +1,27 @@ +--- + ld/Makefile.am | 2 +- + ld/Makefile.in | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +--- a/ld/Makefile.am ++++ b/ld/Makefile.am +@@ -57,7 +57,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@ +--- a/ld/Makefile.in ++++ b/ld/Makefile.in +@@ -451,7 +451,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 diff --git a/packages/binutils/2.27/0003-012_check_ldrunpath_length.patch b/packages/binutils/2.27/0003-012_check_ldrunpath_length.patch deleted file mode 100644 index 7433351..0000000 --- a/packages/binutils/2.27/0003-012_check_ldrunpath_length.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- - ld/emultempl/elf32.em | 4 ++++ - 1 file changed, 4 insertions(+) - ---- a/ld/emultempl/elf32.em -+++ b/ld/emultempl/elf32.em -@@ -1244,6 +1244,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; -@@ -1525,6 +1527,8 @@ - rpath = command_line.rpath; - if (rpath == NULL) - rpath = (const char *) getenv ("LD_RUN_PATH"); -+ if ((rpath) && (*rpath == '\0')) -+ rpath = NULL; - - for (abfd = link_info.input_bfds; abfd; abfd = abfd->link.next) - if (bfd_get_flavour (abfd) == bfd_target_elf_flavour) diff --git a/packages/binutils/2.27/0003-check_ldrunpath_length.patch b/packages/binutils/2.27/0003-check_ldrunpath_length.patch new file mode 100644 index 0000000..7433351 --- /dev/null +++ b/packages/binutils/2.27/0003-check_ldrunpath_length.patch @@ -0,0 +1,24 @@ +--- + ld/emultempl/elf32.em | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/ld/emultempl/elf32.em ++++ b/ld/emultempl/elf32.em +@@ -1244,6 +1244,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; +@@ -1525,6 +1527,8 @@ + rpath = command_line.rpath; + if (rpath == NULL) + rpath = (const char *) getenv ("LD_RUN_PATH"); ++ if ((rpath) && (*rpath == '\0')) ++ rpath = NULL; + + for (abfd = link_info.input_bfds; abfd; abfd = abfd->link.next) + if (bfd_get_flavour (abfd) == bfd_target_elf_flavour) diff --git a/packages/binutils/2.28.1/0001-001_ld_makefile_patch.patch b/packages/binutils/2.28.1/0001-001_ld_makefile_patch.patch deleted file mode 100644 index 36940de..0000000 --- a/packages/binutils/2.28.1/0001-001_ld_makefile_patch.patch +++ /dev/null @@ -1,27 +0,0 @@ ---- - ld/Makefile.am | 2 +- - ld/Makefile.in | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - ---- a/ld/Makefile.am -+++ b/ld/Makefile.am -@@ -57,7 +57,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@ ---- a/ld/Makefile.in -+++ b/ld/Makefile.in -@@ -452,7 +452,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 diff --git a/packages/binutils/2.28.1/0001-ld_makefile_patch.patch b/packages/binutils/2.28.1/0001-ld_makefile_patch.patch new file mode 100644 index 0000000..36940de --- /dev/null +++ b/packages/binutils/2.28.1/0001-ld_makefile_patch.patch @@ -0,0 +1,27 @@ +--- + ld/Makefile.am | 2 +- + ld/Makefile.in | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +--- a/ld/Makefile.am ++++ b/ld/Makefile.am +@@ -57,7 +57,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@ +--- a/ld/Makefile.in ++++ b/ld/Makefile.in +@@ -452,7 +452,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 diff --git a/packages/binutils/2.28.1/0002-012_check_ldrunpath_length.patch b/packages/binutils/2.28.1/0002-012_check_ldrunpath_length.patch deleted file mode 100644 index 78f05ae..0000000 --- a/packages/binutils/2.28.1/0002-012_check_ldrunpath_length.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- - ld/emultempl/elf32.em | 4 ++++ - 1 file changed, 4 insertions(+) - ---- a/ld/emultempl/elf32.em -+++ b/ld/emultempl/elf32.em -@@ -1411,6 +1411,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; -@@ -1692,6 +1694,8 @@ - rpath = command_line.rpath; - if (rpath == NULL) - rpath = (const char *) getenv ("LD_RUN_PATH"); -+ if ((rpath) && (*rpath == '\0')) -+ rpath = NULL; - - for (abfd = link_info.input_bfds; abfd; abfd = abfd->link.next) - if (bfd_get_flavour (abfd) == bfd_target_elf_flavour) diff --git a/packages/binutils/2.28.1/0002-check_ldrunpath_length.patch b/packages/binutils/2.28.1/0002-check_ldrunpath_length.patch new file mode 100644 index 0000000..78f05ae --- /dev/null +++ b/packages/binutils/2.28.1/0002-check_ldrunpath_length.patch @@ -0,0 +1,24 @@ +--- + ld/emultempl/elf32.em | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/ld/emultempl/elf32.em ++++ b/ld/emultempl/elf32.em +@@ -1411,6 +1411,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; +@@ -1692,6 +1694,8 @@ + rpath = command_line.rpath; + if (rpath == NULL) + rpath = (const char *) getenv ("LD_RUN_PATH"); ++ if ((rpath) && (*rpath == '\0')) ++ rpath = NULL; + + for (abfd = link_info.input_bfds; abfd; abfd = abfd->link.next) + if (bfd_get_flavour (abfd) == bfd_target_elf_flavour) diff --git a/packages/binutils/2.29.1/0001-001_ld_makefile_patch.patch b/packages/binutils/2.29.1/0001-001_ld_makefile_patch.patch deleted file mode 100644 index 4623653..0000000 --- a/packages/binutils/2.29.1/0001-001_ld_makefile_patch.patch +++ /dev/null @@ -1,27 +0,0 @@ ---- - ld/Makefile.am | 2 +- - ld/Makefile.in | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - ---- a/ld/Makefile.am -+++ b/ld/Makefile.am -@@ -57,7 +57,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@ ---- a/ld/Makefile.in -+++ b/ld/Makefile.in -@@ -446,7 +446,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 diff --git a/packages/binutils/2.29.1/0001-ld_makefile_patch.patch b/packages/binutils/2.29.1/0001-ld_makefile_patch.patch new file mode 100644 index 0000000..4623653 --- /dev/null +++ b/packages/binutils/2.29.1/0001-ld_makefile_patch.patch @@ -0,0 +1,27 @@ +--- + ld/Makefile.am | 2 +- + ld/Makefile.in | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +--- a/ld/Makefile.am ++++ b/ld/Makefile.am +@@ -57,7 +57,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@ +--- a/ld/Makefile.in ++++ b/ld/Makefile.in +@@ -446,7 +446,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 diff --git a/packages/binutils/2.29.1/0002-012_check_ldrunpath_length.patch b/packages/binutils/2.29.1/0002-012_check_ldrunpath_length.patch deleted file mode 100644 index 9bdc413..0000000 --- a/packages/binutils/2.29.1/0002-012_check_ldrunpath_length.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- - ld/emultempl/elf32.em | 4 ++++ - 1 file changed, 4 insertions(+) - ---- a/ld/emultempl/elf32.em -+++ b/ld/emultempl/elf32.em -@@ -1463,6 +1463,8 @@ - && command_line.rpath == NULL) - { - path = (const char *) getenv ("LD_RUN_PATH"); -+ if ((path) && (strlen (path) == 0)) -+ path = NULL; - if (path - && gld${EMULATION_NAME}_search_needed (path, &n, force)) - break; -@@ -1740,6 +1742,8 @@ - rpath = command_line.rpath; - if (rpath == NULL) - rpath = (const char *) getenv ("LD_RUN_PATH"); -+ if ((rpath) && (*rpath == '\0')) -+ rpath = NULL; - - for (abfd = link_info.input_bfds; abfd; abfd = abfd->link.next) - if (bfd_get_flavour (abfd) == bfd_target_elf_flavour) diff --git a/packages/binutils/2.29.1/0002-check_ldrunpath_length.patch b/packages/binutils/2.29.1/0002-check_ldrunpath_length.patch new file mode 100644 index 0000000..9bdc413 --- /dev/null +++ b/packages/binutils/2.29.1/0002-check_ldrunpath_length.patch @@ -0,0 +1,24 @@ +--- + ld/emultempl/elf32.em | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/ld/emultempl/elf32.em ++++ b/ld/emultempl/elf32.em +@@ -1463,6 +1463,8 @@ + && command_line.rpath == NULL) + { + path = (const char *) getenv ("LD_RUN_PATH"); ++ if ((path) && (strlen (path) == 0)) ++ path = NULL; + if (path + && gld${EMULATION_NAME}_search_needed (path, &n, force)) + break; +@@ -1740,6 +1742,8 @@ + rpath = command_line.rpath; + if (rpath == NULL) + rpath = (const char *) getenv ("LD_RUN_PATH"); ++ if ((rpath) && (*rpath == '\0')) ++ rpath = NULL; + + for (abfd = link_info.input_bfds; abfd; abfd = abfd->link.next) + if (bfd_get_flavour (abfd) == bfd_target_elf_flavour) diff --git a/packages/binutils/2.30/0001-001_ld_makefile_patch.patch b/packages/binutils/2.30/0001-001_ld_makefile_patch.patch deleted file mode 100644 index 4623653..0000000 --- a/packages/binutils/2.30/0001-001_ld_makefile_patch.patch +++ /dev/null @@ -1,27 +0,0 @@ ---- - ld/Makefile.am | 2 +- - ld/Makefile.in | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - ---- a/ld/Makefile.am -+++ b/ld/Makefile.am -@@ -57,7 +57,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@ ---- a/ld/Makefile.in -+++ b/ld/Makefile.in -@@ -446,7 +446,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 diff --git a/packages/binutils/2.30/0001-ld_makefile_patch.patch b/packages/binutils/2.30/0001-ld_makefile_patch.patch new file mode 100644 index 0000000..4623653 --- /dev/null +++ b/packages/binutils/2.30/0001-ld_makefile_patch.patch @@ -0,0 +1,27 @@ +--- + ld/Makefile.am | 2 +- + ld/Makefile.in | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +--- a/ld/Makefile.am ++++ b/ld/Makefile.am +@@ -57,7 +57,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@ +--- a/ld/Makefile.in ++++ b/ld/Makefile.in +@@ -446,7 +446,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 diff --git a/packages/binutils/2.30/0002-012_check_ldrunpath_length.patch b/packages/binutils/2.30/0002-012_check_ldrunpath_length.patch deleted file mode 100644 index 026f279..0000000 --- a/packages/binutils/2.30/0002-012_check_ldrunpath_length.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- - ld/emultempl/elf32.em | 4 ++++ - 1 file changed, 4 insertions(+) - ---- a/ld/emultempl/elf32.em -+++ b/ld/emultempl/elf32.em -@@ -1470,6 +1470,8 @@ - && command_line.rpath == NULL) - { - path = (const char *) getenv ("LD_RUN_PATH"); -+ if ((path) && (strlen (path) == 0)) -+ path = NULL; - if (path - && gld${EMULATION_NAME}_search_needed (path, &n, force)) - break; -@@ -1750,6 +1752,8 @@ - rpath = command_line.rpath; - if (rpath == NULL) - rpath = (const char *) getenv ("LD_RUN_PATH"); -+ if ((rpath) && (*rpath == '\0')) -+ rpath = NULL; - - for (abfd = link_info.input_bfds; abfd; abfd = abfd->link.next) - if (bfd_get_flavour (abfd) == bfd_target_elf_flavour) diff --git a/packages/binutils/2.30/0002-check_ldrunpath_length.patch b/packages/binutils/2.30/0002-check_ldrunpath_length.patch new file mode 100644 index 0000000..026f279 --- /dev/null +++ b/packages/binutils/2.30/0002-check_ldrunpath_length.patch @@ -0,0 +1,24 @@ +--- + ld/emultempl/elf32.em | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/ld/emultempl/elf32.em ++++ b/ld/emultempl/elf32.em +@@ -1470,6 +1470,8 @@ + && command_line.rpath == NULL) + { + path = (const char *) getenv ("LD_RUN_PATH"); ++ if ((path) && (strlen (path) == 0)) ++ path = NULL; + if (path + && gld${EMULATION_NAME}_search_needed (path, &n, force)) + break; +@@ -1750,6 +1752,8 @@ + rpath = command_line.rpath; + if (rpath == NULL) + rpath = (const char *) getenv ("LD_RUN_PATH"); ++ if ((rpath) && (*rpath == '\0')) ++ rpath = NULL; + + for (abfd = link_info.input_bfds; abfd; abfd = abfd->link.next) + if (bfd_get_flavour (abfd) == bfd_target_elf_flavour) diff --git a/packages/binutils/2.31.1/0001-001_ld_makefile_patch.patch b/packages/binutils/2.31.1/0001-001_ld_makefile_patch.patch deleted file mode 100644 index f73ff26..0000000 --- a/packages/binutils/2.31.1/0001-001_ld_makefile_patch.patch +++ /dev/null @@ -1,27 +0,0 @@ ---- - ld/Makefile.am | 2 +- - ld/Makefile.in | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - ---- a/ld/Makefile.am -+++ b/ld/Makefile.am -@@ -57,7 +57,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@ ---- a/ld/Makefile.in -+++ b/ld/Makefile.in -@@ -563,7 +563,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 diff --git a/packages/binutils/2.31.1/0001-ld_makefile_patch.patch b/packages/binutils/2.31.1/0001-ld_makefile_patch.patch new file mode 100644 index 0000000..f73ff26 --- /dev/null +++ b/packages/binutils/2.31.1/0001-ld_makefile_patch.patch @@ -0,0 +1,27 @@ +--- + ld/Makefile.am | 2 +- + ld/Makefile.in | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +--- a/ld/Makefile.am ++++ b/ld/Makefile.am +@@ -57,7 +57,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@ +--- a/ld/Makefile.in ++++ b/ld/Makefile.in +@@ -563,7 +563,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 diff --git a/packages/binutils/2.31.1/0002-012_check_ldrunpath_length.patch b/packages/binutils/2.31.1/0002-012_check_ldrunpath_length.patch deleted file mode 100644 index c0803d6..0000000 --- a/packages/binutils/2.31.1/0002-012_check_ldrunpath_length.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- - ld/emultempl/elf32.em | 4 ++++ - 1 file changed, 4 insertions(+) - ---- a/ld/emultempl/elf32.em -+++ b/ld/emultempl/elf32.em -@@ -1471,6 +1471,8 @@ - && command_line.rpath == NULL) - { - path = (const char *) getenv ("LD_RUN_PATH"); -+ if ((path) && (strlen (path) == 0)) -+ path = NULL; - if (path - && gld${EMULATION_NAME}_search_needed (path, &n, force)) - break; -@@ -1751,6 +1753,8 @@ - rpath = command_line.rpath; - if (rpath == NULL) - rpath = (const char *) getenv ("LD_RUN_PATH"); -+ if ((rpath) && (*rpath == '\0')) -+ rpath = NULL; - - for (abfd = link_info.input_bfds; abfd; abfd = abfd->link.next) - if (bfd_get_flavour (abfd) == bfd_target_elf_flavour) diff --git a/packages/binutils/2.31.1/0002-check_ldrunpath_length.patch b/packages/binutils/2.31.1/0002-check_ldrunpath_length.patch new file mode 100644 index 0000000..c0803d6 --- /dev/null +++ b/packages/binutils/2.31.1/0002-check_ldrunpath_length.patch @@ -0,0 +1,24 @@ +--- + ld/emultempl/elf32.em | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/ld/emultempl/elf32.em ++++ b/ld/emultempl/elf32.em +@@ -1471,6 +1471,8 @@ + && command_line.rpath == NULL) + { + path = (const char *) getenv ("LD_RUN_PATH"); ++ if ((path) && (strlen (path) == 0)) ++ path = NULL; + if (path + && gld${EMULATION_NAME}_search_needed (path, &n, force)) + break; +@@ -1751,6 +1753,8 @@ + rpath = command_line.rpath; + if (rpath == NULL) + rpath = (const char *) getenv ("LD_RUN_PATH"); ++ if ((rpath) && (*rpath == '\0')) ++ rpath = NULL; + + for (abfd = link_info.input_bfds; abfd; abfd = abfd->link.next) + if (bfd_get_flavour (abfd) == bfd_target_elf_flavour) diff --git a/packages/binutils/2.31.1/0009-xtensa-fix-relaxation-of-undefined-weak-references-i.patch b/packages/binutils/2.31.1/0009-xtensa-fix-relaxation-of-undefined-weak-references-i.patch new file mode 100644 index 0000000..2c70bd2 --- /dev/null +++ b/packages/binutils/2.31.1/0009-xtensa-fix-relaxation-of-undefined-weak-references-i.patch @@ -0,0 +1,43 @@ +From 5d3a462f05cba5b0c0c96de899b84fb84155c760 Mon Sep 17 00:00:00 2001 +From: Max Filippov +Date: Sun, 22 Jul 2018 13:52:28 -0700 +Subject: [PATCH] xtensa: fix relaxation of undefined weak references in + shared objects + +The change c451bb34ae8b ("xtensa: don't emit dynamic relocation for weak +undefined symbol") didn't properly handle shrinking of relocation +sections due to coalescing of references to a dynamic undefined weak +symbol in a shared object, which resulted in the following assertion +failure in ld when linking uClibc-ng libthread_db for xtensa: + + BFD (GNU Binutils) 2.31 internal error, aborting at elf32-xtensa.c:3269 + in elf_xtensa_finish_dynamic_sections + +Shrink dynamic relocations section for dynamic undefined weak symbols +when linking a shared object. + +bfd/ +2018-07-23 Max Filippov + + * elf32-xtensa.c (shrink_dynamic_reloc_sections): Shrink dynamic + relocations section for dynamic undefined weak symbols when + linking a shared object. + +Signed-off-by: Max Filippov +Backported from: 5d3a462f05cba5b0c0c96de899b84fb84155c760 +--- + bfd/elf32-xtensa.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/bfd/elf32-xtensa.c ++++ b/bfd/elf32-xtensa.c +@@ -10022,7 +10022,8 @@ + if ((r_type == R_XTENSA_32 || r_type == R_XTENSA_PLT) + && (input_section->flags & SEC_ALLOC) != 0 + && (dynamic_symbol || bfd_link_pic (info)) +- && (!h || h->root.type != bfd_link_hash_undefweak)) ++ && (!h || h->root.type != bfd_link_hash_undefweak ++ || (dynamic_symbol && bfd_link_dll (info)))) + { + asection *srel; + bfd_boolean is_plt = FALSE; diff --git a/packages/binutils/2.31.1/0010-xtensa-move-dynamic-relocations-sections-consistency.patch b/packages/binutils/2.31.1/0010-xtensa-move-dynamic-relocations-sections-consistency.patch new file mode 100644 index 0000000..710d368 --- /dev/null +++ b/packages/binutils/2.31.1/0010-xtensa-move-dynamic-relocations-sections-consistency.patch @@ -0,0 +1,85 @@ +From f82863d797e461b936dff2b659a3aa65088ee87e Mon Sep 17 00:00:00 2001 +From: Max Filippov +Date: Sun, 22 Jul 2018 18:59:11 -0700 +Subject: [PATCH] xtensa: move dynamic relocations sections consistency + check + +The function elf_xtensa_finish_dynamic_sections checks that sizes of +sections .rela.dyn and .rela.plt match number of corresponding relocation +records, but the check is only done when .rela.plt is non-empty, so, e.g. +it is never run for the static PIE. +Rearrange the test so that .rela.dyn and .rela.plt are checked always. + +bfd/ +2018-07-23 Max Filippov + + * elf32-xtensa.c (elf_xtensa_finish_dynamic_sections): Move + relocation sections consistency check to always check both + .rela.dyn and .rela.plt when they exist. Rearrange variable + definition and assignment places. + +Signed-off-by: Max Filippov +Backported from: f82863d797e461b936dff2b659a3aa65088ee87e +--- + bfd/elf32-xtensa.c | 22 +++++++++++----------- + 1 file changed, 11 insertions(+), 11 deletions(-) + +--- a/bfd/elf32-xtensa.c ++++ b/bfd/elf32-xtensa.c +@@ -3156,7 +3156,7 @@ + { + struct elf_xtensa_link_hash_table *htab; + bfd *dynobj; +- asection *sdyn, *srelplt, *sgot, *sxtlit, *sgotloc; ++ asection *sdyn, *srelplt, *srelgot, *sgot, *sxtlit, *sgotloc; + Elf32_External_Dyn *dyncon, *dynconend; + int num_xtlit_entries = 0; + +@@ -3186,15 +3186,15 @@ + } + + srelplt = htab->elf.srelplt; ++ srelgot = htab->elf.srelgot; + if (srelplt && srelplt->size != 0) + { +- asection *sgotplt, *srelgot, *spltlittbl; ++ asection *sgotplt, *spltlittbl; + int chunk, plt_chunks, plt_entries; + Elf_Internal_Rela irela; + bfd_byte *loc; + unsigned rtld_reloc; + +- srelgot = htab->elf.srelgot; + spltlittbl = htab->spltlittbl; + BFD_ASSERT (srelgot != NULL && spltlittbl != NULL); + +@@ -3260,14 +3260,6 @@ + spltlittbl->contents + (chunk * 8) + 4); + } + +- /* All the dynamic relocations have been emitted at this point. +- Make sure the relocation sections are the correct size. */ +- if (srelgot->size != (sizeof (Elf32_External_Rela) +- * srelgot->reloc_count) +- || srelplt->size != (sizeof (Elf32_External_Rela) +- * srelplt->reloc_count)) +- abort (); +- + /* The .xt.lit.plt section has just been modified. This must + happen before the code below which combines adjacent literal + table entries, and the .xt.lit.plt contents have to be forced to +@@ -3282,6 +3274,14 @@ + spltlittbl->flags &= ~SEC_HAS_CONTENTS; + } + ++ /* All the dynamic relocations have been emitted at this point. ++ Make sure the relocation sections are the correct size. */ ++ if ((srelgot && srelgot->size != (sizeof (Elf32_External_Rela) ++ * srelgot->reloc_count)) ++ || (srelplt && srelplt->size != (sizeof (Elf32_External_Rela) ++ * srelplt->reloc_count))) ++ abort (); ++ + /* Combine adjacent literal table entries. */ + BFD_ASSERT (! bfd_link_relocatable (info)); + sxtlit = bfd_get_section_by_name (output_bfd, ".xt.lit"); -- cgit v0.10.2-6-g49f6