vapier 16/11/15 07:08:40
Added:
00_all_0001-ld-always-warn-about-textrels-in-files.patch
00_all_0002-gold-ld-add-support-for-poisoned-system-directories.patch
00_all_0003-ld-enable-new-dtags-by-default-for-linux-gnu-targets.patch
00_all_0004-gold-ld-enable-gnu-hash-by-default.patch
00_all_0005-libiberty-install-PIC-version-of-libiberty.a.patch
00_all_0006-opcodes-link-against-libbfd.la-for-rpath-deps.patch
README.history
Log:
initial 2.27 patchset based on last 2.26.1 patchset
Revision Changes Path
1.1
src/patchsets/binutils/2.27/00_all_0001-ld-always-warn-about-textrels-in-files.patch
file :
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/binutils/2.27/00_all_0001-ld-always-warn-about-textrels-in-files.patch?rev=1.1&view=markup
plain:
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/binutils/2.27/00_all_0001-ld-always-warn-about-textrels-in-files.patch?rev=1.1&content-type=text/plain
Index: 00_all_0001-ld-always-warn-about-textrels-in-files.patch
===================================================================
>From 3c2e0712f0c87fcb92904b30bc3a22d5f2467998 Mon Sep 17 00:00:00 2001
From: Mike Frysinger <[email protected]>
Date: Mon, 16 May 2005 22:10:19 -0400
Subject: [PATCH] ld: always warn about textrels in files
textrels are bad for forcing copy-on-write (this affects everyone), and for
security/runtime code generation, this affects security ppl. But in either
case, it doesn't matter who needs textrels, it's the very fact that they're
needed at all.
---
ld/ldmain.c | 1 +
ld/testsuite/lib/ld-lib.exp | 4 ++++
2 files changed, 5 insertions(+)
diff --git a/ld/ldmain.c b/ld/ldmain.c
index e7a8dff9d262..b03850b6fa17 100644
--- a/ld/ldmain.c
+++ b/ld/ldmain.c
@@ -281,6 +281,7 @@ main (int argc, char **argv)
link_info.dynamic_undefined_weak = -1;
link_info.pei386_auto_import = -1;
link_info.spare_dynamic_tags = 5;
+ link_info.warn_shared_textrel = TRUE;
link_info.path_separator = ':';
#ifdef DEFAULT_FLAG_COMPRESS_DEBUG
link_info.compress_debug = COMPRESS_DEBUG_GABI_ZLIB;
diff --git a/ld/testsuite/lib/ld-lib.exp b/ld/testsuite/lib/ld-lib.exp
index 62f97689ac5f..a9cd9f771d3d 100644
--- a/ld/testsuite/lib/ld-lib.exp
+++ b/ld/testsuite/lib/ld-lib.exp
@@ -247,6 +247,10 @@ proc default_ld_simple_link { ld target objects } {
# symbol, since the default linker script might use ENTRY.
regsub -all "(^|\n)(\[^\n\]*: warning: cannot find entry
symbol\[^\n\]*\n?)" $exec_output "\\1" exec_output
+ # Gentoo tweak:
+ # We want to ignore TEXTREL warnings since we force enable them by default
+ regsub -all "^lt-ld-new: warning: creating a DT_TEXTREL in object\."
$exec_output "\\1" exec_output
+
return [string match "" $exec_output]
}
--
2.10.2
1.1
src/patchsets/binutils/2.27/00_all_0002-gold-ld-add-support-for-poisoned-system-directories.patch
file :
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/binutils/2.27/00_all_0002-gold-ld-add-support-for-poisoned-system-directories.patch?rev=1.1&view=markup
plain:
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/binutils/2.27/00_all_0002-gold-ld-add-support-for-poisoned-system-directories.patch?rev=1.1&content-type=text/plain
Index: 00_all_0002-gold-ld-add-support-for-poisoned-system-directories.patch
===================================================================
>From 422cfb24cf9e0177fec70b71b38a1e01a4c2926c Mon Sep 17 00:00:00 2001
From: Mike Frysinger <[email protected]>
Date: Mon, 25 May 2015 04:42:58 -0400
Subject: [PATCH] gold/ld: add support for poisoned system directories
This is based on the old CodeSourcery patch written by Joseph Myers to add
support to the link for detecting & rejecting bad -L paths when using a
cross-compiler. The differences here:
* The command line flags are always available.
* We can turn on & off the warning via the command line.
* The configure option controls the default warning behavior.
* Add support for gold.
It is not currently upstream, nor has it been submitted at all. There are
no plans to do so currently either.
BUG=chromium:488360
TEST=`cbuildbot chromiumos-sdk` passes # tests arm/amd64/mipsel/x86
TEST=`cbuildbot panther_moblab-full whirlwind-release` pass
TEST=`cbuildbot {x32,arm64}-generic-full` has no new failures
TEST=x86_64-cros-linux-gnu-ld throws warnings when using -L/lib (gold & bfd)
Reviewed-on: https://chromium-review.googlesource.com/272083
---
gold/options.cc | 33 +++++++++++++++++++++++++++++++++
gold/options.h | 7 +++++++
ld/config.in | 3 +++
ld/configure | 14 ++++++++++++++
ld/configure.ac | 10 ++++++++++
ld/ld.h | 7 +++++++
ld/ld.texinfo | 18 ++++++++++++++++++
ld/ldfile.c | 20 ++++++++++++++++++++
ld/ldlex.h | 3 +++
ld/ldmain.c | 7 +++++++
ld/lexsup.c | 24 ++++++++++++++++++++++++
11 files changed, 146 insertions(+)
diff --git a/gold/options.cc b/gold/options.cc
index 99fb3b678179..d7e24e9d4651 100644
--- a/gold/options.cc
+++ b/gold/options.cc
@@ -1222,6 +1222,39 @@ General_options::finalize()
// in the path, as appropriate.
this->add_sysroot();
+ // Now check if library_path is poisoned.
+ if (this->warn_poison_system_directories())
+ {
+ std::vector<std::string> bad_paths;
+
+ bad_paths.push_back("/lib");
+ // TODO: This check is disabled for now due to a bunch of packages that
+ // use libtool and relink with -L/usr/lib paths (albeit after the right
+ // sysroot path). Once those are fixed we can enable.
+ // We also need to adjust it so it only rejects one or two levels deep.
+ // Gcc's internal paths also live below /usr/lib.
+ // http://crbug.com/488360
+ // bad_paths.push_back("/usr/lib");
+ bad_paths.push_back("/usr/local/lib");
+ bad_paths.push_back("/usr/X11R6/lib");
+
+ for (std::vector<std::string>::const_iterator b = bad_paths.begin();
+ b != bad_paths.end();
+ ++b)
+ for (Dir_list::iterator p = this->library_path_.value.begin();
+ p != this->library_path_.value.end();
+ ++p)
+ if (!p->name().compare(0, b->size(), *b))
+ {
+ if (this->error_poison_system_directories())
+ gold_fatal(_("library search path \"%s\" is unsafe for "
+ "cross-compilation"), p->name().c_str());
+ else
+ gold_warning(_("library search path \"%s\" is unsafe for "
+ "cross-compilation"), p->name().c_str());
+ }
+ }
+
// Now that we've normalized the options, check for contradictory ones.
if (this->shared() && this->is_static())
gold_fatal(_("-shared and -static are incompatible"));
diff --git a/gold/options.h b/gold/options.h
index 23c9658be3ae..860ac1056999 100644
--- a/gold/options.h
+++ b/gold/options.h
@@ -1223,6 +1223,13 @@ class General_options
DEFINE_bool(warn_multiple_gp, options::TWO_DASHES, '\0', false,
N_("Ignored"), NULL);
+ DEFINE_bool(warn_poison_system_directories, options::TWO_DASHES, '\0', false,
+ N_("Warn for -L options using system directories"),
+ N_("Do not warn for -L options using system directories"));
+ DEFINE_bool(error_poison_system_directories, options::TWO_DASHES, '\0',
false,
+ N_("Give an error for -L options using system directories"),
+ NULL);
+
DEFINE_bool(warn_search_mismatch, options::TWO_DASHES, '\0', true,
N_("Warn when skipping an incompatible library"),
N_("Don't warn when skipping an incompatible library"));
diff --git a/ld/config.in b/ld/config.in
index 2c6d698b6ce1..d3cb7e882de9 100644
--- a/ld/config.in
+++ b/ld/config.in
@@ -17,6 +17,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 c6f871dd4294..4535e7487e26 100755
--- a/ld/configure
+++ b/ld/configure
@@ -788,6 +788,7 @@ with_lib_path
enable_targets
enable_64_bit_bfd
with_sysroot
+enable_poison_system_directories
enable_gold
enable_got
enable_compressed_debug_sections
@@ -1445,6 +1446,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)
@@ -15498,7 +15501,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 d17281f0a0cb..9fb3db96b5f6 100644
--- a/ld/configure.ac
+++ b/ld/configure.ac
@@ -95,6 +95,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 85a48ad58d94..5ae1d303e6d3 100644
--- a/ld/ld.h
+++ b/ld/ld.h
@@ -169,6 +169,13 @@ typedef struct
/* If set, display the target memory usage (per memory region). */
bfd_boolean print_memory_usage;
+ /* If TRUE warn for uses of system directories when cross linking. */
+ bfd_boolean warn_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.texinfo b/ld/ld.texinfo
index bc16764b0554..030038c9058d 100644
--- a/ld/ld.texinfo
+++ b/ld/ld.texinfo
@@ -2357,6 +2357,24 @@ 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 --warn-poison-system-directories
+@item --warn-poison-system-directories
+Warn for @option{-L} options using system directories such as
+@file{/usr/lib} when cross linking. This option is intended for use
+in environments that want to detect and reject incorrect link settings.
+
+@kindex --no-warn-poison-system-directories
+@item --no-warn-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 e3977377b8d5..f0659a8d20c0 100644
--- a/ld/ldfile.c
+++ b/ld/ldfile.c
@@ -114,6 +114,26 @@ ldfile_add_library_path (const char *name, bfd_boolean
cmdline)
new_dirs->name = concat (ld_sysroot, name + 1, (const char *) NULL);
else
new_dirs->name = xstrdup (name);
+
+ if (command_line.warn_poison_system_directories
+ && (!strncmp (name, "/lib", 4)
+ /* TODO: This check is disabled for now due to a bunch of packages that
+ * use libtool and relink with -L/usr/lib paths (albeit after the right
+ * sysroot path). Once those are fixed we can enable.
+ * We also need to adjust it so it only rejects one or two levels deep.
+ * Gcc's internal paths also live below /usr/lib.
+ * http://crbug.com/488360 */
+ /* || !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);
+ }
}
/* Try to open a BFD for a lang_input_statement. */
diff --git a/ld/ldlex.h b/ld/ldlex.h
index cf943e425f9d..400383c5b75d 100644
--- a/ld/ldlex.h
+++ b/ld/ldlex.h
@@ -139,6 +139,9 @@ enum option_values
OPTION_PRINT_OUTPUT_FORMAT,
OPTION_PRINT_SYSROOT,
OPTION_IGNORE_UNRESOLVED_SYMBOL,
+ OPTION_WARN_POISON_SYSTEM_DIRECTORIES,
+ OPTION_NO_WARN_POISON_SYSTEM_DIRECTORIES,
+ OPTION_ERROR_POISON_SYSTEM_DIRECTORIES,
OPTION_PUSH_STATE,
OPTION_POP_STATE,
OPTION_PRINT_MEMORY_USAGE,
diff --git a/ld/ldmain.c b/ld/ldmain.c
index b03850b6fa17..303e54027eab 100644
--- a/ld/ldmain.c
+++ b/ld/ldmain.c
@@ -257,6 +257,13 @@ main (int argc, char **argv)
command_line.warn_mismatch = TRUE;
command_line.warn_search_mismatch = TRUE;
command_line.check_section_addresses = -1;
+ command_line.warn_poison_system_directories =
+#ifdef ENABLE_POISON_SYSTEM_DIRECTORIES
+ TRUE;
+#else
+ FALSE;
+#endif
+ 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 6d28e9142b09..b2ce1c3737bc 100644
--- a/ld/lexsup.c
+++ b/ld/lexsup.c
@@ -519,6 +519,18 @@ static const struct ld_option ld_options[] =
OPTION_IGNORE_UNRESOLVED_SYMBOL},
'\0', N_("SYMBOL"),
N_("Unresolved SYMBOL will not cause an error or warning"), TWO_DASHES },
+ { {"warn-poison-system-directories", no_argument, NULL,
+ OPTION_WARN_POISON_SYSTEM_DIRECTORIES},
+ '\0', NULL, N_("Warn for -L options using system directories"),
+ TWO_DASHES },
+ { {"no-warn-poison-system-directories", no_argument, NULL,
+ OPTION_NO_WARN_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 },
{ {"push-state", no_argument, NULL, OPTION_PUSH_STATE},
'\0', NULL, N_("Push state of flags governing input file handling"),
TWO_DASHES },
@@ -1516,6 +1528,18 @@ parse_args (unsigned argc, char **argv)
}
break;
+ case OPTION_WARN_POISON_SYSTEM_DIRECTORIES:
+ command_line.warn_poison_system_directories = TRUE;
+ break;
+
+ case OPTION_NO_WARN_POISON_SYSTEM_DIRECTORIES:
+ command_line.warn_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),
--
2.10.2
1.1
src/patchsets/binutils/2.27/00_all_0003-ld-enable-new-dtags-by-default-for-linux-gnu-targets.patch
file :
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/binutils/2.27/00_all_0003-ld-enable-new-dtags-by-default-for-linux-gnu-targets.patch?rev=1.1&view=markup
plain:
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/binutils/2.27/00_all_0003-ld-enable-new-dtags-by-default-for-linux-gnu-targets.patch?rev=1.1&content-type=text/plain
Index: 00_all_0003-ld-enable-new-dtags-by-default-for-linux-gnu-targets.patch
===================================================================
>From 20b99457b29c327821fc96ecc416de1e749d7d9d Mon Sep 17 00:00:00 2001
From: Mike Frysinger <[email protected]>
Date: Fri, 7 Jan 2005 00:15:53 -0500
Subject: [PATCH] ld: enable new dtags by default for linux/gnu targets
The "new" dtags options have been around for 14+ years now, so for Linux
and GNU targets, enable them by default.
2012-01-21 Mike Frysinger <[email protected]>
* emultempl/elf32.em (gld${EMULATION_NAME}_before_parse): Set
link_info.new_dtags to TRUE for linux/gnu targets.
* NEWS: Mention new dtags default.
2013-01-22 Roland McGrath <[email protected]>
* emultempl/elf32.em (gld${EMULATION_NAME}_before_parse): Set
new_dtags to TRUE for *-*-nacl* targets.
---
ld/emultempl/elf32.em | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em
index 47fa549a9afe..4a333d546c68 100644
--- a/ld/emultempl/elf32.em
+++ b/ld/emultempl/elf32.em
@@ -103,6 +103,16 @@ gld${EMULATION_NAME}_before_parse (void)
input_flags.dynamic = ${DYNAMIC_LINK-TRUE};
config.has_shared = `if test -n "$GENERATE_SHLIB_SCRIPT" ; then echo TRUE ;
else echo FALSE ; fi`;
config.separate_code = `if test "x${SEPARATE_CODE}" = xyes ; then echo TRUE
; else echo FALSE ; fi`;
+EOF
+
+case ${target} in
+ *-*-linux-* | *-*-k*bsd*-* | *-*-gnu* | *-*-nacl*)
+ fragment <<EOF
+ link_info.new_dtags = TRUE;
+EOF
+ ;;
+esac
+fragment <<EOF
`if test -n "$CALL_NOP_BYTE" ; then echo link_info.call_nop_byte =
$CALL_NOP_BYTE; fi`;
link_info.check_relocs_after_open_input = `if test
"x${CHECK_RELOCS_AFTER_OPEN_INPUT}" = xyes ; then echo TRUE ; else echo FALSE ;
fi`;
link_info.relro = DEFAULT_LD_Z_RELRO;
--
2.10.2
1.1
src/patchsets/binutils/2.27/00_all_0004-gold-ld-enable-gnu-hash-by-default.patch
file :
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/binutils/2.27/00_all_0004-gold-ld-enable-gnu-hash-by-default.patch?rev=1.1&view=markup
plain:
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/binutils/2.27/00_all_0004-gold-ld-enable-gnu-hash-by-default.patch?rev=1.1&content-type=text/plain
Index: 00_all_0004-gold-ld-enable-gnu-hash-by-default.patch
===================================================================
>From ce14df82dd4c454408ae3b2d9071457126f1be86 Mon Sep 17 00:00:00 2001
From: Mike Frysinger <[email protected]>
Date: Sat, 27 Jan 2007 15:01:08 -0500
Subject: [PATCH] gold/ld: enable gnu hash by default
Glibc first added .gnu.hash support to glibc-2.5 (released 29 Sep 2006),
and gold was first released after that. Let's default the gnu hash style
to the new "gnu" rather than the classic sysv.
gold/:
2012-02-03 Mike Frysinger <[email protected]>
* options.h (General_options): Change default to gnu for hash_style.
---
gold/options.h | 2 +-
ld/emultempl/elf32.em | 13 +++++++++++++
ld/testsuite/lib/ld-lib.exp | 4 ++--
3 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/gold/options.h b/gold/options.h
index 860ac1056999..c4650a8ba382 100644
--- a/gold/options.h
+++ b/gold/options.h
@@ -856,7 +856,7 @@ class General_options
N_("Min fraction of empty buckets in dynamic hash"),
N_("FRACTION"));
- DEFINE_enum(hash_style, options::TWO_DASHES, '\0', "sysv",
+ DEFINE_enum(hash_style, options::TWO_DASHES, '\0', "gnu",
N_("Dynamic hash style"), N_("[sysv,gnu,both]"),
{"sysv", "gnu", "both"});
diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em
index 4a333d546c68..359ce926d30c 100644
--- a/ld/emultempl/elf32.em
+++ b/ld/emultempl/elf32.em
@@ -100,6 +100,19 @@ static void
gld${EMULATION_NAME}_before_parse (void)
{
ldfile_set_output_arch ("${OUTPUT_ARCH}", bfd_arch_`echo ${ARCH} | sed -e
's/:.*//'`);
+EOF
+# Enable gnu hash by default for Linux (non-mips) targets.
+# This has been supported since glibc-2.5.
+case ${target} in
+ mips*) ;;
+ *-*-linux-* | *-*-gnu*)
+ fragment <<EOF
+ link_info.emit_hash = FALSE;
+ link_info.emit_gnu_hash = TRUE;
+EOF
+ ;;
+esac
+fragment <<EOF
input_flags.dynamic = ${DYNAMIC_LINK-TRUE};
config.has_shared = `if test -n "$GENERATE_SHLIB_SCRIPT" ; then echo TRUE ;
else echo FALSE ; fi`;
config.separate_code = `if test "x${SEPARATE_CODE}" = xyes ; then echo TRUE
; else echo FALSE ; fi`;
diff --git a/ld/testsuite/lib/ld-lib.exp b/ld/testsuite/lib/ld-lib.exp
index a9cd9f771d3d..8bec8fc6433d 100644
--- a/ld/testsuite/lib/ld-lib.exp
+++ b/ld/testsuite/lib/ld-lib.exp
@@ -144,7 +144,7 @@ proc default_ld_relocate { ld target objects } {
global HOSTING_EMU
remote_file host delete $target
- return [run_host_cmd_yesno "$ld" "$HOSTING_EMU -o $target -r $objects"]
+ return [run_host_cmd_yesno "$ld" "$HOSTING_EMU --hash-style=sysv -o
$target -r $objects"]
}
# Check to see if ld is being invoked with a non-endian output format
@@ -225,7 +225,7 @@ proc default_ld_link { ld target objects } {
remote_file host delete $target
- return [run_host_cmd_yesno "$ld" "$HOSTING_EMU $flags -o $target $objs
$libs"]
+ return [run_host_cmd_yesno "$ld" "$HOSTING_EMU --hash-style=sysv $flags -o
$target $objs $libs"]
}
# Link a program using ld, without including any libraries.
--
2.10.2
1.1
src/patchsets/binutils/2.27/00_all_0005-libiberty-install-PIC-version-of-libiberty.a.patch
file :
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/binutils/2.27/00_all_0005-libiberty-install-PIC-version-of-libiberty.a.patch?rev=1.1&view=markup
plain:
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/binutils/2.27/00_all_0005-libiberty-install-PIC-version-of-libiberty.a.patch?rev=1.1&content-type=text/plain
Index: 00_all_0005-libiberty-install-PIC-version-of-libiberty.a.patch
===================================================================
>From 7bf04c64fd51d82d1e860e4da1fbbd5ea6e23db8 Mon Sep 17 00:00:00 2001
From: Mike Frysinger <[email protected]>
Date: Fri, 7 Jan 2005 00:15:53 -0500
Subject: [PATCH] libiberty: install PIC version of libiberty.a
This will install a PIC version of libiberty.a by overwriting the non-PIC
version of libiberty.a while compiling. We do this because there is no
shared version of libiberty for random apps to link against which means if
someone wants to use this in a shared library or PIE, they're out of luck.
It's arguable whether people should be able to use this in a shared lib,
but usage in PIE should be fine. You could argue that this penalizes the
non-PIE users, but the counter point is that people using this library in
general are fairly low, and we'd rather have things work for all of them.
---
libiberty/Makefile.in | 1 +
1 file changed, 1 insertion(+)
diff --git a/libiberty/Makefile.in b/libiberty/Makefile.in
index c7a45680917a..45c9ca25a824 100644
--- a/libiberty/Makefile.in
+++ b/libiberty/Makefile.in
@@ -254,6 +254,7 @@ $(TARGETLIB): $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS)
$(AR) $(AR_FLAGS) $(TARGETLIB) \
$(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS); \
$(RANLIB) $(TARGETLIB); \
+ cp $(TARGETLIB) ../ ; \
cd ..; \
else true; fi; \
if [ x"$(NOASANFLAG)" != x ]; then \
--
2.10.2
1.1
src/patchsets/binutils/2.27/00_all_0006-opcodes-link-against-libbfd.la-for-rpath-deps.patch
file :
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/binutils/2.27/00_all_0006-opcodes-link-against-libbfd.la-for-rpath-deps.patch?rev=1.1&view=markup
plain:
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/binutils/2.27/00_all_0006-opcodes-link-against-libbfd.la-for-rpath-deps.patch?rev=1.1&content-type=text/plain
Index: 00_all_0006-opcodes-link-against-libbfd.la-for-rpath-deps.patch
===================================================================
>From 433808260786208f7691df0c313831549be5046f Mon Sep 17 00:00:00 2001
From: Mike Frysinger <[email protected]>
Date: Tue, 5 Jul 2016 20:24:00 +0545
Subject: [PATCH] opcodes: link against libbfd.la for rpath deps
The reason opcodes doesn't link against libbfd.la is to workaround a
libtool bug where it uses installed -L paths ahead of DESTDIR paths.
The downside is that the library itself lacks rpath tags to find the
right version of libbfd.so.
Since Gentoo has patched the libtool bug for a while, we don't need
the workaround. Use the .la file so we get the rpath tags.
URL: https://bugs.gentoo.org/563934
---
opcodes/configure | 2 +-
opcodes/configure.ac | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/opcodes/configure b/opcodes/configure
index 5a4da0667464..256d38aca29e 100755
--- a/opcodes/configure
+++ b/opcodes/configure
@@ -12517,7 +12517,7 @@ if test "$enable_shared" = "yes"; then
SHARED_LIBADD="-Wl,`pwd`/../bfd/.libs/libbfd.sl ${SHARED_LIBADD}"
;;
*)
- SHARED_LIBADD="-Wl,`pwd`/../bfd/.libs/libbfd.so ${SHARED_LIBADD}"
+ SHARED_LIBADD="../bfd/libbfd.la ${SHARED_LIBADD}"
;;
esac
SHARED_DEPENDENCIES="../bfd/libbfd.la"
diff --git a/opcodes/configure.ac b/opcodes/configure.ac
index c7f47837186b..6e3b05f0d26a 100644
--- a/opcodes/configure.ac
+++ b/opcodes/configure.ac
@@ -185,7 +185,7 @@ changequote([,])dnl
SHARED_LIBADD="-Wl,`pwd`/../bfd/.libs/libbfd.sl ${SHARED_LIBADD}"
;;
*)
- SHARED_LIBADD="-Wl,`pwd`/../bfd/.libs/libbfd.so ${SHARED_LIBADD}"
+ SHARED_LIBADD="../bfd/libbfd.la ${SHARED_LIBADD}"
;;
esac
SHARED_DEPENDENCIES="../bfd/libbfd.la"
--
2.10.2
1.1 src/patchsets/binutils/2.27/README.history
file :
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/binutils/2.27/README.history?rev=1.1&view=markup
plain:
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/binutils/2.27/README.history?rev=1.1&content-type=text/plain
Index: README.history
===================================================================
1.0 12 Nov 2016
+ 00_all_0001-ld-always-warn-about-textrels-in-files.patch
+ 00_all_0002-gold-ld-add-support-for-poisoned-system-directories.patch
+ 00_all_0003-ld-enable-new-dtags-by-default-for-linux-gnu-targets.patch
+ 00_all_0004-gold-ld-enable-gnu-hash-by-default.patch
+ 00_all_0005-libiberty-install-PIC-version-of-libiberty.a.patch
+ 00_all_0006-opcodes-link-against-libbfd.la-for-rpath-deps.patch