aboutsummaryrefslogtreecommitdiff
path: root/binutils
diff options
context:
space:
mode:
Diffstat (limited to 'binutils')
-rw-r--r--binutils/ar.c4
-rw-r--r--binutils/configure.ac6
-rw-r--r--binutils/nm.c14
-rw-r--r--binutils/objcopy.c16
4 files changed, 30 insertions, 10 deletions
diff --git a/binutils/ar.c b/binutils/ar.c
index de41c9e..3cac3f3 100644
--- a/binutils/ar.c
+++ b/binutils/ar.c
@@ -32,9 +32,9 @@
#include "arsup.h"
#include "filenames.h"
#include "binemul.h"
-#include "plugin-api.h"
+#if BFD_SUPPORTS_PLUGINS
#include "plugin.h"
-#include "ansidecl.h"
+#endif
#ifdef __GO32___
#define EXT_NAME_LEN 3 /* Bufflen of addition to name if it's MS-DOS. */
diff --git a/binutils/configure.ac b/binutils/configure.ac
index a393036..93e8a4b 100644
--- a/binutils/configure.ac
+++ b/binutils/configure.ac
@@ -201,9 +201,9 @@ GCC_AC_FUNC_MMAP
AC_CHECK_FUNCS(fseeko fseeko64 getc_unlocked mkdtemp mkstemp utimensat utimes)
AC_MSG_CHECKING([for mbstate_t])
-AC_TRY_COMPILE([#include <wchar.h>],
-[mbstate_t teststate;],
-have_mbstate_t=yes, have_mbstate_t=no)
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <wchar.h>]],
+[[mbstate_t teststate;]])],
+[have_mbstate_t=yes],[have_mbstate_t=no])
AC_MSG_RESULT($have_mbstate_t)
if test x"$have_mbstate_t" = xyes; then
AC_DEFINE(HAVE_MBSTATE_T,1,[Define if mbstate_t exists in wchar.h.])
diff --git a/binutils/nm.c b/binutils/nm.c
index a5d5631..a7f0e9d 100644
--- a/binutils/nm.c
+++ b/binutils/nm.c
@@ -36,9 +36,10 @@
#include "libcoff.h"
#include "bucomm.h"
#include "demanguse.h"
-#include "plugin-api.h"
-#include "plugin.h"
#include "safe-ctype.h"
+#if BFD_SUPPORTS_PLUGINS
+#include "plugin.h"
+#endif
#ifndef streq
#define streq(a,b) (strcmp ((a),(b)) == 0)
@@ -802,6 +803,9 @@ filter_symbols (bfd *abfd, bool is_dynamic, void *minisyms,
continue;
if (bfd_lto_slim_symbol_p (abfd, sym->name)
+#if BFD_SUPPORTS_PLUGINS
+ && !bfd_plugin_target_p (abfd->xvec)
+#endif
&& report_plugin_err)
{
report_plugin_err = false;
@@ -1484,7 +1488,11 @@ display_rel_file (bfd *abfd, bfd *archive_bfd)
/* lto_type is set to lto_non_ir_object when a bfd is loaded with a
compiler LTO plugin. */
- if (bfd_get_lto_type (abfd) == lto_slim_ir_object)
+ if (bfd_get_lto_type (abfd) == lto_slim_ir_object
+#if BFD_SUPPORTS_PLUGINS
+ && !bfd_plugin_target_p (abfd->xvec)
+#endif
+ )
{
report_plugin_err = false;
non_fatal (_("%s: plugin needed to handle lto object"),
diff --git a/binutils/objcopy.c b/binutils/objcopy.c
index 8bd523a..654d2b9 100644
--- a/binutils/objcopy.c
+++ b/binutils/objcopy.c
@@ -30,8 +30,9 @@
#include "coff/internal.h"
#include "libcoff.h"
#include "safe-ctype.h"
-#include "plugin-api.h"
+#if BFD_SUPPORTS_PLUGINS
#include "plugin.h"
+#endif
/* FIXME: See bfd/peXXigen.c for why we include an architecture specific
header in generic PE code. */
@@ -3689,6 +3690,8 @@ copy_archive (bfd *ibfd, bfd *obfd, const char *output_target,
bool ok_object;
const char *element_name;
+ this_element->is_strip_input = 1;
+
element_name = bfd_get_filename (this_element);
/* PR binutils/17533: Do not allow directory traversal
outside of the current directory tree by archive members. */
@@ -3769,7 +3772,9 @@ copy_archive (bfd *ibfd, bfd *obfd, const char *output_target,
#if BFD_SUPPORTS_PLUGINS
/* Copy LTO IR file as unknown object. */
- if (bfd_plugin_target_p (this_element->xvec))
+ if ((!lto_sections_removed
+ && this_element->lto_type == lto_slim_ir_object)
+ || bfd_plugin_target_p (this_element->xvec))
ok_object = false;
else
#endif
@@ -3966,6 +3971,8 @@ copy_file (const char *input_filename, const char *output_filename, int ofd,
break;
}
+ ibfd->is_strip_input = 1;
+
if (bfd_check_format (ibfd, bfd_archive))
{
bool force_output_target;
@@ -5072,6 +5079,11 @@ strip_main (int argc, char *argv[])
SECTION_CONTEXT_REMOVE)
|| !!find_section_list (".llvm.lto", false,
SECTION_CONTEXT_REMOVE));
+ /* NB: Must keep .gnu.debuglto_* sections unless all GCC LTO sections
+ will be removed to avoid undefined references to symbols in GCC LTO
+ debug sections. */
+ if (!lto_sections_removed)
+ find_section_list (".gnu.debuglto_*", true, SECTION_CONTEXT_KEEP);
#endif
i = optind;