config BR2_BINUTILS_VERSION
string
- default "arc-2019.09-eng002" if BR2_BINUTILS_VERSION_ARC
+ default "arc-2019.09-rc1" if BR2_BINUTILS_VERSION_ARC
default "c66d8bbcebfddf713b2b436e1b135e6b125a55a5" if BR2_BINUTILS_VERSION_CSKY
default "2.30" if BR2_BINUTILS_VERSION_2_30_X
default "2.31.1" if BR2_BINUTILS_VERSION_2_31_X
+++ /dev/null
-From 5f62ad7ce534e3384d6ed8892614979da297bd70 Mon Sep 17 00:00:00 2001
-From: Evgeniy Didin <Evgeniy.Didin@synopsys.com>
-Date: Mon, 14 Oct 2019 16:45:15 +0300
-Subject: [PATCH] [PATCH] poison-system-directories
-
-Patch adapted to arc-binutils-gdb-2019.09
-Signed-off-by: Evgeniy Didin <Evgeniy.Didin@synopsys.com>
-
-Patch adapted to binutils 2.23.2 and extended to use
-BR_COMPILER_PARANOID_UNSAFE_PATH by Thomas Petazzoni.
-
-[Romain: rebase on top of 2.26]
-Signed-off-by: Romain Naour <romain.naour@gmail.com>
-[Gustavo: adapt to binutils 2.25]
-Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
-Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
-
-Upstream-Status: Inappropriate [distribution: codesourcery]
-
-Patch originally created by Mark Hatle, forward-ported to
-binutils 2.21 by Scott Garman.
-
-purpose: warn for uses of system directories when cross linking
-
-Code Merged from Sourcery G++ binutils 2.19 - 4.4-277
-
-2008-07-02 Joseph Myers <joseph@codesourcery.com>
-
- ld/
- * ld.h (args_type): Add error_poison_system_directories.
- * ld.texinfo (--error-poison-system-directories): Document.
- * ldfile.c (ldfile_add_library_path): Check
- command_line.error_poison_system_directories.
- * ldmain.c (main): Initialize
- command_line.error_poison_system_directories.
- * lexsup.c (enum option_values): Add
- OPTION_ERROR_POISON_SYSTEM_DIRECTORIES.
- (ld_options): Add --error-poison-system-directories.
- (parse_args): Handle new option.
-
-2007-06-13 Joseph Myers <joseph@codesourcery.com>
-
- ld/
- * config.in: Regenerate.
- * ld.h (args_type): Add poison_system_directories.
- * ld.texinfo (--no-poison-system-directories): Document.
- * ldfile.c (ldfile_add_library_path): Check
- command_line.poison_system_directories.
- * ldmain.c (main): Initialize
- command_line.poison_system_directories.
- * lexsup.c (enum option_values): Add
- OPTION_NO_POISON_SYSTEM_DIRECTORIES.
- (ld_options): Add --no-poison-system-directories.
- (parse_args): Handle new option.
-
-2007-04-20 Joseph Myers <joseph@codesourcery.com>
-
- Merge from Sourcery G++ binutils 2.17:
-
- 2007-03-20 Joseph Myers <joseph@codesourcery.com>
- Based on patch by Mark Hatle <mark.hatle@windriver.com>.
- ld/
- * configure.ac (--enable-poison-system-directories): New option.
- * configure, config.in: Regenerate.
- * ldfile.c (ldfile_add_library_path): If
- ENABLE_POISON_SYSTEM_DIRECTORIES defined, warn for use of /lib,
- /usr/lib, /usr/local/lib or /usr/X11R6/lib.
-
-Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
-Signed-off-by: Scott Garman <scott.a.garman@intel.com>
----
- ld/config.in | 3 +++
- ld/configure | 14 ++++++++++++++
- ld/configure.ac | 10 ++++++++++
- ld/ld.h | 8 ++++++++
- ld/ld.texi | 12 ++++++++++++
- ld/ldfile.c | 17 +++++++++++++++++
- ld/ldlex.h | 2 ++
- ld/ldmain.c | 2 ++
- ld/lexsup.c | 21 +++++++++++++++++++++
- 9 files changed, 89 insertions(+)
-
-diff --git a/ld/config.in b/ld/config.in
-index d93c9b08300..5da2742beac 100644
---- a/ld/config.in
-+++ b/ld/config.in
-@@ -31,6 +31,9 @@
- language is requested. */
- #undef ENABLE_NLS
-
-+/* Define to warn for use of native system library directories */
-+#undef ENABLE_POISON_SYSTEM_DIRECTORIES
-+
- /* Additional extension a shared object might have. */
- #undef EXTRA_SHLIB_EXTENSION
-
-diff --git a/ld/configure b/ld/configure
-index 2d6ca5c0445..563f9921f7f 100755
---- a/ld/configure
-+++ b/ld/configure
-@@ -823,6 +823,7 @@ with_lib_path
- enable_targets
- enable_64_bit_bfd
- with_sysroot
-+enable_poison_system_directories
- enable_gold
- enable_got
- enable_compressed_debug_sections
-@@ -1487,6 +1488,8 @@ Optional Features:
- --disable-largefile omit support for large files
- --enable-targets alternative target configurations
- --enable-64-bit-bfd 64-bit support (on hosts with narrower word sizes)
-+ --enable-poison-system-directories
-+ warn for use of native system library directories
- --enable-gold[=ARG] build gold [ARG={default,yes,no}]
- --enable-got=<type> GOT handling scheme (target, single, negative,
- multigot)
-@@ -15804,7 +15807,18 @@ else
- fi
-
-
-+# Check whether --enable-poison-system-directories was given.
-+if test "${enable_poison_system_directories+set}" = set; then :
-+ enableval=$enable_poison_system_directories;
-+else
-+ enable_poison_system_directories=no
-+fi
-+
-+if test "x${enable_poison_system_directories}" = "xyes"; then
-
-+$as_echo "#define ENABLE_POISON_SYSTEM_DIRECTORIES 1" >>confdefs.h
-+
-+fi
-
- # Check whether --enable-got was given.
- if test "${enable_got+set}" = set; then :
-diff --git a/ld/configure.ac b/ld/configure.ac
-index 41a51bbb7e9..dbaa98a9e17 100644
---- a/ld/configure.ac
-+++ b/ld/configure.ac
-@@ -94,6 +94,16 @@ AC_SUBST(use_sysroot)
- AC_SUBST(TARGET_SYSTEM_ROOT)
- AC_SUBST(TARGET_SYSTEM_ROOT_DEFINE)
-
-+AC_ARG_ENABLE([poison-system-directories],
-+ AS_HELP_STRING([--enable-poison-system-directories],
-+ [warn for use of native system library directories]),,
-+ [enable_poison_system_directories=no])
-+if test "x${enable_poison_system_directories}" = "xyes"; then
-+ AC_DEFINE([ENABLE_POISON_SYSTEM_DIRECTORIES],
-+ [1],
-+ [Define to warn for use of native system library directories])
-+fi
-+
- dnl Use --enable-gold to decide if this linker should be the default.
- dnl "install_as_default" is set to false if gold is the default linker.
- dnl "installed_linker" is the installed BFD linker name.
-diff --git a/ld/ld.h b/ld/ld.h
-index 55078a9637b..511e9bc34b7 100644
---- a/ld/ld.h
-+++ b/ld/ld.h
-@@ -180,6 +180,14 @@ typedef struct
- in the linker script. */
- bfd_boolean force_group_allocation;
-
-+ /* If TRUE (the default) warn for uses of system directories when
-+ cross linking. */
-+ bfd_boolean poison_system_directories;
-+
-+ /* If TRUE (default FALSE) give an error for uses of system
-+ directories when cross linking instead of a warning. */
-+ bfd_boolean error_poison_system_directories;
-+
- /* Big or little endian as set on command line. */
- enum endian_enum endian;
-
-diff --git a/ld/ld.texi b/ld/ld.texi
-index fcbc335c95e..6ba7ebdb32a 100644
---- a/ld/ld.texi
-+++ b/ld/ld.texi
-@@ -2557,6 +2557,18 @@ string identifying the original linked file does not change.
-
- Passing @code{none} for @var{style} disables the setting from any
- @code{--build-id} options earlier on the command line.
-+
-+@kindex --no-poison-system-directories
-+@item --no-poison-system-directories
-+Do not warn for @option{-L} options using system directories such as
-+@file{/usr/lib} when cross linking. This option is intended for use
-+in chroot environments when such directories contain the correct
-+libraries for the target system rather than the host.
-+
-+@kindex --error-poison-system-directories
-+@item --error-poison-system-directories
-+Give an error instead of a warning for @option{-L} options using
-+system directories when cross linking.
- @end table
-
- @c man end
-diff --git a/ld/ldfile.c b/ld/ldfile.c
-index 7f60319390e..0bcc06db964 100644
---- a/ld/ldfile.c
-+++ b/ld/ldfile.c
-@@ -116,6 +116,23 @@ ldfile_add_library_path (const char *name, bfd_boolean cmdline)
- new_dirs->name = concat (ld_sysroot, name + strlen ("$SYSROOT"), (const char *) NULL);
- else
- new_dirs->name = xstrdup (name);
-+
-+#ifdef ENABLE_POISON_SYSTEM_DIRECTORIES
-+ if (command_line.poison_system_directories
-+ && ((!strncmp (name, "/lib", 4))
-+ || (!strncmp (name, "/usr/lib", 8))
-+ || (!strncmp (name, "/usr/local/lib", 14))
-+ || (!strncmp (name, "/usr/X11R6/lib", 14))))
-+ {
-+ if (command_line.error_poison_system_directories)
-+ einfo (_("%X%P: error: library search path \"%s\" is unsafe for "
-+ "cross-compilation\n"), name);
-+ else
-+ einfo (_("%P: warning: library search path \"%s\" is unsafe for "
-+ "cross-compilation\n"), name);
-+ }
-+#endif
-+
- }
-
- /* Try to open a BFD for a lang_input_statement. */
-diff --git a/ld/ldlex.h b/ld/ldlex.h
-index 32a7a6409e8..c02b64bf92f 100644
---- a/ld/ldlex.h
-+++ b/ld/ldlex.h
-@@ -150,6 +150,8 @@ enum option_values
- OPTION_FORCE_GROUP_ALLOCATION,
- OPTION_PRINT_MAP_DISCARDED,
- OPTION_NO_PRINT_MAP_DISCARDED,
-+ OPTION_NO_POISON_SYSTEM_DIRECTORIES,
-+ OPTION_ERROR_POISON_SYSTEM_DIRECTORIES,
- };
-
- /* The initial parser states. */
-diff --git a/ld/ldmain.c b/ld/ldmain.c
-index 34c19223137..66d2c3f4bcf 100644
---- a/ld/ldmain.c
-+++ b/ld/ldmain.c
-@@ -270,6 +270,8 @@ main (int argc, char **argv)
- command_line.warn_mismatch = TRUE;
- command_line.warn_search_mismatch = TRUE;
- command_line.check_section_addresses = -1;
-+ command_line.poison_system_directories = TRUE;
-+ command_line.error_poison_system_directories = FALSE;
-
- /* We initialize DEMANGLING based on the environment variable
- COLLECT_NO_DEMANGLE. The gcc collect2 program will demangle the
-diff --git a/ld/lexsup.c b/ld/lexsup.c
-index 1c15ac29c0c..8b714e10a40 100644
---- a/ld/lexsup.c
-+++ b/ld/lexsup.c
-@@ -549,6 +549,14 @@ static const struct ld_option ld_options[] =
- { {"no-print-map-discarded", no_argument, NULL, OPTION_NO_PRINT_MAP_DISCARDED},
- '\0', NULL, N_("Do not show discarded sections in map file output"),
- TWO_DASHES },
-+ { {"no-poison-system-directories", no_argument, NULL,
-+ OPTION_NO_POISON_SYSTEM_DIRECTORIES},
-+ '\0', NULL, N_("Do not warn for -L options using system directories"),
-+ TWO_DASHES },
-+ { {"error-poison-system-directories", no_argument, NULL,
-+ OPTION_ERROR_POISON_SYSTEM_DIRECTORIES},
-+ '\0', NULL, N_("Give an error for -L options using system directories"),
-+ TWO_DASHES },
- };
-
- #define OPTION_COUNT ARRAY_SIZE (ld_options)
-@@ -561,6 +569,7 @@ parse_args (unsigned argc, char **argv)
- int ingroup = 0;
- char *default_dirlist = NULL;
- char *shortopts;
-+ char *BR_paranoid_env;
- struct option *longopts;
- struct option *really_longopts;
- int last_optind;
-@@ -1549,6 +1558,14 @@ parse_args (unsigned argc, char **argv)
- }
- break;
-
-+ case OPTION_NO_POISON_SYSTEM_DIRECTORIES:
-+ command_line.poison_system_directories = FALSE;
-+ break;
-+
-+ case OPTION_ERROR_POISON_SYSTEM_DIRECTORIES:
-+ command_line.error_poison_system_directories = TRUE;
-+ break;
-+
- case OPTION_PUSH_STATE:
- input_flags.pushed = xmemdup (&input_flags,
- sizeof (input_flags),
-@@ -1600,6 +1617,10 @@ parse_args (unsigned argc, char **argv)
- command_line.soname = NULL;
- }
-
-+ BR_paranoid_env = getenv("BR_COMPILER_PARANOID_UNSAFE_PATH");
-+ if (BR_paranoid_env && strlen(BR_paranoid_env) > 0)
-+ command_line.error_poison_system_directories = TRUE;
-+
- while (ingroup)
- {
- einfo (_("%P: missing --end-group; added as last command line option\n"));
---
-2.16.2
-
+++ /dev/null
-From 0bd0ecc386b82ce4b61dc64fe6cdd6a851acc866 Mon Sep 17 00:00:00 2001
-From: Claudiu Zissulescu <claziss@gmail.com>
-Date: Thu, 31 Oct 2019 10:39:07 +0100
-Subject: [PATCH] Revert "[ARC] Check UNDEFWEAK_NO_DYNAMIC_RELOC"
-
-Gives errors when -fPIE used.
-
-Signed-off-by: Claudiu Zissulescu <claziss@synopsys.com>
-
-This reverts commit 1823527532407648f3061b130c55f2138496b2aa.
----
- bfd/elf32-arc.c | 120 +++++++++++++------------------
- ld/testsuite/ld-arc/weakhid.s | 13 ----
- ld/testsuite/ld-arc/weakhiddso.d | 29 --------
- 3 files changed, 50 insertions(+), 112 deletions(-)
- delete mode 100644 ld/testsuite/ld-arc/weakhid.s
- delete mode 100644 ld/testsuite/ld-arc/weakhiddso.d
-
-diff --git a/bfd/elf32-arc.c b/bfd/elf32-arc.c
-index b92b0b7501a..e9463bea04f 100644
---- a/bfd/elf32-arc.c
-+++ b/bfd/elf32-arc.c
-@@ -1462,7 +1462,6 @@ elf_arc_relocate_section (bfd * output_bfd,
- struct elf_link_hash_entry * h2;
- const char * msg;
- bfd_boolean unresolved_reloc = FALSE;
-- bfd_boolean resolved_to_zero;
-
- struct arc_relocation_data reloc_data =
- {
-@@ -1604,8 +1603,6 @@ elf_arc_relocate_section (bfd * output_bfd,
- continue;
- }
-
-- resolved_to_zero = (h != NULL && UNDEFWEAK_NO_DYNAMIC_RELOC (info, h));
--
- if (r_symndx < symtab_hdr->sh_info) /* A local symbol. */
- {
- reloc_data.sym_value = sym->st_value;
-@@ -1714,8 +1711,7 @@ elf_arc_relocate_section (bfd * output_bfd,
- reloc_data.sym_section = htab->splt;
- reloc_data.should_relocate = TRUE;
- }
-- /* See pr22269. */
-- else if (!resolved_to_zero)
-+ else
- continue;
- }
- else
-@@ -1787,26 +1783,24 @@ elf_arc_relocate_section (bfd * output_bfd,
-
- switch (r_type)
- {
-- case R_ARC_32:
-- case R_ARC_32_ME:
-- case R_ARC_PC32:
-- case R_ARC_32_PCREL:
-- if (bfd_link_pic (info)
-- && !resolved_to_zero
-- && (input_section->flags & SEC_ALLOC) != 0
-- && (!IS_ARC_PCREL_TYPE (r_type)
-- || (h != NULL
-- && h->dynindx != -1
-- && !h->def_regular
-- && (!info->symbolic || !h->def_regular))))
-- {
-- Elf_Internal_Rela outrel;
-- bfd_byte *loc;
-- bfd_boolean skip = FALSE;
-- bfd_boolean relocate = FALSE;
-- asection *sreloc = _bfd_elf_get_dynamic_reloc_section
-- (input_bfd, input_section,
-- /*RELA*/ TRUE);
-+ case R_ARC_32:
-+ case R_ARC_32_ME:
-+ case R_ARC_PC32:
-+ case R_ARC_32_PCREL:
-+ if (bfd_link_pic (info)
-+ && (!IS_ARC_PCREL_TYPE (r_type)
-+ || (h != NULL
-+ && h->dynindx != -1
-+ && !h->def_regular
-+ && (!info->symbolic || !h->def_regular))))
-+ {
-+ Elf_Internal_Rela outrel;
-+ bfd_byte *loc;
-+ bfd_boolean skip = FALSE;
-+ bfd_boolean relocate = FALSE;
-+ asection *sreloc = _bfd_elf_get_dynamic_reloc_section
-+ (input_bfd, input_section,
-+ /*RELA*/ TRUE);
-
- BFD_ASSERT (sreloc != NULL);
-
-@@ -2009,8 +2003,6 @@ elf_arc_check_relocs (bfd * abfd,
-
- switch (r_type)
- {
-- case R_ARC_8:
-- case R_ARC_16:
- case R_ARC_32:
- case R_ARC_32_ME:
- /* During shared library creation, these relocs should not
-@@ -2041,51 +2033,39 @@ elf_arc_check_relocs (bfd * abfd,
- return FALSE;
- }
-
-- /* In some cases we are not setting the 'non_got_ref' flag,
-- even though the relocations don't require a GOT access.
-- We should extend the testing in this area to ensure that
-- no significant cases are being missed. */
-- if (h)
-- h->non_got_ref = 1;
--
-- /* We don't need to handle relocs into sections not going
-- into the "real" output. */
-- if ((sec->flags & SEC_ALLOC) == 0)
-- break;
-+ /* In some cases we are not setting the 'non_got_ref'
-+ flag, even though the relocations don't require a GOT
-+ access. We should extend the testing in this area to
-+ ensure that no significant cases are being missed. */
-+ if (h)
-+ h->non_got_ref = 1;
-+ /* FALLTHROUGH */
-+ case R_ARC_PC32:
-+ case R_ARC_32_PCREL:
-+ if ((bfd_link_pic (info))
-+ && ((r_type != R_ARC_PC32 && r_type != R_ARC_32_PCREL)
-+ || (h != NULL
-+ && (!info->symbolic || !h->def_regular))))
-+ {
-+ if (sreloc == NULL)
-+ {
-+ if (info->dynamic
-+ && ! htab->dynamic_sections_created
-+ && ! _bfd_elf_link_create_dynamic_sections (abfd, info))
-+ return FALSE;
-+ sreloc = _bfd_elf_make_dynamic_reloc_section (sec, dynobj,
-+ 2, abfd,
-+ /*rela*/
-+ TRUE);
-+
-+ if (sreloc == NULL)
-+ return FALSE;
-+ }
-+ sreloc->size += sizeof (Elf32_External_Rela);
-
-- /* No need to do anything if we're not creating a shared
-- object. */
-- if (!bfd_link_pic (info)
-- || (h != NULL
-- && UNDEFWEAK_NO_DYNAMIC_RELOC (info, h)))
-+ }
-+ default:
- break;
--
-- /* FALLTHROUGH */
-- case R_ARC_PC32:
-- case R_ARC_32_PCREL:
-- if ((bfd_link_pic (info))
-- && ((r_type != R_ARC_PC32 && r_type != R_ARC_32_PCREL)
-- || (h != NULL
-- && (!info->symbolic || !h->def_regular))))
-- {
-- if (sreloc == NULL)
-- {
-- if (info->dynamic
-- && ! htab->dynamic_sections_created
-- && ! _bfd_elf_link_create_dynamic_sections (abfd, info))
-- return FALSE;
-- sreloc = _bfd_elf_make_dynamic_reloc_section (sec, dynobj,
-- 2, abfd,
-- /*rela*/
-- TRUE);
--
-- if (sreloc == NULL)
-- return FALSE;
-- }
-- sreloc->size += sizeof (Elf32_External_Rela);
-- }
-- default:
-- break;
- }
-
- if (is_reloc_for_PLT (howto))
-diff --git a/ld/testsuite/ld-arc/weakhid.s b/ld/testsuite/ld-arc/weakhid.s
-deleted file mode 100644
-index a8c87da1a2d..00000000000
---- a/ld/testsuite/ld-arc/weakhid.s
-+++ /dev/null
-@@ -1,13 +0,0 @@
-- .weak xweakobj
-- .weak xweakhidobj
-- .hidden xweakhidobj
--
-- .data
-- .global x
-- .type x,@object
--x:
-- .word xweakhidobj
-- .word xweakobj
-- .word xregobj
--.Lfe1:
-- .size x,.Lfe1-x
-diff --git a/ld/testsuite/ld-arc/weakhiddso.d b/ld/testsuite/ld-arc/weakhiddso.d
-deleted file mode 100644
-index f52f27fc048..00000000000
---- a/ld/testsuite/ld-arc/weakhiddso.d
-+++ /dev/null
-@@ -1,29 +0,0 @@
--#source: weakhid.s
--#ld: --shared -m arclinux -z nocombreloc --hash-style=sysv
--#objdump: -s -R -T
--
--# Check that .weak and .weak .hidden object references are handled
--# correctly when generating a DSO. Copied from CRIS port.
--
--.*: +file format .*arc.*
--
--DYNAMIC SYMBOL TABLE:
--0+2208 l d \.data 0+ \.data
--0+2208 g DO \.data 0+c x
--0+ D \*UND\* 0+ xregobj
--0+2214 g D \.data 0+ __bss_start
--0+ w D \*UND\* 0+ xweakobj
--0+2214 g D \.data 0+ _edata
--0+2214 g D \.data 0+ _end
--
--
--DYNAMIC RELOCATION RECORDS
--OFFSET TYPE VALUE
--0+2210 R_ARC_32 +xregobj
--0+ R_ARC_NONE +\*ABS\*
--
--Contents of section \.hash:
--#...
--Contents of section \.data:
-- 2208 00000000 00000000 00000000 .*
--#...
-\ No newline at end of file
---
-2.17.2
-
--- /dev/null
+From 5f62ad7ce534e3384d6ed8892614979da297bd70 Mon Sep 17 00:00:00 2001
+From: Evgeniy Didin <Evgeniy.Didin@synopsys.com>
+Date: Mon, 14 Oct 2019 16:45:15 +0300
+Subject: [PATCH] [PATCH] poison-system-directories
+
+Patch adapted to arc-binutils-gdb-2019.09
+Signed-off-by: Evgeniy Didin <Evgeniy.Didin@synopsys.com>
+
+Patch adapted to binutils 2.23.2 and extended to use
+BR_COMPILER_PARANOID_UNSAFE_PATH by Thomas Petazzoni.
+
+[Romain: rebase on top of 2.26]
+Signed-off-by: Romain Naour <romain.naour@gmail.com>
+[Gustavo: adapt to binutils 2.25]
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
+
+Upstream-Status: Inappropriate [distribution: codesourcery]
+
+Patch originally created by Mark Hatle, forward-ported to
+binutils 2.21 by Scott Garman.
+
+purpose: warn for uses of system directories when cross linking
+
+Code Merged from Sourcery G++ binutils 2.19 - 4.4-277
+
+2008-07-02 Joseph Myers <joseph@codesourcery.com>
+
+ ld/
+ * ld.h (args_type): Add error_poison_system_directories.
+ * ld.texinfo (--error-poison-system-directories): Document.
+ * ldfile.c (ldfile_add_library_path): Check
+ command_line.error_poison_system_directories.
+ * ldmain.c (main): Initialize
+ command_line.error_poison_system_directories.
+ * lexsup.c (enum option_values): Add
+ OPTION_ERROR_POISON_SYSTEM_DIRECTORIES.
+ (ld_options): Add --error-poison-system-directories.
+ (parse_args): Handle new option.
+
+2007-06-13 Joseph Myers <joseph@codesourcery.com>
+
+ ld/
+ * config.in: Regenerate.
+ * ld.h (args_type): Add poison_system_directories.
+ * ld.texinfo (--no-poison-system-directories): Document.
+ * ldfile.c (ldfile_add_library_path): Check
+ command_line.poison_system_directories.
+ * ldmain.c (main): Initialize
+ command_line.poison_system_directories.
+ * lexsup.c (enum option_values): Add
+ OPTION_NO_POISON_SYSTEM_DIRECTORIES.
+ (ld_options): Add --no-poison-system-directories.
+ (parse_args): Handle new option.
+
+2007-04-20 Joseph Myers <joseph@codesourcery.com>
+
+ Merge from Sourcery G++ binutils 2.17:
+
+ 2007-03-20 Joseph Myers <joseph@codesourcery.com>
+ Based on patch by Mark Hatle <mark.hatle@windriver.com>.
+ ld/
+ * configure.ac (--enable-poison-system-directories): New option.
+ * configure, config.in: Regenerate.
+ * ldfile.c (ldfile_add_library_path): If
+ ENABLE_POISON_SYSTEM_DIRECTORIES defined, warn for use of /lib,
+ /usr/lib, /usr/local/lib or /usr/X11R6/lib.
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+---
+ ld/config.in | 3 +++
+ ld/configure | 14 ++++++++++++++
+ ld/configure.ac | 10 ++++++++++
+ ld/ld.h | 8 ++++++++
+ ld/ld.texi | 12 ++++++++++++
+ ld/ldfile.c | 17 +++++++++++++++++
+ ld/ldlex.h | 2 ++
+ ld/ldmain.c | 2 ++
+ ld/lexsup.c | 21 +++++++++++++++++++++
+ 9 files changed, 89 insertions(+)
+
+diff --git a/ld/config.in b/ld/config.in
+index d93c9b08300..5da2742beac 100644
+--- a/ld/config.in
++++ b/ld/config.in
+@@ -31,6 +31,9 @@
+ language is requested. */
+ #undef ENABLE_NLS
+
++/* Define to warn for use of native system library directories */
++#undef ENABLE_POISON_SYSTEM_DIRECTORIES
++
+ /* Additional extension a shared object might have. */
+ #undef EXTRA_SHLIB_EXTENSION
+
+diff --git a/ld/configure b/ld/configure
+index 2d6ca5c0445..563f9921f7f 100755
+--- a/ld/configure
++++ b/ld/configure
+@@ -823,6 +823,7 @@ with_lib_path
+ enable_targets
+ enable_64_bit_bfd
+ with_sysroot
++enable_poison_system_directories
+ enable_gold
+ enable_got
+ enable_compressed_debug_sections
+@@ -1487,6 +1488,8 @@ Optional Features:
+ --disable-largefile omit support for large files
+ --enable-targets alternative target configurations
+ --enable-64-bit-bfd 64-bit support (on hosts with narrower word sizes)
++ --enable-poison-system-directories
++ warn for use of native system library directories
+ --enable-gold[=ARG] build gold [ARG={default,yes,no}]
+ --enable-got=<type> GOT handling scheme (target, single, negative,
+ multigot)
+@@ -15804,7 +15807,18 @@ else
+ fi
+
+
++# Check whether --enable-poison-system-directories was given.
++if test "${enable_poison_system_directories+set}" = set; then :
++ enableval=$enable_poison_system_directories;
++else
++ enable_poison_system_directories=no
++fi
++
++if test "x${enable_poison_system_directories}" = "xyes"; then
+
++$as_echo "#define ENABLE_POISON_SYSTEM_DIRECTORIES 1" >>confdefs.h
++
++fi
+
+ # Check whether --enable-got was given.
+ if test "${enable_got+set}" = set; then :
+diff --git a/ld/configure.ac b/ld/configure.ac
+index 41a51bbb7e9..dbaa98a9e17 100644
+--- a/ld/configure.ac
++++ b/ld/configure.ac
+@@ -94,6 +94,16 @@ AC_SUBST(use_sysroot)
+ AC_SUBST(TARGET_SYSTEM_ROOT)
+ AC_SUBST(TARGET_SYSTEM_ROOT_DEFINE)
+
++AC_ARG_ENABLE([poison-system-directories],
++ AS_HELP_STRING([--enable-poison-system-directories],
++ [warn for use of native system library directories]),,
++ [enable_poison_system_directories=no])
++if test "x${enable_poison_system_directories}" = "xyes"; then
++ AC_DEFINE([ENABLE_POISON_SYSTEM_DIRECTORIES],
++ [1],
++ [Define to warn for use of native system library directories])
++fi
++
+ dnl Use --enable-gold to decide if this linker should be the default.
+ dnl "install_as_default" is set to false if gold is the default linker.
+ dnl "installed_linker" is the installed BFD linker name.
+diff --git a/ld/ld.h b/ld/ld.h
+index 55078a9637b..511e9bc34b7 100644
+--- a/ld/ld.h
++++ b/ld/ld.h
+@@ -180,6 +180,14 @@ typedef struct
+ in the linker script. */
+ bfd_boolean force_group_allocation;
+
++ /* If TRUE (the default) warn for uses of system directories when
++ cross linking. */
++ bfd_boolean poison_system_directories;
++
++ /* If TRUE (default FALSE) give an error for uses of system
++ directories when cross linking instead of a warning. */
++ bfd_boolean error_poison_system_directories;
++
+ /* Big or little endian as set on command line. */
+ enum endian_enum endian;
+
+diff --git a/ld/ld.texi b/ld/ld.texi
+index fcbc335c95e..6ba7ebdb32a 100644
+--- a/ld/ld.texi
++++ b/ld/ld.texi
+@@ -2557,6 +2557,18 @@ string identifying the original linked file does not change.
+
+ Passing @code{none} for @var{style} disables the setting from any
+ @code{--build-id} options earlier on the command line.
++
++@kindex --no-poison-system-directories
++@item --no-poison-system-directories
++Do not warn for @option{-L} options using system directories such as
++@file{/usr/lib} when cross linking. This option is intended for use
++in chroot environments when such directories contain the correct
++libraries for the target system rather than the host.
++
++@kindex --error-poison-system-directories
++@item --error-poison-system-directories
++Give an error instead of a warning for @option{-L} options using
++system directories when cross linking.
+ @end table
+
+ @c man end
+diff --git a/ld/ldfile.c b/ld/ldfile.c
+index 7f60319390e..0bcc06db964 100644
+--- a/ld/ldfile.c
++++ b/ld/ldfile.c
+@@ -116,6 +116,23 @@ ldfile_add_library_path (const char *name, bfd_boolean cmdline)
+ new_dirs->name = concat (ld_sysroot, name + strlen ("$SYSROOT"), (const char *) NULL);
+ else
+ new_dirs->name = xstrdup (name);
++
++#ifdef ENABLE_POISON_SYSTEM_DIRECTORIES
++ if (command_line.poison_system_directories
++ && ((!strncmp (name, "/lib", 4))
++ || (!strncmp (name, "/usr/lib", 8))
++ || (!strncmp (name, "/usr/local/lib", 14))
++ || (!strncmp (name, "/usr/X11R6/lib", 14))))
++ {
++ if (command_line.error_poison_system_directories)
++ einfo (_("%X%P: error: library search path \"%s\" is unsafe for "
++ "cross-compilation\n"), name);
++ else
++ einfo (_("%P: warning: library search path \"%s\" is unsafe for "
++ "cross-compilation\n"), name);
++ }
++#endif
++
+ }
+
+ /* Try to open a BFD for a lang_input_statement. */
+diff --git a/ld/ldlex.h b/ld/ldlex.h
+index 32a7a6409e8..c02b64bf92f 100644
+--- a/ld/ldlex.h
++++ b/ld/ldlex.h
+@@ -150,6 +150,8 @@ enum option_values
+ OPTION_FORCE_GROUP_ALLOCATION,
+ OPTION_PRINT_MAP_DISCARDED,
+ OPTION_NO_PRINT_MAP_DISCARDED,
++ OPTION_NO_POISON_SYSTEM_DIRECTORIES,
++ OPTION_ERROR_POISON_SYSTEM_DIRECTORIES,
+ };
+
+ /* The initial parser states. */
+diff --git a/ld/ldmain.c b/ld/ldmain.c
+index 34c19223137..66d2c3f4bcf 100644
+--- a/ld/ldmain.c
++++ b/ld/ldmain.c
+@@ -270,6 +270,8 @@ main (int argc, char **argv)
+ command_line.warn_mismatch = TRUE;
+ command_line.warn_search_mismatch = TRUE;
+ command_line.check_section_addresses = -1;
++ command_line.poison_system_directories = TRUE;
++ command_line.error_poison_system_directories = FALSE;
+
+ /* We initialize DEMANGLING based on the environment variable
+ COLLECT_NO_DEMANGLE. The gcc collect2 program will demangle the
+diff --git a/ld/lexsup.c b/ld/lexsup.c
+index 1c15ac29c0c..8b714e10a40 100644
+--- a/ld/lexsup.c
++++ b/ld/lexsup.c
+@@ -549,6 +549,14 @@ static const struct ld_option ld_options[] =
+ { {"no-print-map-discarded", no_argument, NULL, OPTION_NO_PRINT_MAP_DISCARDED},
+ '\0', NULL, N_("Do not show discarded sections in map file output"),
+ TWO_DASHES },
++ { {"no-poison-system-directories", no_argument, NULL,
++ OPTION_NO_POISON_SYSTEM_DIRECTORIES},
++ '\0', NULL, N_("Do not warn for -L options using system directories"),
++ TWO_DASHES },
++ { {"error-poison-system-directories", no_argument, NULL,
++ OPTION_ERROR_POISON_SYSTEM_DIRECTORIES},
++ '\0', NULL, N_("Give an error for -L options using system directories"),
++ TWO_DASHES },
+ };
+
+ #define OPTION_COUNT ARRAY_SIZE (ld_options)
+@@ -561,6 +569,7 @@ parse_args (unsigned argc, char **argv)
+ int ingroup = 0;
+ char *default_dirlist = NULL;
+ char *shortopts;
++ char *BR_paranoid_env;
+ struct option *longopts;
+ struct option *really_longopts;
+ int last_optind;
+@@ -1549,6 +1558,14 @@ parse_args (unsigned argc, char **argv)
+ }
+ break;
+
++ case OPTION_NO_POISON_SYSTEM_DIRECTORIES:
++ command_line.poison_system_directories = FALSE;
++ break;
++
++ case OPTION_ERROR_POISON_SYSTEM_DIRECTORIES:
++ command_line.error_poison_system_directories = TRUE;
++ break;
++
+ case OPTION_PUSH_STATE:
+ input_flags.pushed = xmemdup (&input_flags,
+ sizeof (input_flags),
+@@ -1600,6 +1617,10 @@ parse_args (unsigned argc, char **argv)
+ command_line.soname = NULL;
+ }
+
++ BR_paranoid_env = getenv("BR_COMPILER_PARANOID_UNSAFE_PATH");
++ if (BR_paranoid_env && strlen(BR_paranoid_env) > 0)
++ command_line.error_poison_system_directories = TRUE;
++
+ while (ingroup)
+ {
+ einfo (_("%P: missing --end-group; added as last command line option\n"));
+--
+2.16.2
+
sha512 d326408f12a03d9a61a9de56584c2af12f81c2e50d2d7e835d51565df8314df01575724afa1e43bd0db45cfc9916b41519b67dfce03232aa4978704492a6994a binutils-2.32.tar.xz
# Locally calculated (fetched from Github)
-sha512 db6a0a855733a79ec71127b94981e6be63c4852dee5aed2bc9738da7d3c3796d88974e86ae9dc20cf28ea5e31897ddf8d68f695fcadfbdec1a8406b437d73df6 binutils-gdb-arc-2019.09-eng002.tar.gz
+sha512 3840770da5ede0248f6a6605e3f1743210acd9f4da7de48720ef566cc2aae52ea9e84c285a0a6d39eb15bd7ad197d543b6e407ec9e1a00739989e574d4e04384 binutils-gdb-arc-2019.09-rc1.tar.gz
# Locally calculated (fetched from https://github.com/c-sky/binutils-gdb)
sha512 979552d4b3a4f31e9f3b9a7027321bd4eb3ac6c2d8deac1720e94e54f81d736db09c53c5d87c301010e307b64127e14400a036c7a35e5d63a954a4edd9cc8e2c binutils-c66d8bbcebfddf713b2b436e1b135e6b125a55a5.tar.gz
BINUTILS_VERSION = $(call qstrip,$(BR2_BINUTILS_VERSION))
ifeq ($(BINUTILS_VERSION),)
ifeq ($(BR2_arc),y)
-BINUTILS_VERSION = arc-2019.09-eng002
+BINUTILS_VERSION = arc-2019.09-rc1
else
BINUTILS_VERSION = 2.31.1
endif
endif # BINUTILS_VERSION
-ifeq ($(BINUTILS_VERSION),arc-2019.09-eng002)
+ifeq ($(BINUTILS_VERSION),arc-2019.09-rc1)
BINUTILS_SITE = $(call github,foss-for-synopsys-dwc-arc-processors,binutils-gdb,$(BINUTILS_VERSION))
BINUTILS_SOURCE = binutils-gdb-$(BINUTILS_VERSION).tar.gz
BINUTILS_FROM_GIT = y
default "7.4.0" if BR2_GCC_VERSION_7_X
default "8.3.0" if BR2_GCC_VERSION_8_X
default "9.2.0" if BR2_GCC_VERSION_9_X
- default "arc-2019.09-eng002" if BR2_GCC_VERSION_ARC
+ default "arc-2019.09-rc1" if BR2_GCC_VERSION_ARC
default "or1k-musl-5.4.0-20170218" if BR2_GCC_VERSION_OR1K
default "48152afb96c59733d5bc79e3399bb7b3d4b44266" if BR2_GCC_VERSION_CSKY
+++ /dev/null
-From 326b880b20e5f8187dbda736b4c4c662cbfb00ca Mon Sep 17 00:00:00 2001
-From: Romain Naour <romain.naour@gmail.com>
-Date: Tue, 2 May 2017 22:36:15 +0200
-Subject: [PATCH] uclibc-conf
-
-[Romain: convert to git patch]
-Signed-off-by: Romain Naour <romain.naour@gmail.com>
----
- contrib/regression/objs-gcc.sh | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git a/contrib/regression/objs-gcc.sh b/contrib/regression/objs-gcc.sh
-index 60b0497..6dc7ead 100755
---- a/contrib/regression/objs-gcc.sh
-+++ b/contrib/regression/objs-gcc.sh
-@@ -106,6 +106,10 @@ if [ $H_REAL_TARGET = $H_REAL_HOST -a $H_REAL_TARGET = i686-pc-linux-gnu ]
- then
- make all-gdb all-dejagnu all-ld || exit 1
- make install-gdb install-dejagnu install-ld || exit 1
-+elif [ $H_REAL_TARGET = $H_REAL_HOST -a $H_REAL_TARGET = i686-pc-linux-uclibc ]
-+ then
-+ make all-gdb all-dejagnu all-ld || exit 1
-+ make install-gdb install-dejagnu install-ld || exit 1
- elif [ $H_REAL_TARGET = $H_REAL_HOST ] ; then
- make bootstrap || exit 1
- make install || exit 1
---
-2.9.3
-
--- /dev/null
+From 326b880b20e5f8187dbda736b4c4c662cbfb00ca Mon Sep 17 00:00:00 2001
+From: Romain Naour <romain.naour@gmail.com>
+Date: Tue, 2 May 2017 22:36:15 +0200
+Subject: [PATCH] uclibc-conf
+
+[Romain: convert to git patch]
+Signed-off-by: Romain Naour <romain.naour@gmail.com>
+---
+ contrib/regression/objs-gcc.sh | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/contrib/regression/objs-gcc.sh b/contrib/regression/objs-gcc.sh
+index 60b0497..6dc7ead 100755
+--- a/contrib/regression/objs-gcc.sh
++++ b/contrib/regression/objs-gcc.sh
+@@ -106,6 +106,10 @@ if [ $H_REAL_TARGET = $H_REAL_HOST -a $H_REAL_TARGET = i686-pc-linux-gnu ]
+ then
+ make all-gdb all-dejagnu all-ld || exit 1
+ make install-gdb install-dejagnu install-ld || exit 1
++elif [ $H_REAL_TARGET = $H_REAL_HOST -a $H_REAL_TARGET = i686-pc-linux-uclibc ]
++ then
++ make all-gdb all-dejagnu all-ld || exit 1
++ make install-gdb install-dejagnu install-ld || exit 1
+ elif [ $H_REAL_TARGET = $H_REAL_HOST ] ; then
+ make bootstrap || exit 1
+ make install || exit 1
+--
+2.9.3
+
sha512 a12dff52af876aee0fd89a8d09cdc455f35ec46845e154023202392adc164848faf8ee881b59b681b696e27c69fd143a214014db4214db62f9891a1c8365c040 gcc-9.2.0.tar.xz
# Locally calculated (fetched from Github)
-sha512 7ab8f8ffb79f0b7b69e87aa5692ba29e71478c9e2a4521ba57fcd818e25a20869025c8985a5e09f2f24483aa695881ba9aed4d2df0fc8c8129d791526156db93 gcc-arc-2019.09-eng002.tar.gz
+sha512 c478efba4a497875b2add3b1bf4261c187459e252d397ace40ca740e51ac96491defa78733aafcb2b03c8e2e423dd8c115761a5e74ef2386368d53730f3e45ba gcc-arc-2019.09-rc1.tar.gz
# Locally calculated (fetched from Github)
sha512 2de7cf47333a4092b02d3bb98f4206f14966f1d139a724d09cf3b22f8a43ae0c704f33e6477d6367a03c29b265480dc900169e9d417006c5d46f0ae446b8c6f1 gcc-or1k-musl-5.4.0-20170218.tar.gz
# Locally calculated (fetched from https://github.com/c-sky/gcc)
# If cross-gdb is not enabled, the latest working version is chosen.
config BR2_GDB_VERSION
string
- default "arc-2019.09-eng002-gdb" if BR2_arc
+ default "arc-2019.09-rc1-gdb" if BR2_arc
default "4ecb98fbc2f94dbe01b69384afbc515107de73df" if BR2_csky
default "8.1.1" if BR2_GDB_VERSION_8_1
default "8.2.1" if BR2_GDB_VERSION_8_2 || !BR2_PACKAGE_HOST_GDB
+++ /dev/null
-From e213d8e1b5317389c3beee648811bc649d62d743 Mon Sep 17 00:00:00 2001
-From: James Clarke <jrtc27@jrtc27.com>
-Date: Fri, 19 Jan 2018 17:22:49 +0000
-Subject: [PATCH] gdb: Fix ia64 defining TRAP_HWBKPT before including
- gdb_wait.h
-
-On ia64, gdb_wait.h eventually includes siginfo-consts-arch.h, which
-contains an enum with TRAP_HWBKPT, along with a #define. Thus we cannot
-define TRAP_HWBKPT to 4 beforehand, and so gdb_wait.h must be included
-earlier; include it from linux-ptrace.h so it can never come afterwards.
-
-gdb/ChangeLog:
-
- * nat/linux-ptrace.c: Remove unnecessary reinclusion of
- gdb_ptrace.h, and move including gdb_wait.h ...
- * nat/linux-ptrace.h: ... to here.
-
-[Backport from upstream 5a6c3296a7a90694ad4042f6256f3da6d4fa4ee8]
-Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
----
- gdb/nat/linux-ptrace.c | 2 --
- gdb/nat/linux-ptrace.h | 1 +
- 2 files changed, 1 insertion(+), 2 deletions(-)
-
-diff --git a/gdb/nat/linux-ptrace.c b/gdb/nat/linux-ptrace.c
-index 438177fa7622..1240eead0d50 100644
---- a/gdb/nat/linux-ptrace.c
-+++ b/gdb/nat/linux-ptrace.c
-@@ -21,8 +21,6 @@
- #include "linux-procfs.h"
- #include "linux-waitpid.h"
- #include "buffer.h"
--#include "gdb_wait.h"
--#include "gdb_ptrace.h"
- #ifdef HAVE_SYS_PROCFS_H
- #include <sys/procfs.h>
- #endif
-diff --git a/gdb/nat/linux-ptrace.h b/gdb/nat/linux-ptrace.h
-index 59549452c099..6faa89b22a0e 100644
---- a/gdb/nat/linux-ptrace.h
-+++ b/gdb/nat/linux-ptrace.h
-@@ -21,6 +21,7 @@
- struct buffer;
-
- #include "nat/gdb_ptrace.h"
-+#include "gdb_wait.h"
-
- #ifdef __UCLIBC__
- #if !(defined(__UCLIBC_HAS_MMU__) || defined(__ARCH_HAS_MMU__))
---
-2.19.2
-
sha512 47ac074d20a09a3fac8f4a41dce0a0cbe6ef702f7dc21ba8b7d650d306128dcae481e9a16bf65e596b3a541dc82ae57c02bcbb786d551b4ef3e2917b9b6f0ae1 gdb-8.3.tar.xz
# Locally calculated (fetched from Github)
-sha512 2625e568ec85652cc223409162b4bd97dd292c5f7a597a57ccb2c6c88a69dfc5fbcf1f0750716ab94c932fa97c8900732f7d2fec940973bc3d6c88ef3f8c6d26 gdb-arc-2019.09-eng002-gdb.tar.gz
+sha512 a2b83e949638fa27d3d2b971e3a77902050191d517c5b9ca1273d182b8c3b9da2c993a0dbaf76e18d2603e59a1af6618dff830a3905f22272af68fcbb49d58a8 gdb-arc-2019.09-rc1-gdb.tar.gz
# Locally calculated (fetched from https://github.com/c-sky/binutils-gdb)
sha512 c421e1f3c0d6cfb3c04544573c0c4b0075c8d8e3d563c6c234fcc1e4c2167ab203d1e57aec3b58abd348dc46f8cf9b47b753d3a43dba3ea970c9c9a6bd78c07b gdb-4ecb98fbc2f94dbe01b69384afbc515107de73df.tar.gz
+++ /dev/null
-# Locally calculated (fetched from Github)
-sha256 7ae8409c6e0649f21a9dccd55b0d84cb34ab69c1e95cb1bf807a0713bcf7a086 glibc-arc-2019.09-eng002.tar.gz
-
-# Hashes for license files
-sha256 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643 COPYING
-sha256 dc626520dcd53a22f727af3ee42c770e56c97a64fe3adb063799d8ab032fe551 COPYING.LIB
-sha256 35bdb41dc0bcb10702ddacbd51ec4c0fe6fb3129f734e8c85fc02e4d3eb0ce3f LICENSES
--- /dev/null
+# Locally calculated (fetched from Github)
+sha256 a9beeace7e2b4b25c6d253591b005975c50bf4ca1c0b6b38a24d89ac5a1458e1 glibc-arc-2019.09-rc1.tar.gz
+
+# Hashes for license files
+sha256 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643 COPYING
+sha256 dc626520dcd53a22f727af3ee42c770e56c97a64fe3adb063799d8ab032fe551 COPYING.LIB
+sha256 35bdb41dc0bcb10702ddacbd51ec4c0fe6fb3129f734e8c85fc02e4d3eb0ce3f LICENSES
################################################################################
ifeq ($(BR2_arc),y)
-GLIBC_VERSION = arc-2019.09-eng002
+GLIBC_VERSION = arc-2019.09-rc1
GLIBC_SITE = $(call github,foss-for-synopsys-dwc-arc-processors,glibc,$(GLIBC_VERSION))
else ifeq ($(BR2_RISCV_32),y)
GLIBC_VERSION = 06983fe52cfe8e4779035c27e8cc5d2caab31531