Instead, use BFD_SUPPORTS_PLUGINS.
* ldfile.c: Replace uses of ENABLE_PLUGINS with BFD_SUPPORTS_PLUGINS.
* ldlang.c: Likewise.
* ldlang.h: Likewise.
* ldlex.h: Likewise.
* ldmain.c: Likewise.
* lexsup.c: Likewise.
* plugin.c: Wrap body of file in #if BFD_SUPPORTS_PLUGINS.
* testplug.c: Likewise.
* testplug2.c: Likewise.
* testplug3.c: Likewise.
* testplug4.c: Likewise.
* configure.ac (ENABLE_PLUGINS): Don't define AM_CONTITIONAL.
* Makefile.am: Remove ENABLE_PLUGINS conditionals.
(PLUGIN_CFLAGS): Don't define.
(PLUGIN_C, PLUGIN_H, PLUGIN_OBJECT): Likewise. Substitute all
uses with plugin file name.
* configure: Regenerate.
* Makefile.in: Regenerate.
+2020-06-21 Alan Modra <amodra@gmail.com>
+
+ * ldfile.c: Replace uses of ENABLE_PLUGINS with BFD_SUPPORTS_PLUGINS.
+ * ldlang.c: Likewise.
+ * ldlang.h: Likewise.
+ * ldlex.h: Likewise.
+ * ldmain.c: Likewise.
+ * lexsup.c: Likewise.
+ * plugin.c: Wrap body of file in #if BFD_SUPPORTS_PLUGINS.
+ * testplug.c: Likewise.
+ * testplug2.c: Likewise.
+ * testplug3.c: Likewise.
+ * testplug4.c: Likewise.
+ * configure.ac (ENABLE_PLUGINS): Don't define AM_CONTITIONAL.
+ * Makefile.am: Remove ENABLE_PLUGINS conditionals.
+ (PLUGIN_CFLAGS): Don't define.
+ (PLUGIN_C, PLUGIN_H, PLUGIN_OBJECT): Likewise. Substitute all
+ uses with plugin file name.
+ * configure: Regenerate.
+ * Makefile.in: Regenerate.
+
2020-06-20 Alan Modra <amodra@gmail.com>
* testsuite/lib/ld-lib.exp (default_ld_compile): Don't perror on
NO_WERROR = @NO_WERROR@
AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CLFAGS)
-# Conditionally enable the plugin interface.
-if ENABLE_PLUGINS
-PLUGIN_C = plugin.c
-PLUGIN_H = plugin.h
-PLUGIN_OBJECT = plugin.@OBJEXT@
-PLUGIN_CFLAGS = -DENABLE_PLUGINS
-else
-PLUGIN_C =
-PLUGIN_H =
-PLUGIN_OBJECT =
-PLUGIN_CFLAGS =
-endif
-
# 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.
-I $(top_srcdir)/../libiberty
AM_CPPFLAGS = -I. -I$(srcdir) -I../bfd -I$(BFDDIR) -I$(INCDIR) @zlibinc@ \
- @INCINTL@ $(HDEFINES) $(CFLAGS) $(PLUGIN_CFLAGS) \
+ @INCINTL@ $(HDEFINES) $(CFLAGS) \
-DLOCALEDIR="\"$(datadir)/locale\""
BFDLIB = ../bfd/libbfd.la
CFILES = ldctor.c ldemul.c ldexp.c ldfile.c ldlang.c \
ldmain.c ldmisc.c ldver.c ldwrite.c lexsup.c \
mri.c ldcref.c pe-dll.c pep-dll.c ldlex-wrapper.c \
- $(PLUGIN_C) ldbuildid.c ldelf.c ldelfgen.c
+ plugin.c ldbuildid.c ldelf.c ldelfgen.c
HFILES = ld.h ldctor.h ldemul.h ldexp.h ldfile.h \
ldlang.h ldlex.h ldmain.h ldmisc.h ldver.h \
ldwrite.h mri.h deffile.h pe-dll.h pep-dll.h \
- elf-hints-local.h $(PLUGIN_H) ldbuildid.h ldelf.h ldelfgen.h
+ elf-hints-local.h plugin.h ldbuildid.h ldelf.h ldelfgen.h
GENERATED_CFILES = ldgram.c ldlex.c deffilep.c
GENERATED_HFILES = ldgram.h ldemul-list.h deffilep.h
BUILT_SOURCES = $(GENERATED_HFILES)
OFILES = ldgram.@OBJEXT@ ldlex-wrapper.@OBJEXT@ lexsup.@OBJEXT@ ldlang.@OBJEXT@ \
- mri.@OBJEXT@ ldctor.@OBJEXT@ ldmain.@OBJEXT@ $(PLUGIN_OBJECT) \
+ mri.@OBJEXT@ ldctor.@OBJEXT@ ldmain.@OBJEXT@ plugin.@OBJEXT@ \
ldwrite.@OBJEXT@ ldexp.@OBJEXT@ ldemul.@OBJEXT@ ldver.@OBJEXT@ ldmisc.@OBJEXT@ \
ldfile.@OBJEXT@ ldcref.@OBJEXT@ ${EMULATION_OFILES} ${EMUL_EXTRA_OFILES} \
ldbuildid.@OBJEXT@
EXTRA_ld_new_SOURCES += pep-dll.c pe-dll.c ldelf.c ldelfgen.c
ld_new_SOURCES = ldgram.y ldlex-wrapper.c lexsup.c ldlang.c mri.c ldctor.c ldmain.c \
- ldwrite.c ldexp.c ldemul.c ldver.c ldmisc.c ldfile.c ldcref.c $(PLUGIN_C) \
+ ldwrite.c ldexp.c ldemul.c ldver.c ldmisc.c ldfile.c ldcref.c plugin.c \
ldbuildid.c
ld_new_DEPENDENCIES = $(EMULATION_OFILES) $(EMUL_EXTRA_OFILES) \
$(BFDLIB) $(LIBCTF) $(LIBIBERTY) $(LIBINTL_DEP)
#
# Build a dummy plugin using libtool.
#
-if ENABLE_PLUGINS
noinst_LTLIBRARIES = libldtestplug.la libldtestplug2.la \
libldtestplug3.la libldtestplug4.la
libldtestplug_la_SOURCES = testplug.c
libldtestplug4_la_SOURCES = testplug4.c
libldtestplug4_la_CFLAGS= -g -O2
libldtestplug4_la_LDFLAGS = -no-undefined -rpath /nowhere
-endif
# DOCUMENTATION TARGETS
# Manual configuration file; not usually attached to normal configuration,
CONFIG_CLEAN_VPATH_FILES =
LTLIBRARIES = $(noinst_LTLIBRARIES)
libldtestplug_la_LIBADD =
-@ENABLE_PLUGINS_TRUE@am_libldtestplug_la_OBJECTS = \
-@ENABLE_PLUGINS_TRUE@ libldtestplug_la-testplug.lo
+am_libldtestplug_la_OBJECTS = libldtestplug_la-testplug.lo
libldtestplug_la_OBJECTS = $(am_libldtestplug_la_OBJECTS)
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
$(libldtestplug_la_CFLAGS) $(CFLAGS) \
$(libldtestplug_la_LDFLAGS) $(LDFLAGS) -o $@
-@ENABLE_PLUGINS_TRUE@am_libldtestplug_la_rpath =
libldtestplug2_la_LIBADD =
-@ENABLE_PLUGINS_TRUE@am_libldtestplug2_la_OBJECTS = \
-@ENABLE_PLUGINS_TRUE@ libldtestplug2_la-testplug2.lo
+am_libldtestplug2_la_OBJECTS = libldtestplug2_la-testplug2.lo
libldtestplug2_la_OBJECTS = $(am_libldtestplug2_la_OBJECTS)
libldtestplug2_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
$(libldtestplug2_la_CFLAGS) $(CFLAGS) \
$(libldtestplug2_la_LDFLAGS) $(LDFLAGS) -o $@
-@ENABLE_PLUGINS_TRUE@am_libldtestplug2_la_rpath =
libldtestplug3_la_LIBADD =
-@ENABLE_PLUGINS_TRUE@am_libldtestplug3_la_OBJECTS = \
-@ENABLE_PLUGINS_TRUE@ libldtestplug3_la-testplug3.lo
+am_libldtestplug3_la_OBJECTS = libldtestplug3_la-testplug3.lo
libldtestplug3_la_OBJECTS = $(am_libldtestplug3_la_OBJECTS)
libldtestplug3_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
$(libldtestplug3_la_CFLAGS) $(CFLAGS) \
$(libldtestplug3_la_LDFLAGS) $(LDFLAGS) -o $@
-@ENABLE_PLUGINS_TRUE@am_libldtestplug3_la_rpath =
libldtestplug4_la_LIBADD =
-@ENABLE_PLUGINS_TRUE@am_libldtestplug4_la_OBJECTS = \
-@ENABLE_PLUGINS_TRUE@ libldtestplug4_la-testplug4.lo
+am_libldtestplug4_la_OBJECTS = libldtestplug4_la-testplug4.lo
libldtestplug4_la_OBJECTS = $(am_libldtestplug4_la_OBJECTS)
libldtestplug4_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
$(libldtestplug4_la_CFLAGS) $(CFLAGS) \
$(libldtestplug4_la_LDFLAGS) $(LDFLAGS) -o $@
-@ENABLE_PLUGINS_TRUE@am_libldtestplug4_la_rpath =
am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(infodir)" \
"$(DESTDIR)$(man1dir)"
PROGRAMS = $(bin_PROGRAMS)
-@ENABLE_PLUGINS_TRUE@am__objects_1 = plugin.$(OBJEXT)
am_ld_new_OBJECTS = ldgram.$(OBJEXT) ldlex-wrapper.$(OBJEXT) \
lexsup.$(OBJEXT) ldlang.$(OBJEXT) mri.$(OBJEXT) \
ldctor.$(OBJEXT) ldmain.$(OBJEXT) ldwrite.$(OBJEXT) \
ldexp.$(OBJEXT) ldemul.$(OBJEXT) ldver.$(OBJEXT) \
ldmisc.$(OBJEXT) ldfile.$(OBJEXT) ldcref.$(OBJEXT) \
- $(am__objects_1) ldbuildid.$(OBJEXT)
+ plugin.$(OBJEXT) ldbuildid.$(OBJEXT)
ld_new_OBJECTS = $(am_ld_new_OBJECTS)
am__DEPENDENCIES_1 =
AM_V_P = $(am__v_P_@AM_V@)
-DELF_PLT_UNWIND_LIST_OPTIONS=@elf_plt_unwind_list_options@
AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CLFAGS)
-@ENABLE_PLUGINS_FALSE@PLUGIN_C =
-
-# Conditionally enable the plugin interface.
-@ENABLE_PLUGINS_TRUE@PLUGIN_C = plugin.c
-@ENABLE_PLUGINS_FALSE@PLUGIN_H =
-@ENABLE_PLUGINS_TRUE@PLUGIN_H = plugin.h
-@ENABLE_PLUGINS_FALSE@PLUGIN_OBJECT =
-@ENABLE_PLUGINS_TRUE@PLUGIN_OBJECT = plugin.@OBJEXT@
-@ENABLE_PLUGINS_FALSE@PLUGIN_CFLAGS =
-@ENABLE_PLUGINS_TRUE@PLUGIN_CFLAGS = -DENABLE_PLUGINS
# We put the scripts in the directory $(scriptdir)/ldscripts.
# We can't put the scripts in $(datadir) because the SEARCH_DIR
-I $(top_srcdir)/../libiberty
AM_CPPFLAGS = -I. -I$(srcdir) -I../bfd -I$(BFDDIR) -I$(INCDIR) @zlibinc@ \
- @INCINTL@ $(HDEFINES) $(CFLAGS) $(PLUGIN_CFLAGS) \
+ @INCINTL@ $(HDEFINES) $(CFLAGS) \
-DLOCALEDIR="\"$(datadir)/locale\""
BFDLIB = ../bfd/libbfd.la
CFILES = ldctor.c ldemul.c ldexp.c ldfile.c ldlang.c \
ldmain.c ldmisc.c ldver.c ldwrite.c lexsup.c \
mri.c ldcref.c pe-dll.c pep-dll.c ldlex-wrapper.c \
- $(PLUGIN_C) ldbuildid.c ldelf.c ldelfgen.c
+ plugin.c ldbuildid.c ldelf.c ldelfgen.c
HFILES = ld.h ldctor.h ldemul.h ldexp.h ldfile.h \
ldlang.h ldlex.h ldmain.h ldmisc.h ldver.h \
ldwrite.h mri.h deffile.h pe-dll.h pep-dll.h \
- elf-hints-local.h $(PLUGIN_H) ldbuildid.h ldelf.h ldelfgen.h
+ elf-hints-local.h plugin.h ldbuildid.h ldelf.h ldelfgen.h
GENERATED_CFILES = ldgram.c ldlex.c deffilep.c
GENERATED_HFILES = ldgram.h ldemul-list.h deffilep.h
# tracking will not cause them to be built beforehand.
BUILT_SOURCES = $(GENERATED_HFILES)
OFILES = ldgram.@OBJEXT@ ldlex-wrapper.@OBJEXT@ lexsup.@OBJEXT@ ldlang.@OBJEXT@ \
- mri.@OBJEXT@ ldctor.@OBJEXT@ ldmain.@OBJEXT@ $(PLUGIN_OBJECT) \
+ mri.@OBJEXT@ ldctor.@OBJEXT@ ldmain.@OBJEXT@ plugin.@OBJEXT@ \
ldwrite.@OBJEXT@ ldexp.@OBJEXT@ ldemul.@OBJEXT@ ldver.@OBJEXT@ ldmisc.@OBJEXT@ \
ldfile.@OBJEXT@ ldcref.@OBJEXT@ ${EMULATION_OFILES} ${EMUL_EXTRA_OFILES} \
ldbuildid.@OBJEXT@
ldelfgen.c $(ALL_EMULATION_SOURCES) \
$(ALL_64_EMULATION_SOURCES)
ld_new_SOURCES = ldgram.y ldlex-wrapper.c lexsup.c ldlang.c mri.c ldctor.c ldmain.c \
- ldwrite.c ldexp.c ldemul.c ldver.c ldmisc.c ldfile.c ldcref.c $(PLUGIN_C) \
+ ldwrite.c ldexp.c ldemul.c ldver.c ldmisc.c ldfile.c ldcref.c plugin.c \
ldbuildid.c
ld_new_DEPENDENCIES = $(EMULATION_OFILES) $(EMUL_EXTRA_OFILES) \
#
# Build a dummy plugin using libtool.
#
-@ENABLE_PLUGINS_TRUE@noinst_LTLIBRARIES = libldtestplug.la libldtestplug2.la \
-@ENABLE_PLUGINS_TRUE@ libldtestplug3.la libldtestplug4.la
-
-@ENABLE_PLUGINS_TRUE@libldtestplug_la_SOURCES = testplug.c
-@ENABLE_PLUGINS_TRUE@libldtestplug_la_CFLAGS = -g -O2
-@ENABLE_PLUGINS_TRUE@libldtestplug_la_LDFLAGS = -no-undefined -rpath /nowhere
-@ENABLE_PLUGINS_TRUE@libldtestplug2_la_SOURCES = testplug2.c
-@ENABLE_PLUGINS_TRUE@libldtestplug2_la_CFLAGS = -g -O2
-@ENABLE_PLUGINS_TRUE@libldtestplug2_la_LDFLAGS = -no-undefined -rpath /nowhere
-@ENABLE_PLUGINS_TRUE@libldtestplug3_la_SOURCES = testplug3.c
-@ENABLE_PLUGINS_TRUE@libldtestplug3_la_CFLAGS = -g -O2
-@ENABLE_PLUGINS_TRUE@libldtestplug3_la_LDFLAGS = -no-undefined -rpath /nowhere
-@ENABLE_PLUGINS_TRUE@libldtestplug4_la_SOURCES = testplug4.c
-@ENABLE_PLUGINS_TRUE@libldtestplug4_la_CFLAGS = -g -O2
-@ENABLE_PLUGINS_TRUE@libldtestplug4_la_LDFLAGS = -no-undefined -rpath /nowhere
+noinst_LTLIBRARIES = libldtestplug.la libldtestplug2.la \
+ libldtestplug3.la libldtestplug4.la
+
+libldtestplug_la_SOURCES = testplug.c
+libldtestplug_la_CFLAGS = -g -O2
+libldtestplug_la_LDFLAGS = -no-undefined -rpath /nowhere
+libldtestplug2_la_SOURCES = testplug2.c
+libldtestplug2_la_CFLAGS = -g -O2
+libldtestplug2_la_LDFLAGS = -no-undefined -rpath /nowhere
+libldtestplug3_la_SOURCES = testplug3.c
+libldtestplug3_la_CFLAGS = -g -O2
+libldtestplug3_la_LDFLAGS = -no-undefined -rpath /nowhere
+libldtestplug4_la_SOURCES = testplug4.c
+libldtestplug4_la_CFLAGS = -g -O2
+libldtestplug4_la_LDFLAGS = -no-undefined -rpath /nowhere
MAINTAINERCLEANFILES = configdoc.texi ld.1 ld.info
# We want to reconfigure if configure.host or configure.tgt changes.
}
libldtestplug.la: $(libldtestplug_la_OBJECTS) $(libldtestplug_la_DEPENDENCIES) $(EXTRA_libldtestplug_la_DEPENDENCIES)
- $(AM_V_CCLD)$(libldtestplug_la_LINK) $(am_libldtestplug_la_rpath) $(libldtestplug_la_OBJECTS) $(libldtestplug_la_LIBADD) $(LIBS)
+ $(AM_V_CCLD)$(libldtestplug_la_LINK) $(libldtestplug_la_OBJECTS) $(libldtestplug_la_LIBADD) $(LIBS)
libldtestplug2.la: $(libldtestplug2_la_OBJECTS) $(libldtestplug2_la_DEPENDENCIES) $(EXTRA_libldtestplug2_la_DEPENDENCIES)
- $(AM_V_CCLD)$(libldtestplug2_la_LINK) $(am_libldtestplug2_la_rpath) $(libldtestplug2_la_OBJECTS) $(libldtestplug2_la_LIBADD) $(LIBS)
+ $(AM_V_CCLD)$(libldtestplug2_la_LINK) $(libldtestplug2_la_OBJECTS) $(libldtestplug2_la_LIBADD) $(LIBS)
libldtestplug3.la: $(libldtestplug3_la_OBJECTS) $(libldtestplug3_la_DEPENDENCIES) $(EXTRA_libldtestplug3_la_DEPENDENCIES)
- $(AM_V_CCLD)$(libldtestplug3_la_LINK) $(am_libldtestplug3_la_rpath) $(libldtestplug3_la_OBJECTS) $(libldtestplug3_la_LIBADD) $(LIBS)
+ $(AM_V_CCLD)$(libldtestplug3_la_LINK) $(libldtestplug3_la_OBJECTS) $(libldtestplug3_la_LIBADD) $(LIBS)
libldtestplug4.la: $(libldtestplug4_la_OBJECTS) $(libldtestplug4_la_DEPENDENCIES) $(EXTRA_libldtestplug4_la_DEPENDENCIES)
- $(AM_V_CCLD)$(libldtestplug4_la_LINK) $(am_libldtestplug4_la_rpath) $(libldtestplug4_la_OBJECTS) $(libldtestplug4_la_LIBADD) $(LIBS)
+ $(AM_V_CCLD)$(libldtestplug4_la_LINK) $(libldtestplug4_la_OBJECTS) $(libldtestplug4_la_LIBADD) $(LIBS)
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
zlibinc
zlibdir
enable_initfini_array
-ENABLE_PLUGINS_FALSE
-ENABLE_PLUGINS_TRUE
NATIVE_LIB_DIRS
HDEFINES
do_compare
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 12038 "configure"
+#line 12036 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 12144 "configure"
+#line 12142 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
fi
- if test x$plugins = xyes; then
- ENABLE_PLUGINS_TRUE=
- ENABLE_PLUGINS_FALSE='#'
-else
- ENABLE_PLUGINS_TRUE='#'
- ENABLE_PLUGINS_FALSE=
-fi
-
# Check whether --enable-initfini-array was given.
if test "${enable_initfini_array+set}" = set; then :
as_fn_error $? "conditional \"GENINSRC_NEVER\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
-if test -z "${ENABLE_PLUGINS_TRUE}" && test -z "${ENABLE_PLUGINS_FALSE}"; then
- as_fn_error $? "conditional \"ENABLE_PLUGINS\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
: "${CONFIG_STATUS=./config.status}"
ac_write_fail=0
AC_FUNC_MMAP
AC_SEARCH_LIBS([dlopen], [dl])
-AM_CONDITIONAL([ENABLE_PLUGINS], [test x$plugins = xyes])
AC_ARG_ENABLE(initfini-array,
[ --disable-initfini-array do not use .init_array/.fini_array sections],
#include "ldemul.h"
#include "libiberty.h"
#include "filenames.h"
-#ifdef ENABLE_PLUGINS
+#if BFD_SUPPORTS_PLUGINS
#include "plugin-api.h"
#include "plugin.h"
-#endif /* ENABLE_PLUGINS */
+#endif /* BFD_SUPPORTS_PLUGINS */
bfd_boolean ldfile_assumed_script = FALSE;
const char *ldfile_output_machine_name = "";
/* This is a linker input BFD. */
entry->the_bfd->is_linker_input = 1;
-#ifdef ENABLE_PLUGINS
+#if BFD_SUPPORTS_PLUGINS
if (entry->flags.lto_output)
entry->the_bfd->lto_output = 1;
#endif
}
}
success:
-#ifdef ENABLE_PLUGINS
+#if BFD_SUPPORTS_PLUGINS
/* If plugins are active, they get first chance to claim
any successfully-opened input file. We skip archives
here; the plugin wants us to offer it the individual
&& !no_more_claiming
&& bfd_check_format (entry->the_bfd, bfd_object))
plugin_maybe_claim (entry);
-#endif /* ENABLE_PLUGINS */
+#endif /* BFD_SUPPORTS_PLUGINS */
/* It opened OK, the format checked out, and the plugins have had
their chance to claim it, so this is success. */
#include "demangle.h"
#include "hashtab.h"
#include "elf-bfd.h"
-#ifdef ENABLE_PLUGINS
+#if BFD_SUPPORTS_PLUGINS
#include "plugin.h"
-#endif /* ENABLE_PLUGINS */
+#endif /* BFD_SUPPORTS_PLUGINS */
#ifndef offsetof
#define offsetof(TYPE, MEMBER) ((size_t) & (((TYPE*) 0)->MEMBER))
OPEN_BFD_FORCE = 1,
OPEN_BFD_RESCAN = 2
};
-#ifdef ENABLE_PLUGINS
+#if BFD_SUPPORTS_PLUGINS
static lang_input_statement_type *plugin_insert = NULL;
static struct bfd_link_hash_entry *plugin_undefs = NULL;
#endif
case lang_group_statement_enum:
{
struct bfd_link_hash_entry *undefs;
-#ifdef ENABLE_PLUGINS
+#if BFD_SUPPORTS_PLUGINS
lang_input_statement_type *plugin_insert_save;
#endif
do
{
-#ifdef ENABLE_PLUGINS
+#if BFD_SUPPORTS_PLUGINS
plugin_insert_save = plugin_insert;
#endif
undefs = link_info.hash->undefs_tail;
mode | OPEN_BFD_FORCE);
}
while (undefs != link_info.hash->undefs_tail
-#ifdef ENABLE_PLUGINS
+#if BFD_SUPPORTS_PLUGINS
/* Objects inserted by a plugin, which are loaded
before we hit this loop, may have added new
undefs. */
has been loaded already. Do the same for a rescan.
Likewise reload --as-needed shared libs. */
if (mode != OPEN_BFD_NORMAL
-#ifdef ENABLE_PLUGINS
+#if BFD_SUPPORTS_PLUGINS
&& ((mode & OPEN_BFD_RESCAN) == 0
|| plugin_insert == NULL)
#endif
}
}
}
-#ifdef ENABLE_PLUGINS
+#if BFD_SUPPORTS_PLUGINS
/* If we have found the point at which a plugin added new
files, clear plugin_insert to enable archive rescan. */
if (&s->input_statement == plugin_insert)
file != NULL;
file = file->next)
{
-#ifdef ENABLE_PLUGINS
+#if BFD_SUPPORTS_PLUGINS
/* Don't check format of files claimed by plugin. */
if (file->flags.claimed)
continue;
-#endif /* ENABLE_PLUGINS */
+#endif /* BFD_SUPPORTS_PLUGINS */
input_bfd = file->the_bfd;
compatible
= bfd_arch_get_compatible (input_bfd, link_info.output_bfd,
LANG_FOR_EACH_INPUT_STATEMENT (f)
{
asection *sec;
-#ifdef ENABLE_PLUGINS
+#if BFD_SUPPORTS_PLUGINS
if (f->flags.claimed)
continue;
#endif
}
}
-#ifdef ENABLE_PLUGINS
+#if BFD_SUPPORTS_PLUGINS
/* Find the insert point for the plugin's replacement files. We
place them after the first claimed real object file, or if the
first claimed object is an archive member, after the last real
}
return s;
}
-#endif /* ENABLE_PLUGINS */
+#endif /* BFD_SUPPORTS_PLUGINS */
/* Add NAME to the list of garbage collection entry points. */
to symbolic origin/length now. */
lang_do_memory_regions ();
-#ifdef ENABLE_PLUGINS
+#if BFD_SUPPORTS_PLUGINS
if (link_info.lto_plugin_active)
{
lang_statement_list_type added;
}
}
}
-#endif /* ENABLE_PLUGINS */
+#endif /* BFD_SUPPORTS_PLUGINS */
/* Make sure that nobody has tried to add a symbol to this list
before now. */
/* Set if reloading an archive or --as-needed lib. */
unsigned int reload : 1;
-#ifdef ENABLE_PLUGINS
+#if BFD_SUPPORTS_PLUGINS
/* Set if the file was claimed by a plugin. */
unsigned int claimed : 1;
/* Set if added by the lto plugin add_input_file callback. */
unsigned int lto_output : 1;
-#endif /* ENABLE_PLUGINS */
+#endif /* BFD_SUPPORTS_PLUGINS */
/* Head of list of pushed flags. */
struct lang_input_statement_flags *pushed;
OPTION_WARN_TEXTREL,
OPTION_WARN_ALTERNATE_EM,
OPTION_REDUCE_MEMORY_OVERHEADS,
-#ifdef ENABLE_PLUGINS
+#if BFD_SUPPORTS_PLUGINS
OPTION_PLUGIN,
OPTION_PLUGIN_OPT,
-#endif /* ENABLE_PLUGINS */
+#endif /* BFD_SUPPORTS_PLUGINS */
OPTION_DEFAULT_SCRIPT,
OPTION_PRINT_OUTPUT_FORMAT,
OPTION_PRINT_SYSROOT,
#include "ldfile.h"
#include "ldemul.h"
#include "ldctor.h"
-#ifdef ENABLE_PLUGINS
+#if BFD_SUPPORTS_PLUGINS
#include "plugin.h"
#include "plugin-api.h"
-#endif /* ENABLE_PLUGINS */
+#endif /* BFD_SUPPORTS_PLUGINS */
/* Somewhere above, sys/stat.h got included. */
#if !defined(S_ISDIR) && defined(S_IFDIR)
ld_cleanup (void)
{
bfd_cache_close_all ();
-#ifdef ENABLE_PLUGINS
+#if BFD_SUPPORTS_PLUGINS
plugin_call_cleanup ();
#endif
if (output_filename && delete_output_file_on_failure)
if (config.hash_table_size != 0)
bfd_hash_set_default_size (config.hash_table_size);
-#ifdef ENABLE_PLUGINS
+#if BFD_SUPPORTS_PLUGINS
/* Now all the plugin arguments have been gathered, we can load them. */
plugin_load_plugins ();
-#endif /* ENABLE_PLUGINS */
+#endif /* BFD_SUPPORTS_PLUGINS */
ldemul_set_symbols ();
(if enabled) may possibly alter it to point to a replacement
BFD, but we still want to output the original BFD filename. */
orig_input = *input;
-#ifdef ENABLE_PLUGINS
+#if BFD_SUPPORTS_PLUGINS
if (link_info.lto_plugin_active)
{
/* We must offer this archive member to the plugins to claim. */
*subsbfd = input->the_bfd;
}
}
-#endif /* ENABLE_PLUGINS */
+#endif /* BFD_SUPPORTS_PLUGINS */
ldlang_add_file (input);
#include "ldver.h"
#include "ldemul.h"
#include "demangle.h"
-#ifdef ENABLE_PLUGINS
+#if BFD_SUPPORTS_PLUGINS
#include "plugin.h"
-#endif /* ENABLE_PLUGINS */
+#endif /* BFD_SUPPORTS_PLUGINS */
#ifndef PATH_SEPARATOR
#if defined (__MSDOS__) || (defined (_WIN32) && ! defined (__CYGWIN32__))
'O', NULL, N_("Optimize output file"), ONE_DASH },
{ {"out-implib", required_argument, NULL, OPTION_OUT_IMPLIB},
'\0', N_("FILE"), N_("Generate import library"), TWO_DASHES },
-#ifdef ENABLE_PLUGINS
+#if BFD_SUPPORTS_PLUGINS
{ {"plugin", required_argument, NULL, OPTION_PLUGIN},
'\0', N_("PLUGIN"), N_("Load named plugin"), ONE_DASH },
{ {"plugin-opt", required_argument, NULL, OPTION_PLUGIN_OPT},
'\0', N_("PLUGIN"), N_("Load named plugin (ignored)"), ONE_DASH },
{ {"plugin-opt", required_argument, NULL, OPTION_IGNORE},
'\0', N_("ARG"), N_("Send arg to last-loaded plugin (ignored)"), ONE_DASH },
-#endif /* ENABLE_PLUGINS */
+#endif /* BFD_SUPPORTS_PLUGINS */
{ {"fuse-ld=", required_argument, NULL, OPTION_IGNORE},
'\0', NULL, N_("Ignored for GCC linker option compatibility"),
ONE_DASH },
case OPTION_PRINT_OUTPUT_FORMAT:
command_line.print_output_format = TRUE;
break;
-#ifdef ENABLE_PLUGINS
+#if BFD_SUPPORTS_PLUGINS
case OPTION_PLUGIN:
plugin_opt_plugin (optarg);
break;
if (plugin_opt_plugin_arg (optarg))
einfo (_("%F%P: bad -plugin-opt option\n"));
break;
-#endif /* ENABLE_PLUGINS */
+#endif /* BFD_SUPPORTS_PLUGINS */
case 'q':
link_info.emitrelocations = TRUE;
break;
int level ATTRIBUTE_UNUSED = strtoul (optarg, &end, 0);
if (*end)
einfo (_("%F%P: invalid number `%s'\n"), optarg);
-#ifdef ENABLE_PLUGINS
+#if BFD_SUPPORTS_PLUGINS
report_plugin_symbols = level > 1;
-#endif /* ENABLE_PLUGINS */
+#endif /* BFD_SUPPORTS_PLUGINS */
}
break;
case 'v':
#include "sysdep.h"
#include "libiberty.h"
#include "bfd.h"
+#if BFD_SUPPORTS_PLUGINS
#include "bfdlink.h"
#include "bfdver.h"
#include "ctf-api.h"
abfd, section, value, flags);
return TRUE;
}
+#endif /* BFD_SUPPORTS_PLUGINS */
#include "sysdep.h"
#include "bfd.h"
+#if BFD_SUPPORTS_PLUGINS
#include "plugin-api.h"
/* For ARRAY_SIZE macro only - we don't link the library itself. */
#include "libiberty.h"
fflush (NULL);
return cleanup_ret;
}
+#endif /* BFD_SUPPORTS_PLUGINS */
#include "sysdep.h"
#include "bfd.h"
+#if BFD_SUPPORTS_PLUGINS
#include "plugin-api.h"
#include "filenames.h"
/* For ARRAY_SIZE macro only - we don't link the library itself. */
fflush (NULL);
return cleanup_ret;
}
+#endif /* BFD_SUPPORTS_PLUGINS */
#include "sysdep.h"
#include "bfd.h"
+#if BFD_SUPPORTS_PLUGINS
#include "plugin-api.h"
#include "filenames.h"
/* For ARRAY_SIZE macro only - we don't link the library itself. */
fflush (NULL);
return cleanup_ret;
}
+#endif /* BFD_SUPPORTS_PLUGINS */
#include "sysdep.h"
#include "bfd.h"
+#if BFD_SUPPORTS_PLUGINS
#include "plugin-api.h"
#include "filenames.h"
/* For ARRAY_SIZE macro only - we don't link the library itself. */
fflush (NULL);
return cleanup_ret;
}
+#endif /* BFD_SUPPORTS_PLUGINS */