From 0381901e629115f5f0d92a27fe74b1814f6f389a Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Sun, 21 Jun 2020 14:23:46 +0930 Subject: [PATCH] Do without ld ENABLE_PLUGINS 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. --- ld/ChangeLog | 21 ++++++++++++++ ld/Makefile.am | 25 ++++------------ ld/Makefile.in | 77 +++++++++++++++++++------------------------------ ld/configure | 18 ++---------- ld/configure.ac | 1 - ld/ldfile.c | 10 +++---- ld/ldlang.c | 30 +++++++++---------- ld/ldlang.h | 4 +-- ld/ldlex.h | 4 +-- ld/ldmain.c | 14 ++++----- ld/lexsup.c | 16 +++++----- ld/plugin.c | 2 ++ ld/testplug.c | 2 ++ ld/testplug2.c | 2 ++ ld/testplug3.c | 2 ++ ld/testplug4.c | 2 ++ 16 files changed, 106 insertions(+), 124 deletions(-) diff --git a/ld/ChangeLog b/ld/ChangeLog index b089073dac..5d460cfefa 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,24 @@ +2020-06-21 Alan Modra + + * 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 * testsuite/lib/ld-lib.exp (default_ld_compile): Don't perror on diff --git a/ld/Makefile.am b/ld/Makefile.am index ffff427bfb..f0767f2be3 100644 --- a/ld/Makefile.am +++ b/ld/Makefile.am @@ -47,19 +47,6 @@ WARN_CFLAGS = @WARN_CFLAGS@ 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. @@ -152,7 +139,7 @@ TEXI2DVI = texi2dvi -I $(srcdir) -I $(BFDDIR)/doc -I ../bfd/doc \ -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 @@ -482,12 +469,12 @@ ALL_64_EMUL_EXTRA_OFILES = \ 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 @@ -497,7 +484,7 @@ 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@ @@ -959,7 +946,7 @@ EXTRA_ld_new_SOURCES = deffilep.y ldlex.l 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) @@ -997,7 +984,6 @@ development.exp: $(BFDDIR)/development.sh # # Build a dummy plugin using libtool. # -if ENABLE_PLUGINS noinst_LTLIBRARIES = libldtestplug.la libldtestplug2.la \ libldtestplug3.la libldtestplug4.la libldtestplug_la_SOURCES = testplug.c @@ -1012,7 +998,6 @@ libldtestplug3_la_LDFLAGS = -no-undefined -rpath /nowhere 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, diff --git a/ld/Makefile.in b/ld/Makefile.in index 99b66589d4..be0291ceec 100644 --- a/ld/Makefile.in +++ b/ld/Makefile.in @@ -138,8 +138,7 @@ CONFIG_CLEAN_FILES = po/Makefile.in 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@) @@ -149,44 +148,36 @@ libldtestplug_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(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@) @@ -558,16 +549,6 @@ ELF_CLFAGS = -DELF_LIST_OPTIONS=@elf_list_options@ \ -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 @@ -642,7 +623,7 @@ TEXI2DVI = texi2dvi -I $(srcdir) -I $(BFDDIR)/doc -I ../bfd/doc \ -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 @@ -970,12 +951,12 @@ ALL_64_EMUL_EXTRA_OFILES = \ 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 @@ -984,7 +965,7 @@ 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@ @@ -1005,7 +986,7 @@ EXTRA_ld_new_SOURCES = deffilep.y ldlex.l pep-dll.c pe-dll.c ldelf.c \ 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) \ @@ -1016,21 +997,21 @@ ld_new_LDADD = $(EMULATION_OFILES) $(EMUL_EXTRA_OFILES) $(BFDLIB) $(LIBCTF) $(LI # # 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. @@ -1118,16 +1099,16 @@ clean-noinstLTLIBRARIES: } 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=; \ diff --git a/ld/configure b/ld/configure index e70e7c304b..fba65c58e2 100755 --- a/ld/configure +++ b/ld/configure @@ -649,8 +649,6 @@ STRINGIFY zlibinc zlibdir enable_initfini_array -ENABLE_PLUGINS_FALSE -ENABLE_PLUGINS_TRUE NATIVE_LIB_DIRS HDEFINES do_compare @@ -12035,7 +12033,7 @@ else 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 @@ -12141,7 +12139,7 @@ else 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 @@ -17285,14 +17283,6 @@ if test "$ac_res" != no; then : 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 : @@ -17890,10 +17880,6 @@ if test -z "${GENINSRC_NEVER_TRUE}" && test -z "${GENINSRC_NEVER_FALSE}"; 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 diff --git a/ld/configure.ac b/ld/configure.ac index 99957df376..2b6c0480e9 100644 --- a/ld/configure.ac +++ b/ld/configure.ac @@ -274,7 +274,6 @@ dnl AC_CHECK_HEADERS(sys/mman.h) 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], diff --git a/ld/ldfile.c b/ld/ldfile.c index 60b28d3f0c..f3de2c2356 100644 --- a/ld/ldfile.c +++ b/ld/ldfile.c @@ -34,10 +34,10 @@ #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 = ""; @@ -148,7 +148,7 @@ ldfile_try_open_bfd (const char *attempt, /* 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 @@ -302,7 +302,7 @@ ldfile_try_open_bfd (const char *attempt, } } 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 @@ -316,7 +316,7 @@ ldfile_try_open_bfd (const char *attempt, && !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. */ diff --git a/ld/ldlang.c b/ld/ldlang.c index 14a6a577d2..8ab6a0b0c3 100644 --- a/ld/ldlang.c +++ b/ld/ldlang.c @@ -42,9 +42,9 @@ #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)) @@ -3526,7 +3526,7 @@ enum open_bfd_mode 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 @@ -3556,7 +3556,7 @@ open_input_bfds (lang_statement_union_type *s, enum open_bfd_mode mode) 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 @@ -3566,7 +3566,7 @@ open_input_bfds (lang_statement_union_type *s, enum open_bfd_mode mode) do { -#ifdef ENABLE_PLUGINS +#if BFD_SUPPORTS_PLUGINS plugin_insert_save = plugin_insert; #endif undefs = link_info.hash->undefs_tail; @@ -3574,7 +3574,7 @@ open_input_bfds (lang_statement_union_type *s, enum open_bfd_mode mode) 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. */ @@ -3601,7 +3601,7 @@ open_input_bfds (lang_statement_union_type *s, enum open_bfd_mode mode) 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 @@ -3648,7 +3648,7 @@ open_input_bfds (lang_statement_union_type *s, enum open_bfd_mode mode) } } } -#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) @@ -6899,11 +6899,11 @@ lang_check (void) 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, @@ -7438,7 +7438,7 @@ lang_gc_sections (void) LANG_FOR_EACH_INPUT_STATEMENT (f) { asection *sec; -#ifdef ENABLE_PLUGINS +#if BFD_SUPPORTS_PLUGINS if (f->flags.claimed) continue; #endif @@ -7585,7 +7585,7 @@ lang_relax_sections (bfd_boolean need_layout) } } -#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 @@ -7728,7 +7728,7 @@ find_next_input_statement (lang_statement_union_type **s) } return s; } -#endif /* ENABLE_PLUGINS */ +#endif /* BFD_SUPPORTS_PLUGINS */ /* Add NAME to the list of garbage collection entry points. */ @@ -7819,7 +7819,7 @@ lang_process (void) 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; @@ -7922,7 +7922,7 @@ lang_process (void) } } } -#endif /* ENABLE_PLUGINS */ +#endif /* BFD_SUPPORTS_PLUGINS */ /* Make sure that nobody has tried to add a symbol to this list before now. */ diff --git a/ld/ldlang.h b/ld/ldlang.h index 529ccd1585..196debfa37 100644 --- a/ld/ldlang.h +++ b/ld/ldlang.h @@ -271,7 +271,7 @@ struct lang_input_statement_flags /* 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; @@ -280,7 +280,7 @@ struct lang_input_statement_flags /* 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; diff --git a/ld/ldlex.h b/ld/ldlex.h index 6388247b45..7868dca349 100644 --- a/ld/ldlex.h +++ b/ld/ldlex.h @@ -135,10 +135,10 @@ enum option_values 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, diff --git a/ld/ldmain.c b/ld/ldmain.c index b0ce69f118..d34d30ae33 100644 --- a/ld/ldmain.c +++ b/ld/ldmain.c @@ -40,10 +40,10 @@ #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) @@ -164,7 +164,7 @@ static void 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) @@ -323,10 +323,10 @@ main (int argc, char **argv) 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 (); @@ -830,7 +830,7 @@ add_archive_element (struct bfd_link_info *info, (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. */ @@ -851,7 +851,7 @@ add_archive_element (struct bfd_link_info *info, *subsbfd = input->the_bfd; } } -#endif /* ENABLE_PLUGINS */ +#endif /* BFD_SUPPORTS_PLUGINS */ ldlang_add_file (input); diff --git a/ld/lexsup.c b/ld/lexsup.c index d84b334b34..65a9453185 100644 --- a/ld/lexsup.c +++ b/ld/lexsup.c @@ -39,9 +39,9 @@ #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__)) @@ -174,7 +174,7 @@ static const struct ld_option ld_options[] = '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}, @@ -190,7 +190,7 @@ static const struct ld_option ld_options[] = '\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 }, @@ -1066,7 +1066,7 @@ parse_args (unsigned argc, char **argv) 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; @@ -1074,7 +1074,7 @@ parse_args (unsigned argc, char **argv) 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; @@ -1368,9 +1368,9 @@ parse_args (unsigned argc, char **argv) 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': diff --git a/ld/plugin.c b/ld/plugin.c index 60beacd062..b455af6d67 100644 --- a/ld/plugin.c +++ b/ld/plugin.c @@ -21,6 +21,7 @@ #include "sysdep.h" #include "libiberty.h" #include "bfd.h" +#if BFD_SUPPORTS_PLUGINS #include "bfdlink.h" #include "bfdver.h" #include "ctf-api.h" @@ -1462,3 +1463,4 @@ plugin_notice (struct bfd_link_info *info, abfd, section, value, flags); return TRUE; } +#endif /* BFD_SUPPORTS_PLUGINS */ diff --git a/ld/testplug.c b/ld/testplug.c index c126f03607..e386e8d478 100644 --- a/ld/testplug.c +++ b/ld/testplug.c @@ -20,6 +20,7 @@ #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" @@ -669,3 +670,4 @@ oncleanup (void) fflush (NULL); return cleanup_ret; } +#endif /* BFD_SUPPORTS_PLUGINS */ diff --git a/ld/testplug2.c b/ld/testplug2.c index 27553d0781..5b69d0e21b 100644 --- a/ld/testplug2.c +++ b/ld/testplug2.c @@ -21,6 +21,7 @@ #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. */ @@ -669,3 +670,4 @@ oncleanup (void) fflush (NULL); return cleanup_ret; } +#endif /* BFD_SUPPORTS_PLUGINS */ diff --git a/ld/testplug3.c b/ld/testplug3.c index 928f4d6842..3b0e9b3b35 100644 --- a/ld/testplug3.c +++ b/ld/testplug3.c @@ -21,6 +21,7 @@ #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. */ @@ -627,3 +628,4 @@ oncleanup (void) fflush (NULL); return cleanup_ret; } +#endif /* BFD_SUPPORTS_PLUGINS */ diff --git a/ld/testplug4.c b/ld/testplug4.c index ca899b11da..6e41f81298 100644 --- a/ld/testplug4.c +++ b/ld/testplug4.c @@ -21,6 +21,7 @@ #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. */ @@ -675,3 +676,4 @@ oncleanup (void) fflush (NULL); return cleanup_ret; } +#endif /* BFD_SUPPORTS_PLUGINS */ -- 2.34.1