aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bfd/ChangeLog26
-rw-r--r--bfd/Makefile.am257
-rw-r--r--bfd/Makefile.in267
-rw-r--r--bfd/archures.c2
-rw-r--r--bfd/bfd-in.h2
-rw-r--r--bfd/bfd-in2.h4
-rw-r--r--bfd/bfd.c1
-rw-r--r--bfd/config.bfd5
-rwxr-xr-xbfd/configure848
-rw-r--r--bfd/configure.in35
-rw-r--r--bfd/cpu-plugin.c40
-rw-r--r--bfd/doc/Makefile.in3
-rw-r--r--bfd/plugin.c488
-rw-r--r--bfd/plugin.h35
-rw-r--r--bfd/targets.c2
-rw-r--r--binutils/ChangeLog13
-rw-r--r--binutils/NEWS3
-rw-r--r--binutils/ar.c41
-rwxr-xr-xbinutils/configure45
-rw-r--r--binutils/configure.in13
-rw-r--r--binutils/doc/binutils.texi18
-rw-r--r--binutils/nm.c20
22 files changed, 1498 insertions, 670 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 2d8a5e6..9c069d0 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,29 @@
+2009-05-26 Rafael Avila de Espindola <espindola@google.com>
+
+ * Makefile.am: Run "make dep-am".
+ (AM_CPPFLAGS): New.
+ (LIBDL): New.
+ (ALL_MACHINES): Add cpu-plugin.lo.
+ (ALL_MACHINES_CFILES): Add cpu-plugin.c.
+ (BFD32_BACKENDS): Add plugin.lo.
+ (BFD32_BACKENDS_CFILES): Add plugin.c.
+ (libbfd_la_LIBADD): Add LIBDL
+ * archures.c (bfd_architecture): Add bfd_arch_plugin.
+ (bfd_plugin_arch): Declare.
+ * bfd-in.h (BFD_SUPPORTS_PLUGINS): New.
+ * bfd.c (bfd): Add plugin_data.
+ * config.bfd: Handle the plugin target.
+ * configure.in: Check for --enable-plugins.
+ (LT_INIT): Use the dlopen option.
+ * cpu-plugin.c: New.
+ * plugin.c: New.
+ * plugin.h: New.
+ * targets.c (plugin_vec): Declare.
+ (_bfd_target_vector): Add plugin_vec.
+ * Makefile.in: Regenerate.
+ * bfd-in2.h: Regenerate.
+ * configure: Regenerate.
+
2009-05-26 Alan Modra <amodra@bigpond.net.au>
* dep-in.sed: Don't modify .o to .lo here. Output one filename
diff --git a/bfd/Makefile.am b/bfd/Makefile.am
index 62e0b29..d9f76e8 100644
--- a/bfd/Makefile.am
+++ b/bfd/Makefile.am
@@ -26,6 +26,10 @@ bfdlib_LTLIBRARIES = libbfd.la
WARN_CFLAGS = @WARN_CFLAGS@
NO_WERROR = @NO_WERROR@
AM_CFLAGS = $(WARN_CFLAGS)
+AM_CPPFLAGS = -DBINDIR='"$(bindir)"'
+if PLUGINS
+LIBDL = -ldl
+endif
# bfd.h goes here, for now
BFD_H = bfd.h
@@ -74,38 +78,39 @@ ALL_MACHINES = \
cpu-dlx.lo \
cpu-fr30.lo \
cpu-frv.lo \
- cpu-moxie.lo \
cpu-h8300.lo \
cpu-h8500.lo \
cpu-hppa.lo \
- cpu-ia64.lo \
cpu-i370.lo \
cpu-i386.lo \
cpu-i860.lo \
cpu-i960.lo \
+ cpu-ia64.lo \
cpu-ip2k.lo \
cpu-iq2000.lo \
cpu-lm32.lo \
+ cpu-m10200.lo \
+ cpu-m10300.lo \
cpu-m32c.lo \
cpu-m32r.lo \
cpu-m68hc11.lo \
cpu-m68hc12.lo \
cpu-m68k.lo \
cpu-m88k.lo \
- cpu-m10200.lo \
- cpu-m10300.lo \
cpu-maxq.lo \
cpu-mcore.lo \
cpu-mep.lo \
cpu-mips.lo \
cpu-mmix.lo \
- cpu-mt.lo \
+ cpu-moxie.lo \
cpu-msp430.lo \
- cpu-or32.lo \
+ cpu-mt.lo \
cpu-ns32k.lo \
cpu-openrisc.lo \
+ cpu-or32.lo \
cpu-pdp11.lo \
cpu-pj.lo \
+ cpu-plugin.lo \
cpu-powerpc.lo \
cpu-rs6000.lo \
cpu-s390.lo \
@@ -119,11 +124,11 @@ ALL_MACHINES = \
cpu-tic80.lo \
cpu-v850.lo \
cpu-vax.lo \
- cpu-we32k.lo \
cpu-w65.lo \
+ cpu-we32k.lo \
+ cpu-xc16x.lo \
cpu-xstormy16.lo \
cpu-xtensa.lo \
- cpu-xc16x.lo \
cpu-z80.lo \
cpu-z8k.lo
@@ -134,46 +139,47 @@ ALL_MACHINES_CFILES = \
cpu-avr.c \
cpu-bfin.c \
cpu-cr16.c \
- cpu-cris.c \
cpu-cr16c.c \
+ cpu-cris.c \
cpu-crx.c \
cpu-d10v.c \
cpu-d30v.c \
cpu-dlx.c \
cpu-fr30.c \
cpu-frv.c \
- cpu-moxie.c \
cpu-h8300.c \
cpu-h8500.c \
cpu-hppa.c \
- cpu-ia64.c \
cpu-i370.c \
cpu-i386.c \
cpu-i860.c \
cpu-i960.c \
+ cpu-ia64.c \
cpu-ip2k.c \
cpu-iq2000.c \
cpu-lm32.c \
+ cpu-m10200.c \
+ cpu-m10300.c \
cpu-m32c.c \
cpu-m32r.c \
cpu-m68hc11.c \
cpu-m68hc12.c \
cpu-m68k.c \
cpu-m88k.c \
- cpu-m10200.c \
- cpu-m10300.c \
cpu-maxq.c \
cpu-mcore.c \
cpu-mep.c \
cpu-mips.c \
cpu-mmix.c \
- cpu-mt.c \
+ cpu-moxie.c \
cpu-msp430.c \
- cpu-or32.c \
+ cpu-mt.c \
cpu-ns32k.c \
cpu-openrisc.c \
+ cpu-or32.c \
cpu-pdp11.c \
cpu-pj.c \
+ cpu-plugin.c \
cpu-powerpc.c \
cpu-rs6000.c \
cpu-s390.c \
@@ -187,11 +193,11 @@ ALL_MACHINES_CFILES = \
cpu-tic80.c \
cpu-v850.c \
cpu-vax.c \
- cpu-we32k.c \
cpu-w65.c \
+ cpu-we32k.c \
+ cpu-xc16x.c \
cpu-xstormy16.c \
cpu-xtensa.c \
- cpu-xc16x.c \
cpu-z80.c \
cpu-z8k.c
@@ -213,10 +219,10 @@ BFD32_BACKENDS = \
coff-apollo.lo \
coff-arm.lo \
coff-aux.lo \
+ coff-go32.lo \
coff-h8300.lo \
coff-h8500.lo \
coff-i386.lo \
- coff-go32.lo \
coff-i860.lo \
coff-i960.lo \
coff-m68k.lo \
@@ -234,14 +240,20 @@ BFD32_BACKENDS = \
coff-tic54x.lo \
coff-tic80.lo \
coff-u68k.lo \
- coff-we32k.lo \
coff-w65.lo \
+ coff-we32k.lo \
coff-z80.lo \
coff-z8k.lo \
cofflink.lo \
dwarf1.lo \
ecoff.lo \
ecofflink.lo \
+ elf-attrs.lo \
+ elf-eh-frame.lo \
+ elf-m10200.lo \
+ elf-m10300.lo \
+ elf-strtab.lo \
+ elf-vxworks.lo \
elf.lo \
elf32-am33lin.lo \
elf32-arc.lo \
@@ -257,7 +269,6 @@ BFD32_BACKENDS = \
elf32-dlx.lo \
elf32-fr30.lo \
elf32-frv.lo \
- elf32-moxie.lo \
elf32-gen.lo \
elf32-h8300.lo \
elf32-hppa.lo \
@@ -275,51 +286,45 @@ BFD32_BACKENDS = \
elf32-m68hc1x.lo \
elf32-m68k.lo \
elf32-m88k.lo \
- elf-m10200.lo \
- elf-m10300.lo \
elf32-mcore.lo \
elf32-mep.lo \
- elfxx-mips.lo \
elf32-mips.lo \
- elf32-mt.lo \
+ elf32-moxie.lo \
elf32-msp430.lo \
+ elf32-mt.lo \
elf32-openrisc.lo \
elf32-or32.lo \
elf32-pj.lo \
elf32-ppc.lo \
elf32-s390.lo \
- elf32-sh.lo \
elf32-sh-symbian.lo \
- elf32-sh64.lo \
+ elf32-sh.lo \
elf32-sh64-com.lo \
- elfxx-sparc.lo \
+ elf32-sh64.lo \
elf32-sparc.lo \
elf32-spu.lo \
elf32-v850.lo \
elf32-vax.lo \
+ elf32-xc16x.lo \
elf32-xstormy16.lo \
elf32-xtensa.lo \
- elf32-xc16x.lo \
elf32.lo \
elflink.lo \
- elf-attrs.lo \
- elf-strtab.lo \
- elf-eh-frame.lo \
- elf-vxworks.lo \
+ elfxx-mips.lo \
+ elfxx-sparc.lo \
epoc-pe-arm.lo \
epoc-pei-arm.lo \
hp300bsd.lo \
hp300hpux.lo \
- som.lo \
i386aout.lo \
i386bsd.lo \
i386dynix.lo \
i386freebsd.lo \
i386linux.lo \
i386lynx.lo \
+ i386mach3.lo \
i386msdos.lo \
i386netbsd.lo \
- i386mach3.lo \
i386os9k.lo \
ieee.lo \
m68k4knetbsd.lo \
@@ -332,45 +337,47 @@ BFD32_BACKENDS = \
newsos3.lo \
nlm.lo \
nlm32-i386.lo \
- nlm32-sparc.lo \
nlm32-ppc.lo \
+ nlm32-sparc.lo \
nlm32.lo \
ns32knetbsd.lo \
oasys.lo \
pc532-mach.lo \
pdp11.lo \
- pef.lo \
- pe-arm.lo \
- pei-arm.lo \
pe-arm-wince.lo \
- pei-arm-wince.lo \
+ pe-arm.lo \
pe-i386.lo \
- pei-i386.lo \
pe-mcore.lo \
- pei-mcore.lo \
+ pe-mips.lo \
pe-ppc.lo \
- pei-ppc.lo \
pe-sh.lo \
- pei-sh.lo \
- pe-mips.lo \
+ pef.lo \
+ pei-arm-wince.lo \
+ pei-arm.lo \
+ pei-i386.lo \
+ pei-mcore.lo \
pei-mips.lo \
+ pei-ppc.lo \
+ pei-sh.lo \
peigen.lo \
+ plugin.lo \
ppcboot.lo \
reloc16.lo \
riscix.lo \
+ som.lo \
sparclinux.lo \
sparclynx.lo \
sparcnetbsd.lo \
sunos.lo \
- vaxnetbsd.lo \
vax1knetbsd.lo \
vaxbsd.lo \
+ vaxnetbsd.lo \
versados.lo \
- vms.lo \
vms-gsd.lo \
vms-hdr.lo \
vms-misc.lo \
vms-tir.lo \
+ vms.lo \
vmsutil.lo \
xcofflink.lo \
xsym.lo \
@@ -393,11 +400,11 @@ BFD32_BACKENDS_CFILES = \
coff-apollo.c \
coff-arm.c \
coff-aux.c \
+ coff-go32.c \
coff-h8300.c \
coff-h8500.c \
coff-i386.c \
coff-i860.c \
- coff-go32.c \
coff-i960.c \
coff-m68k.c \
coff-m88k.c \
@@ -414,14 +421,20 @@ BFD32_BACKENDS_CFILES = \
coff-tic54x.c \
coff-tic80.c \
coff-u68k.c \
- coff-we32k.c \
coff-w65.c \
+ coff-we32k.c \
coff-z80.c \
coff-z8k.c \
cofflink.c \
dwarf1.c \
ecoff.c \
ecofflink.c \
+ elf-attrs.c \
+ elf-eh-frame.c \
+ elf-m10200.c \
+ elf-m10300.c \
+ elf-strtab.c \
+ elf-vxworks.c \
elf.c \
elf32-am33lin.c \
elf32-arc.c \
@@ -437,7 +450,6 @@ BFD32_BACKENDS_CFILES = \
elf32-dlx.c \
elf32-fr30.c \
elf32-frv.c \
- elf32-moxie.c \
elf32-gen.c \
elf32-h8300.c \
elf32-hppa.c \
@@ -450,56 +462,50 @@ BFD32_BACKENDS_CFILES = \
elf32-lm32.c \
elf32-m32c.c \
elf32-m32r.c \
- elf32-m68k.c \
elf32-m68hc11.c \
elf32-m68hc12.c \
elf32-m68hc1x.c \
+ elf32-m68k.c \
elf32-m88k.c \
- elf-m10200.c \
- elf-m10300.c \
elf32-mcore.c \
elf32-mep.c \
- elfxx-mips.c \
elf32-mips.c \
- elf32-mt.c \
+ elf32-moxie.c \
elf32-msp430.c \
+ elf32-mt.c \
elf32-openrisc.c \
elf32-or32.c \
elf32-pj.c \
elf32-ppc.c \
- elf32-sh64.c \
- elf32-sh64-com.c \
elf32-s390.c \
- elf32-sh.c \
elf32-sh-symbian.c \
- elfxx-sparc.c \
+ elf32-sh.c \
+ elf32-sh64-com.c \
+ elf32-sh64.c \
elf32-sparc.c \
elf32-spu.c \
elf32-v850.c \
elf32-vax.c \
+ elf32-xc16x.c \
elf32-xstormy16.c \
elf32-xtensa.c \
- elf32-xc16x.c \
elf32.c \
elflink.c \
- elf-attrs.c \
- elf-strtab.c \
- elf-eh-frame.c \
- elf-vxworks.c \
+ elfxx-mips.c \
+ elfxx-sparc.c \
epoc-pe-arm.c \
epoc-pei-arm.c \
hp300bsd.c \
hp300hpux.c \
- som.c \
i386aout.c \
i386bsd.c \
i386dynix.c \
i386freebsd.c \
i386linux.c \
i386lynx.c \
+ i386mach3.c \
i386msdos.c \
i386netbsd.c \
- i386mach3.c \
i386os9k.c \
ieee.c \
m68k4knetbsd.c \
@@ -512,44 +518,46 @@ BFD32_BACKENDS_CFILES = \
newsos3.c \
nlm.c \
nlm32-i386.c \
- nlm32-sparc.c \
nlm32-ppc.c \
+ nlm32-sparc.c \
nlm32.c \
ns32knetbsd.c \
oasys.c \
pc532-mach.c \
pdp11.c \
- pef.c \
- pe-arm.c \
- pei-arm.c \
pe-arm-wince.c \
- pei-arm-wince.c \
+ pe-arm.c \
pe-i386.c \
- pei-i386.c \
pe-mcore.c \
- pei-mcore.c \
+ pe-mips.c \
pe-ppc.c \
- pei-ppc.c \
pe-sh.c \
- pei-sh.c \
- pe-mips.c \
+ pef.c \
+ pei-arm-wince.c \
+ pei-arm.c \
+ pei-i386.c \
+ pei-mcore.c \
pei-mips.c \
+ pei-ppc.c \
+ pei-sh.c \
+ plugin.c \
ppcboot.c \
reloc16.c \
riscix.c \
+ som.c \
sparclinux.c \
sparclynx.c \
sparcnetbsd.c \
sunos.c \
- vaxnetbsd.c \
vax1knetbsd.c \
vaxbsd.c \
+ vaxnetbsd.c \
versados.c \
- vms.c \
vms-gsd.c \
vms-hdr.c \
vms-misc.c \
vms-tir.c \
+ vms.c \
vmsutil.c \
xcofflink.c \
xsym.c \
@@ -565,30 +573,30 @@ BFD64_BACKENDS = \
aix5ppc-core.lo \
aout64.lo \
coff-alpha.lo \
+ coff-x86_64.lo \
coff64-rs6000.lo \
demo64.lo \
- pei-ia64.lo \
- elf64-x86-64.lo \
+ elf32-ia64.lo \
+ elf32-score.lo \
+ elf32-score7.lo \
elf64-alpha.lo \
+ elf64-gen.lo \
elf64-hppa.lo \
- elf32-ia64.lo \
elf64-ia64.lo \
- elf64-gen.lo \
- elfn32-mips.lo \
elf64-mips.lo \
elf64-mmix.lo \
- elf32-score.lo \
- elf32-score7.lo \
- elf64-sh64.lo \
elf64-ppc.lo \
elf64-s390.lo \
+ elf64-sh64.lo \
elf64-sparc.lo \
+ elf64-x86-64.lo \
elf64.lo \
+ elfn32-mips.lo \
mmo.lo \
nlm32-alpha.lo \
nlm64.lo \
- coff-x86_64.lo \
pe-x86_64.lo \
+ pei-ia64.lo \
pei-x86_64.lo \
pepigen.lo \
pex64igen.lo
@@ -597,49 +605,49 @@ BFD64_BACKENDS_CFILES = \
aix5ppc-core.c \
aout64.c \
coff-alpha.c \
+ coff-x86_64.c \
coff64-rs6000.c \
demo64.c \
- pei-ia64.c \
- elf64-x86-64.c \
+ elf32-score.c \
+ elf32-score7.c \
elf64-alpha.c \
- elf64-hppa.c \
elf64-gen.c \
- elfn32-mips.c \
+ elf64-hppa.c \
elf64-mips.c \
elf64-mmix.c \
elf64-ppc.c \
elf64-s390.c \
- elf32-score.c \
- elf32-score7.c \
elf64-sh64.c \
elf64-sparc.c \
+ elf64-x86-64.c \
elf64.c \
+ elfn32-mips.c \
mmo.c \
nlm32-alpha.c \
nlm64.c \
- coff-x86_64.c \
pe-x86_64.c \
+ pei-ia64.c \
pei-x86_64.c
OPTIONAL_BACKENDS = \
aix386-core.lo \
+ cisco-core.lo \
hpux-core.lo \
irix-core.lo \
lynx-core.lo \
osf-core.lo \
sco5-core.lo \
- trad-core.lo \
- cisco-core.lo
+ trad-core.lo
OPTIONAL_BACKENDS_CFILES = \
aix386-core.c \
+ cisco-core.c \
hpux-core.c \
irix-core.c \
lynx-core.c \
osf-core.c \
sco5-core.c \
- trad-core.c \
- cisco-core.c
+ trad-core.c
# We want to rerun configure if configure.in, config.bfd or
# configure.host change. configure.in is needed since the version
@@ -789,7 +797,7 @@ ofiles: stamp-ofiles ; @true
# libbfd_la_SOURCES, we put BFD64_LIBS in OFILES instead.
libbfd_la_SOURCES = $(BFD32_LIBS_CFILES)
libbfd_la_DEPENDENCIES = $(OFILES) ofiles
-libbfd_la_LIBADD = `cat ofiles` @SHARED_LIBADD@
+libbfd_la_LIBADD = `cat ofiles` @SHARED_LIBADD@ $(LIBDL)
libbfd_la_LDFLAGS = -release `cat libtool-soversion` @SHARED_LDFLAGS@
# libtool will build .libs/libbfd.a. We create libbfd.a in the build
@@ -1276,10 +1284,6 @@ cpu-frv.lo: \
cpu-frv.c \
$(INCDIR)/filenames.h \
$(INCDIR)/hashtab.h
-cpu-moxie.lo: \
- cpu-moxie.c \
- $(INCDIR)/filenames.h \
- $(INCDIR)/hashtab.h
cpu-h8300.lo: \
cpu-h8300.c \
$(INCDIR)/filenames.h \
@@ -1380,14 +1384,18 @@ cpu-mmix.lo: \
cpu-mmix.c \
$(INCDIR)/filenames.h \
$(INCDIR)/hashtab.h
-cpu-mt.lo: \
- cpu-mt.c \
+cpu-moxie.lo: \
+ cpu-moxie.c \
$(INCDIR)/filenames.h \
$(INCDIR)/hashtab.h
cpu-msp430.lo: \
cpu-msp430.c \
$(INCDIR)/filenames.h \
$(INCDIR)/hashtab.h
+cpu-mt.lo: \
+ cpu-mt.c \
+ $(INCDIR)/filenames.h \
+ $(INCDIR)/hashtab.h
cpu-or32.lo: \
cpu-or32.c \
$(INCDIR)/filenames.h \
@@ -1409,6 +1417,10 @@ cpu-pj.lo: \
cpu-pj.c \
$(INCDIR)/filenames.h \
$(INCDIR)/hashtab.h
+cpu-plugin.lo: \
+ cpu-plugin.c \
+ $(INCDIR)/filenames.h \
+ $(INCDIR)/hashtab.h
cpu-powerpc.lo: \
cpu-powerpc.c \
$(INCDIR)/filenames.h \
@@ -2199,18 +2211,6 @@ elf32-frv.lo: \
$(INCDIR)/hashtab.h \
elf-bfd.h \
elf32-target.h
-elf32-moxie.lo: \
- elf32-moxie.c \
- $(INCDIR)/bfdlink.h \
- $(INCDIR)/elf/common.h \
- $(INCDIR)/elf/external.h \
- $(INCDIR)/elf/internal.h \
- $(INCDIR)/elf/moxie.h \
- $(INCDIR)/elf/reloc-macros.h \
- $(INCDIR)/filenames.h \
- $(INCDIR)/hashtab.h \
- elf-bfd.h \
- elf32-target.h
elf32-gen.lo: \
elf32-gen.c \
$(INCDIR)/bfdlink.h \
@@ -2513,13 +2513,13 @@ elf32-mips.lo: \
elf32-target.h \
elfxx-mips.h \
genlink.h
-elf32-mt.lo: \
- elf32-mt.c \
+elf32-moxie.lo: \
+ elf32-moxie.c \
$(INCDIR)/bfdlink.h \
$(INCDIR)/elf/common.h \
$(INCDIR)/elf/external.h \
$(INCDIR)/elf/internal.h \
- $(INCDIR)/elf/mt.h \
+ $(INCDIR)/elf/moxie.h \
$(INCDIR)/elf/reloc-macros.h \
$(INCDIR)/filenames.h \
$(INCDIR)/hashtab.h \
@@ -2538,6 +2538,18 @@ elf32-msp430.lo: \
$(INCDIR)/libiberty.h \
elf-bfd.h \
elf32-target.h
+elf32-mt.lo: \
+ elf32-mt.c \
+ $(INCDIR)/bfdlink.h \
+ $(INCDIR)/elf/common.h \
+ $(INCDIR)/elf/external.h \
+ $(INCDIR)/elf/internal.h \
+ $(INCDIR)/elf/mt.h \
+ $(INCDIR)/elf/reloc-macros.h \
+ $(INCDIR)/filenames.h \
+ $(INCDIR)/hashtab.h \
+ elf-bfd.h \
+ elf32-target.h
elf32-openrisc.lo: \
elf32-openrisc.c \
$(INCDIR)/bfdlink.h \
@@ -3402,6 +3414,13 @@ pei-mips.lo: \
libpei.h \
pe-mips.c \
peicode.h
+plugin.lo: \
+ plugin.c \
+ $(INCDIR)/plugin-api.h \
+ $(INCDIR)/filenames.h \
+ plugin.h \
+ $(INCDIR)/hashtab.h \
+ $(INCDIR)/libiberty.h
ppcboot.lo: \
ppcboot.c \
$(INCDIR)/filenames.h \
diff --git a/bfd/Makefile.in b/bfd/Makefile.in
index 1f293f4..3f6a7ed 100644
--- a/bfd/Makefile.in
+++ b/bfd/Makefile.in
@@ -84,6 +84,7 @@ am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
am__installdirs = "$(DESTDIR)$(bfdlibdir)"
bfdlibLTLIBRARIES_INSTALL = $(INSTALL)
LTLIBRARIES = $(bfdlib_LTLIBRARIES)
+am__DEPENDENCIES_1 =
am__objects_1 = archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo \
cache.lo coffgen.lo corefile.lo format.lo init.lo libbfd.lo \
opncls.lo reloc.lo section.lo syms.lo targets.lo hash.lo \
@@ -199,6 +200,8 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKGVERSION = @PKGVERSION@
+PLUGINS_FALSE = @PLUGINS_FALSE@
+PLUGINS_TRUE = @PLUGINS_TRUE@
POSUB = @POSUB@
RANLIB = @RANLIB@
REPORT_BUGS_TEXI = @REPORT_BUGS_TEXI@
@@ -273,6 +276,7 @@ prefix = @prefix@
program_transform_name = @program_transform_name@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
+supports_plugins = @supports_plugins@
sysconfdir = @sysconfdir@
target = @target@
target_alias = @target_alias@
@@ -294,6 +298,8 @@ SUBDIRS = doc po
bfddocdir = doc
bfdlib_LTLIBRARIES = libbfd.la
AM_CFLAGS = $(WARN_CFLAGS)
+AM_CPPFLAGS = -DBINDIR='"$(bindir)"'
+@PLUGINS_TRUE@LIBDL = -ldl
# bfd.h goes here, for now
BFD_H = bfd.h
@@ -341,38 +347,39 @@ ALL_MACHINES = \
cpu-dlx.lo \
cpu-fr30.lo \
cpu-frv.lo \
- cpu-moxie.lo \
cpu-h8300.lo \
cpu-h8500.lo \
cpu-hppa.lo \
- cpu-ia64.lo \
cpu-i370.lo \
cpu-i386.lo \
cpu-i860.lo \
cpu-i960.lo \
+ cpu-ia64.lo \
cpu-ip2k.lo \
cpu-iq2000.lo \
cpu-lm32.lo \
+ cpu-m10200.lo \
+ cpu-m10300.lo \
cpu-m32c.lo \
cpu-m32r.lo \
cpu-m68hc11.lo \
cpu-m68hc12.lo \
cpu-m68k.lo \
cpu-m88k.lo \
- cpu-m10200.lo \
- cpu-m10300.lo \
cpu-maxq.lo \
cpu-mcore.lo \
cpu-mep.lo \
cpu-mips.lo \
cpu-mmix.lo \
- cpu-mt.lo \
+ cpu-moxie.lo \
cpu-msp430.lo \
- cpu-or32.lo \
+ cpu-mt.lo \
cpu-ns32k.lo \
cpu-openrisc.lo \
+ cpu-or32.lo \
cpu-pdp11.lo \
cpu-pj.lo \
+ cpu-plugin.lo \
cpu-powerpc.lo \
cpu-rs6000.lo \
cpu-s390.lo \
@@ -386,11 +393,11 @@ ALL_MACHINES = \
cpu-tic80.lo \
cpu-v850.lo \
cpu-vax.lo \
- cpu-we32k.lo \
cpu-w65.lo \
+ cpu-we32k.lo \
+ cpu-xc16x.lo \
cpu-xstormy16.lo \
cpu-xtensa.lo \
- cpu-xc16x.lo \
cpu-z80.lo \
cpu-z8k.lo
@@ -401,46 +408,47 @@ ALL_MACHINES_CFILES = \
cpu-avr.c \
cpu-bfin.c \
cpu-cr16.c \
- cpu-cris.c \
cpu-cr16c.c \
+ cpu-cris.c \
cpu-crx.c \
cpu-d10v.c \
cpu-d30v.c \
cpu-dlx.c \
cpu-fr30.c \
cpu-frv.c \
- cpu-moxie.c \
cpu-h8300.c \
cpu-h8500.c \
cpu-hppa.c \
- cpu-ia64.c \
cpu-i370.c \
cpu-i386.c \
cpu-i860.c \
cpu-i960.c \
+ cpu-ia64.c \
cpu-ip2k.c \
cpu-iq2000.c \
cpu-lm32.c \
+ cpu-m10200.c \
+ cpu-m10300.c \
cpu-m32c.c \
cpu-m32r.c \
cpu-m68hc11.c \
cpu-m68hc12.c \
cpu-m68k.c \
cpu-m88k.c \
- cpu-m10200.c \
- cpu-m10300.c \
cpu-maxq.c \
cpu-mcore.c \
cpu-mep.c \
cpu-mips.c \
cpu-mmix.c \
- cpu-mt.c \
+ cpu-moxie.c \
cpu-msp430.c \
- cpu-or32.c \
+ cpu-mt.c \
cpu-ns32k.c \
cpu-openrisc.c \
+ cpu-or32.c \
cpu-pdp11.c \
cpu-pj.c \
+ cpu-plugin.c \
cpu-powerpc.c \
cpu-rs6000.c \
cpu-s390.c \
@@ -454,11 +462,11 @@ ALL_MACHINES_CFILES = \
cpu-tic80.c \
cpu-v850.c \
cpu-vax.c \
- cpu-we32k.c \
cpu-w65.c \
+ cpu-we32k.c \
+ cpu-xc16x.c \
cpu-xstormy16.c \
cpu-xtensa.c \
- cpu-xc16x.c \
cpu-z80.c \
cpu-z8k.c
@@ -481,10 +489,10 @@ BFD32_BACKENDS = \
coff-apollo.lo \
coff-arm.lo \
coff-aux.lo \
+ coff-go32.lo \
coff-h8300.lo \
coff-h8500.lo \
coff-i386.lo \
- coff-go32.lo \
coff-i860.lo \
coff-i960.lo \
coff-m68k.lo \
@@ -502,14 +510,20 @@ BFD32_BACKENDS = \
coff-tic54x.lo \
coff-tic80.lo \
coff-u68k.lo \
- coff-we32k.lo \
coff-w65.lo \
+ coff-we32k.lo \
coff-z80.lo \
coff-z8k.lo \
cofflink.lo \
dwarf1.lo \
ecoff.lo \
ecofflink.lo \
+ elf-attrs.lo \
+ elf-eh-frame.lo \
+ elf-m10200.lo \
+ elf-m10300.lo \
+ elf-strtab.lo \
+ elf-vxworks.lo \
elf.lo \
elf32-am33lin.lo \
elf32-arc.lo \
@@ -525,7 +539,6 @@ BFD32_BACKENDS = \
elf32-dlx.lo \
elf32-fr30.lo \
elf32-frv.lo \
- elf32-moxie.lo \
elf32-gen.lo \
elf32-h8300.lo \
elf32-hppa.lo \
@@ -543,51 +556,45 @@ BFD32_BACKENDS = \
elf32-m68hc1x.lo \
elf32-m68k.lo \
elf32-m88k.lo \
- elf-m10200.lo \
- elf-m10300.lo \
elf32-mcore.lo \
elf32-mep.lo \
- elfxx-mips.lo \
elf32-mips.lo \
- elf32-mt.lo \
+ elf32-moxie.lo \
elf32-msp430.lo \
+ elf32-mt.lo \
elf32-openrisc.lo \
elf32-or32.lo \
elf32-pj.lo \
elf32-ppc.lo \
elf32-s390.lo \
- elf32-sh.lo \
elf32-sh-symbian.lo \
- elf32-sh64.lo \
+ elf32-sh.lo \
elf32-sh64-com.lo \
- elfxx-sparc.lo \
+ elf32-sh64.lo \
elf32-sparc.lo \
elf32-spu.lo \
elf32-v850.lo \
elf32-vax.lo \
+ elf32-xc16x.lo \
elf32-xstormy16.lo \
elf32-xtensa.lo \
- elf32-xc16x.lo \
elf32.lo \
elflink.lo \
- elf-attrs.lo \
- elf-strtab.lo \
- elf-eh-frame.lo \
- elf-vxworks.lo \
+ elfxx-mips.lo \
+ elfxx-sparc.lo \
epoc-pe-arm.lo \
epoc-pei-arm.lo \
hp300bsd.lo \
hp300hpux.lo \
- som.lo \
i386aout.lo \
i386bsd.lo \
i386dynix.lo \
i386freebsd.lo \
i386linux.lo \
i386lynx.lo \
+ i386mach3.lo \
i386msdos.lo \
i386netbsd.lo \
- i386mach3.lo \
i386os9k.lo \
ieee.lo \
m68k4knetbsd.lo \
@@ -600,45 +607,47 @@ BFD32_BACKENDS = \
newsos3.lo \
nlm.lo \
nlm32-i386.lo \
- nlm32-sparc.lo \
nlm32-ppc.lo \
+ nlm32-sparc.lo \
nlm32.lo \
ns32knetbsd.lo \
oasys.lo \
pc532-mach.lo \
pdp11.lo \
- pef.lo \
- pe-arm.lo \
- pei-arm.lo \
pe-arm-wince.lo \
- pei-arm-wince.lo \
+ pe-arm.lo \
pe-i386.lo \
- pei-i386.lo \
pe-mcore.lo \
- pei-mcore.lo \
+ pe-mips.lo \
pe-ppc.lo \
- pei-ppc.lo \
pe-sh.lo \
- pei-sh.lo \
- pe-mips.lo \
+ pef.lo \
+ pei-arm-wince.lo \
+ pei-arm.lo \
+ pei-i386.lo \
+ pei-mcore.lo \
pei-mips.lo \
+ pei-ppc.lo \
+ pei-sh.lo \
peigen.lo \
+ plugin.lo \
ppcboot.lo \
reloc16.lo \
riscix.lo \
+ som.lo \
sparclinux.lo \
sparclynx.lo \
sparcnetbsd.lo \
sunos.lo \
- vaxnetbsd.lo \
vax1knetbsd.lo \
vaxbsd.lo \
+ vaxnetbsd.lo \
versados.lo \
- vms.lo \
vms-gsd.lo \
vms-hdr.lo \
vms-misc.lo \
vms-tir.lo \
+ vms.lo \
vmsutil.lo \
xcofflink.lo \
xsym.lo \
@@ -661,11 +670,11 @@ BFD32_BACKENDS_CFILES = \
coff-apollo.c \
coff-arm.c \
coff-aux.c \
+ coff-go32.c \
coff-h8300.c \
coff-h8500.c \
coff-i386.c \
coff-i860.c \
- coff-go32.c \
coff-i960.c \
coff-m68k.c \
coff-m88k.c \
@@ -682,14 +691,20 @@ BFD32_BACKENDS_CFILES = \
coff-tic54x.c \
coff-tic80.c \
coff-u68k.c \
- coff-we32k.c \
coff-w65.c \
+ coff-we32k.c \
coff-z80.c \
coff-z8k.c \
cofflink.c \
dwarf1.c \
ecoff.c \
ecofflink.c \
+ elf-attrs.c \
+ elf-eh-frame.c \
+ elf-m10200.c \
+ elf-m10300.c \
+ elf-strtab.c \
+ elf-vxworks.c \
elf.c \
elf32-am33lin.c \
elf32-arc.c \
@@ -705,7 +720,6 @@ BFD32_BACKENDS_CFILES = \
elf32-dlx.c \
elf32-fr30.c \
elf32-frv.c \
- elf32-moxie.c \
elf32-gen.c \
elf32-h8300.c \
elf32-hppa.c \
@@ -718,56 +732,50 @@ BFD32_BACKENDS_CFILES = \
elf32-lm32.c \
elf32-m32c.c \
elf32-m32r.c \
- elf32-m68k.c \
elf32-m68hc11.c \
elf32-m68hc12.c \
elf32-m68hc1x.c \
+ elf32-m68k.c \
elf32-m88k.c \
- elf-m10200.c \
- elf-m10300.c \
elf32-mcore.c \
elf32-mep.c \
- elfxx-mips.c \
elf32-mips.c \
- elf32-mt.c \
+ elf32-moxie.c \
elf32-msp430.c \
+ elf32-mt.c \
elf32-openrisc.c \
elf32-or32.c \
elf32-pj.c \
elf32-ppc.c \
- elf32-sh64.c \
- elf32-sh64-com.c \
elf32-s390.c \
- elf32-sh.c \
elf32-sh-symbian.c \
- elfxx-sparc.c \
+ elf32-sh.c \
+ elf32-sh64-com.c \
+ elf32-sh64.c \
elf32-sparc.c \
elf32-spu.c \
elf32-v850.c \
elf32-vax.c \
+ elf32-xc16x.c \
elf32-xstormy16.c \
elf32-xtensa.c \
- elf32-xc16x.c \
elf32.c \
elflink.c \
- elf-attrs.c \
- elf-strtab.c \
- elf-eh-frame.c \
- elf-vxworks.c \
+ elfxx-mips.c \
+ elfxx-sparc.c \
epoc-pe-arm.c \
epoc-pei-arm.c \
hp300bsd.c \
hp300hpux.c \
- som.c \
i386aout.c \
i386bsd.c \
i386dynix.c \
i386freebsd.c \
i386linux.c \
i386lynx.c \
+ i386mach3.c \
i386msdos.c \
i386netbsd.c \
- i386mach3.c \
i386os9k.c \
ieee.c \
m68k4knetbsd.c \
@@ -780,44 +788,46 @@ BFD32_BACKENDS_CFILES = \
newsos3.c \
nlm.c \
nlm32-i386.c \
- nlm32-sparc.c \
nlm32-ppc.c \
+ nlm32-sparc.c \
nlm32.c \
ns32knetbsd.c \
oasys.c \
pc532-mach.c \
pdp11.c \
- pef.c \
- pe-arm.c \
- pei-arm.c \
pe-arm-wince.c \
- pei-arm-wince.c \
+ pe-arm.c \
pe-i386.c \
- pei-i386.c \
pe-mcore.c \
- pei-mcore.c \
+ pe-mips.c \
pe-ppc.c \
- pei-ppc.c \
pe-sh.c \
- pei-sh.c \
- pe-mips.c \
+ pef.c \
+ pei-arm-wince.c \
+ pei-arm.c \
+ pei-i386.c \
+ pei-mcore.c \
pei-mips.c \
+ pei-ppc.c \
+ pei-sh.c \
+ plugin.c \
ppcboot.c \
reloc16.c \
riscix.c \
+ som.c \
sparclinux.c \
sparclynx.c \
sparcnetbsd.c \
sunos.c \
- vaxnetbsd.c \
vax1knetbsd.c \
vaxbsd.c \
+ vaxnetbsd.c \
versados.c \
- vms.c \
vms-gsd.c \
vms-hdr.c \
vms-misc.c \
vms-tir.c \
+ vms.c \
vmsutil.c \
xcofflink.c \
xsym.c \
@@ -834,30 +844,30 @@ BFD64_BACKENDS = \
aix5ppc-core.lo \
aout64.lo \
coff-alpha.lo \
+ coff-x86_64.lo \
coff64-rs6000.lo \
demo64.lo \
- pei-ia64.lo \
- elf64-x86-64.lo \
+ elf32-ia64.lo \
+ elf32-score.lo \
+ elf32-score7.lo \
elf64-alpha.lo \
+ elf64-gen.lo \
elf64-hppa.lo \
- elf32-ia64.lo \
elf64-ia64.lo \
- elf64-gen.lo \
- elfn32-mips.lo \
elf64-mips.lo \
elf64-mmix.lo \
- elf32-score.lo \
- elf32-score7.lo \
- elf64-sh64.lo \
elf64-ppc.lo \
elf64-s390.lo \
+ elf64-sh64.lo \
elf64-sparc.lo \
+ elf64-x86-64.lo \
elf64.lo \
+ elfn32-mips.lo \
mmo.lo \
nlm32-alpha.lo \
nlm64.lo \
- coff-x86_64.lo \
pe-x86_64.lo \
+ pei-ia64.lo \
pei-x86_64.lo \
pepigen.lo \
pex64igen.lo
@@ -866,49 +876,49 @@ BFD64_BACKENDS_CFILES = \
aix5ppc-core.c \
aout64.c \
coff-alpha.c \
+ coff-x86_64.c \
coff64-rs6000.c \
demo64.c \
- pei-ia64.c \
- elf64-x86-64.c \
+ elf32-score.c \
+ elf32-score7.c \
elf64-alpha.c \
- elf64-hppa.c \
elf64-gen.c \
- elfn32-mips.c \
+ elf64-hppa.c \
elf64-mips.c \
elf64-mmix.c \
elf64-ppc.c \
elf64-s390.c \
- elf32-score.c \
- elf32-score7.c \
elf64-sh64.c \
elf64-sparc.c \
+ elf64-x86-64.c \
elf64.c \
+ elfn32-mips.c \
mmo.c \
nlm32-alpha.c \
nlm64.c \
- coff-x86_64.c \
pe-x86_64.c \
+ pei-ia64.c \
pei-x86_64.c
OPTIONAL_BACKENDS = \
aix386-core.lo \
+ cisco-core.lo \
hpux-core.lo \
irix-core.lo \
lynx-core.lo \
osf-core.lo \
sco5-core.lo \
- trad-core.lo \
- cisco-core.lo
+ trad-core.lo
OPTIONAL_BACKENDS_CFILES = \
aix386-core.c \
+ cisco-core.c \
hpux-core.c \
irix-core.c \
lynx-core.c \
osf-core.c \
sco5-core.c \
- trad-core.c \
- cisco-core.c
+ trad-core.c
# We want to rerun configure if configure.in, config.bfd or
@@ -970,7 +980,7 @@ OFILES = $(BFD_BACKENDS) $(BFD_MACHINES) @COREFILE@ @bfd64_libs@
# libbfd_la_SOURCES, we put BFD64_LIBS in OFILES instead.
libbfd_la_SOURCES = $(BFD32_LIBS_CFILES)
libbfd_la_DEPENDENCIES = $(OFILES) ofiles
-libbfd_la_LIBADD = `cat ofiles` @SHARED_LIBADD@
+libbfd_la_LIBADD = `cat ofiles` @SHARED_LIBADD@ $(LIBDL)
libbfd_la_LDFLAGS = -release `cat libtool-soversion` @SHARED_LDFLAGS@
# libtool will build .libs/libbfd.a. We create libbfd.a in the build
@@ -1006,15 +1016,15 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
- echo ' cd $(srcdir) && $(AUTOMAKE) --cygnus '; \
- cd $(srcdir) && $(AUTOMAKE) --cygnus \
+ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \
+ cd $(srcdir) && $(AUTOMAKE) --foreign \
&& exit 0; \
exit 1;; \
esac; \
done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile'; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
cd $(top_srcdir) && \
- $(AUTOMAKE) --cygnus Makefile
+ $(AUTOMAKE) --foreign Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
@@ -1874,10 +1884,6 @@ cpu-frv.lo: \
cpu-frv.c \
$(INCDIR)/filenames.h \
$(INCDIR)/hashtab.h
-cpu-moxie.lo: \
- cpu-moxie.c \
- $(INCDIR)/filenames.h \
- $(INCDIR)/hashtab.h
cpu-h8300.lo: \
cpu-h8300.c \
$(INCDIR)/filenames.h \
@@ -1978,14 +1984,18 @@ cpu-mmix.lo: \
cpu-mmix.c \
$(INCDIR)/filenames.h \
$(INCDIR)/hashtab.h
-cpu-mt.lo: \
- cpu-mt.c \
+cpu-moxie.lo: \
+ cpu-moxie.c \
$(INCDIR)/filenames.h \
$(INCDIR)/hashtab.h
cpu-msp430.lo: \
cpu-msp430.c \
$(INCDIR)/filenames.h \
$(INCDIR)/hashtab.h
+cpu-mt.lo: \
+ cpu-mt.c \
+ $(INCDIR)/filenames.h \
+ $(INCDIR)/hashtab.h
cpu-or32.lo: \
cpu-or32.c \
$(INCDIR)/filenames.h \
@@ -2007,6 +2017,10 @@ cpu-pj.lo: \
cpu-pj.c \
$(INCDIR)/filenames.h \
$(INCDIR)/hashtab.h
+cpu-plugin.lo: \
+ cpu-plugin.c \
+ $(INCDIR)/filenames.h \
+ $(INCDIR)/hashtab.h
cpu-powerpc.lo: \
cpu-powerpc.c \
$(INCDIR)/filenames.h \
@@ -2797,18 +2811,6 @@ elf32-frv.lo: \
$(INCDIR)/hashtab.h \
elf-bfd.h \
elf32-target.h
-elf32-moxie.lo: \
- elf32-moxie.c \
- $(INCDIR)/bfdlink.h \
- $(INCDIR)/elf/common.h \
- $(INCDIR)/elf/external.h \
- $(INCDIR)/elf/internal.h \
- $(INCDIR)/elf/moxie.h \
- $(INCDIR)/elf/reloc-macros.h \
- $(INCDIR)/filenames.h \
- $(INCDIR)/hashtab.h \
- elf-bfd.h \
- elf32-target.h
elf32-gen.lo: \
elf32-gen.c \
$(INCDIR)/bfdlink.h \
@@ -3111,13 +3113,13 @@ elf32-mips.lo: \
elf32-target.h \
elfxx-mips.h \
genlink.h
-elf32-mt.lo: \
- elf32-mt.c \
+elf32-moxie.lo: \
+ elf32-moxie.c \
$(INCDIR)/bfdlink.h \
$(INCDIR)/elf/common.h \
$(INCDIR)/elf/external.h \
$(INCDIR)/elf/internal.h \
- $(INCDIR)/elf/mt.h \
+ $(INCDIR)/elf/moxie.h \
$(INCDIR)/elf/reloc-macros.h \
$(INCDIR)/filenames.h \
$(INCDIR)/hashtab.h \
@@ -3136,6 +3138,18 @@ elf32-msp430.lo: \
$(INCDIR)/libiberty.h \
elf-bfd.h \
elf32-target.h
+elf32-mt.lo: \
+ elf32-mt.c \
+ $(INCDIR)/bfdlink.h \
+ $(INCDIR)/elf/common.h \
+ $(INCDIR)/elf/external.h \
+ $(INCDIR)/elf/internal.h \
+ $(INCDIR)/elf/mt.h \
+ $(INCDIR)/elf/reloc-macros.h \
+ $(INCDIR)/filenames.h \
+ $(INCDIR)/hashtab.h \
+ elf-bfd.h \
+ elf32-target.h
elf32-openrisc.lo: \
elf32-openrisc.c \
$(INCDIR)/bfdlink.h \
@@ -4000,6 +4014,13 @@ pei-mips.lo: \
libpei.h \
pe-mips.c \
peicode.h
+plugin.lo: \
+ plugin.c \
+ $(INCDIR)/plugin-api.h \
+ $(INCDIR)/filenames.h \
+ plugin.h \
+ $(INCDIR)/hashtab.h \
+ $(INCDIR)/libiberty.h
ppcboot.lo: \
ppcboot.c \
$(INCDIR)/filenames.h \
diff --git a/bfd/archures.c b/bfd/archures.c
index 0a78542..9e84b88 100644
--- a/bfd/archures.c
+++ b/bfd/archures.c
@@ -204,6 +204,7 @@ DESCRIPTION
.#define bfd_mach_h8300sx 6
.#define bfd_mach_h8300sxn 7
. bfd_arch_pdp11, {* DEC PDP-11 *}
+. bfd_arch_plugin,
. bfd_arch_powerpc, {* PowerPC *}
.#define bfd_mach_ppc 32
.#define bfd_mach_ppc64 64
@@ -501,6 +502,7 @@ extern const bfd_arch_info_type bfd_openrisc_arch;
extern const bfd_arch_info_type bfd_or32_arch;
extern const bfd_arch_info_type bfd_pdp11_arch;
extern const bfd_arch_info_type bfd_pj_arch;
+extern const bfd_arch_info_type bfd_plugin_arch;
extern const bfd_arch_info_type bfd_powerpc_archs[];
#define bfd_powerpc_arch bfd_powerpc_archs[0]
extern const bfd_arch_info_type bfd_rs6000_arch;
diff --git a/bfd/bfd-in.h b/bfd/bfd-in.h
index 9bd4e38..6ad1633 100644
--- a/bfd/bfd-in.h
+++ b/bfd/bfd-in.h
@@ -66,6 +66,8 @@ extern "C" {
#define LITSTRCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2))
+#define BFD_SUPPORTS_PLUGINS @supports_plugins@
+
/* The word size used by BFD on the host. This may be 64 with a 32
bit target if the host is 64 bit, or if other 64 bit targets have
been selected with --enable-targets, or if --enable-64-bit-bfd. */
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
index 15135bd..7a28129 100644
--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -73,6 +73,8 @@ extern "C" {
#define LITSTRCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2))
+#define BFD_SUPPORTS_PLUGINS @supports_plugins@
+
/* The word size used by BFD on the host. This may be 64 with a 32
bit target if the host is 64 bit, or if other 64 bit targets have
been selected with --enable-targets, or if --enable-64-bit-bfd. */
@@ -1848,6 +1850,7 @@ enum bfd_architecture
#define bfd_mach_h8300sx 6
#define bfd_mach_h8300sxn 7
bfd_arch_pdp11, /* DEC PDP-11 */
+ bfd_arch_plugin,
bfd_arch_powerpc, /* PowerPC */
#define bfd_mach_ppc 32
#define bfd_mach_ppc64 64
@@ -4889,6 +4892,7 @@ struct bfd
struct netbsd_core_struct *netbsd_core_data;
struct mach_o_data_struct *mach_o_data;
struct mach_o_fat_data_struct *mach_o_fat_data;
+ struct plugin_data_struct *plugin_data;
struct bfd_pef_data_struct *pef_data;
struct bfd_pef_xlib_data_struct *pef_xlib_data;
struct bfd_sym_data_struct *sym_data;
diff --git a/bfd/bfd.c b/bfd/bfd.c
index 3be7a63..4a1b5ca 100644
--- a/bfd/bfd.c
+++ b/bfd/bfd.c
@@ -241,6 +241,7 @@ CODE_FRAGMENT
. struct netbsd_core_struct *netbsd_core_data;
. struct mach_o_data_struct *mach_o_data;
. struct mach_o_fat_data_struct *mach_o_fat_data;
+. struct plugin_data_struct *plugin_data;
. struct bfd_pef_data_struct *pef_data;
. struct bfd_pef_xlib_data_struct *pef_xlib_data;
. struct bfd_sym_data_struct *sym_data;
diff --git a/bfd/config.bfd b/bfd/config.bfd
index 56894ad..545d848 100644
--- a/bfd/config.bfd
+++ b/bfd/config.bfd
@@ -137,6 +137,11 @@ case "${targ}" in
exit 1
;;
+ plugin)
+ targ_defvec=plugin_vec
+ targ_selvecs="plugin_vec"
+ ;;
+
# START OF targmatch.h
#ifdef BFD64
alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
diff --git a/bfd/configure b/bfd/configure
index 3f7c69c..fe32d999 100755
--- a/bfd/configure
+++ b/bfd/configure
@@ -458,7 +458,7 @@ ac_includes_default="\
# include <unistd.h>
#endif"
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE AR ac_ct_AR RANLIB ac_ct_RANLIB CPP EGREP LIBTOOL SED FGREP GREP LD DUMPBIN ac_ct_DUMPBIN NM LN_S OBJDUMP ac_ct_OBJDUMP lt_ECHO DSYMUTIL ac_ct_DSYMUTIL NMEDIT ac_ct_NMEDIT LIPO ac_ct_LIPO OTOOL ac_ct_OTOOL OTOOL64 ac_ct_OTOOL64 DEBUGDIR PKGVERSION REPORT_BUGS_TO REPORT_BUGS_TEXI WARN_CFLAGS NO_WERROR MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT GENINSRC_NEVER_TRUE GENINSRC_NEVER_FALSE INSTALL_LIBBFD_TRUE INSTALL_LIBBFD_FALSE host_noncanonical target_noncanonical bfdlibdir bfdincludedir USE_NLS LIBINTL LIBINTL_DEP INCINTL XGETTEXT GMSGFMT POSUB CATALOGS DATADIRNAME INSTOBJEXT GENCAT CATOBJEXT MKINSTALLDIRS MSGFMT MSGMERGE HDEFINES BFD_HOST_64BIT_LONG BFD_HOST_64BIT_LONG_LONG BFD_HOST_64_BIT_DEFINED BFD_HOST_64_BIT BFD_HOST_U_64_BIT BFD_HOSTPTR_T CC_FOR_BUILD EXEEXT_FOR_BUILD COREFILE COREFLAG LIBM SHARED_LDFLAGS SHARED_LIBADD TDEFINES wordsize bfd64_libs all_backends bfd_backends bfd_machines bfd_default_target_size bfd_file_ptr bfd_ufile_ptr tdefaults datarootdir docdir htmldir pdfdir LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE AR ac_ct_AR RANLIB ac_ct_RANLIB CPP EGREP LIBTOOL SED FGREP GREP LD DUMPBIN ac_ct_DUMPBIN NM LN_S OBJDUMP ac_ct_OBJDUMP lt_ECHO DSYMUTIL ac_ct_DSYMUTIL NMEDIT ac_ct_NMEDIT LIPO ac_ct_LIPO OTOOL ac_ct_OTOOL OTOOL64 ac_ct_OTOOL64 PLUGINS_TRUE PLUGINS_FALSE DEBUGDIR PKGVERSION REPORT_BUGS_TO REPORT_BUGS_TEXI WARN_CFLAGS NO_WERROR MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT GENINSRC_NEVER_TRUE GENINSRC_NEVER_FALSE INSTALL_LIBBFD_TRUE INSTALL_LIBBFD_FALSE host_noncanonical target_noncanonical bfdlibdir bfdincludedir USE_NLS LIBINTL LIBINTL_DEP INCINTL XGETTEXT GMSGFMT POSUB CATALOGS DATADIRNAME INSTOBJEXT GENCAT CATOBJEXT MKINSTALLDIRS MSGFMT MSGMERGE HDEFINES BFD_HOST_64BIT_LONG BFD_HOST_64BIT_LONG_LONG BFD_HOST_64_BIT_DEFINED BFD_HOST_64_BIT BFD_HOST_U_64_BIT BFD_HOSTPTR_T CC_FOR_BUILD EXEEXT_FOR_BUILD COREFILE COREFLAG LIBM SHARED_LDFLAGS SHARED_LIBADD TDEFINES wordsize bfd64_libs all_backends bfd_backends bfd_machines bfd_default_target_size supports_plugins bfd_file_ptr bfd_ufile_ptr tdefaults datarootdir docdir htmldir pdfdir LIBOBJS LTLIBOBJS'
ac_subst_files=''
ac_pwd=`pwd`
@@ -1004,12 +1004,13 @@ Optional Features:
--enable-dependency-tracking do not reject slow dependency extractors
--enable-shared[=PKGS]
build shared libraries [default=no]
- --disable-largefile omit support for large files
--enable-static[=PKGS]
build static libraries [default=yes]
--enable-fast-install[=PKGS]
optimize for fast installation [default=yes]
--disable-libtool-lock avoid locking (might break parallel builds)
+ --enable-plugins linker plugins (defaults no)
+ --disable-largefile omit support for large files
--enable-64-bit-bfd 64-bit support (on hosts with narrower word sizes)
--enable-targets alternative target configurations
--enable-secureplt Default to creating read-only plt entries
@@ -4934,385 +4935,6 @@ _ACEOF
-case "${target}" in
- sparc-*-solaris*|i[3-7]86-*-solaris*)
- # On native 32bit sparc and ia32 solaris, large-file and procfs support
- # are mutually exclusive; and without procfs support, the elf module
- # cannot provide certain routines such as elfcore_write_prpsinfo
- # or elfcore_write_prstatus. So unless the user explicitly requested
- # large-file support through the --enable-largefile switch, disable
- # large-file support in favor of procfs support.
- if test "${target}" = "${host}" -a "$enable_largefile" != 'yes'; then
- enable_largefile="no"
- fi
- ;;
-esac
-
-# Check whether --enable-largefile or --disable-largefile was given.
-if test "${enable_largefile+set}" = set; then
- enableval="$enable_largefile"
-
-fi;
-if test "$enable_largefile" != no; then
-
- echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5
-echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6
-if test "${ac_cv_sys_largefile_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_cv_sys_largefile_CC=no
- if test "$GCC" != yes; then
- ac_save_CC=$CC
- while :; do
- # IRIX 6.2 and later do not support large files by default,
- # so use the C compiler's -n32 option if that helps.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <sys/types.h>
- /* Check that off_t can represent 2**63 - 1 correctly.
- We can't simply define LARGE_OFF_T to be 9223372036854775807,
- since some C++ compilers masquerading as C compilers
- incorrectly reject 9223372036854775807. */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
- int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
- && LARGE_OFF_T % 2147483647 == 1)
- ? 1 : -1];
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
- rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- break
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-fi
-rm -f conftest.err conftest.$ac_objext
- CC="$CC -n32"
- rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_sys_largefile_CC=' -n32'; break
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-fi
-rm -f conftest.err conftest.$ac_objext
- break
- done
- CC=$ac_save_CC
- rm -f conftest.$ac_ext
- fi
-fi
-echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5
-echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6
- if test "$ac_cv_sys_largefile_CC" != no; then
- CC=$CC$ac_cv_sys_largefile_CC
- fi
-
- echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5
-echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6
-if test "${ac_cv_sys_file_offset_bits+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- while :; do
- ac_cv_sys_file_offset_bits=no
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <sys/types.h>
- /* Check that off_t can represent 2**63 - 1 correctly.
- We can't simply define LARGE_OFF_T to be 9223372036854775807,
- since some C++ compilers masquerading as C compilers
- incorrectly reject 9223372036854775807. */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
- int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
- && LARGE_OFF_T % 2147483647 == 1)
- ? 1 : -1];
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- break
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#define _FILE_OFFSET_BITS 64
-#include <sys/types.h>
- /* Check that off_t can represent 2**63 - 1 correctly.
- We can't simply define LARGE_OFF_T to be 9223372036854775807,
- since some C++ compilers masquerading as C compilers
- incorrectly reject 9223372036854775807. */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
- int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
- && LARGE_OFF_T % 2147483647 == 1)
- ? 1 : -1];
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_sys_file_offset_bits=64; break
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- break
-done
-fi
-echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5
-echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6
-if test "$ac_cv_sys_file_offset_bits" != no; then
-
-cat >>confdefs.h <<_ACEOF
-#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
-_ACEOF
-
-fi
-rm -f conftest*
- echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5
-echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6
-if test "${ac_cv_sys_large_files+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- while :; do
- ac_cv_sys_large_files=no
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <sys/types.h>
- /* Check that off_t can represent 2**63 - 1 correctly.
- We can't simply define LARGE_OFF_T to be 9223372036854775807,
- since some C++ compilers masquerading as C compilers
- incorrectly reject 9223372036854775807. */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
- int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
- && LARGE_OFF_T % 2147483647 == 1)
- ? 1 : -1];
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- break
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#define _LARGE_FILES 1
-#include <sys/types.h>
- /* Check that off_t can represent 2**63 - 1 correctly.
- We can't simply define LARGE_OFF_T to be 9223372036854775807,
- since some C++ compilers masquerading as C compilers
- incorrectly reject 9223372036854775807. */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
- int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
- && LARGE_OFF_T % 2147483647 == 1)
- ? 1 : -1];
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_sys_large_files=1; break
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- break
-done
-fi
-echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5
-echo "${ECHO_T}$ac_cv_sys_large_files" >&6
-if test "$ac_cv_sys_large_files" != no; then
-
-cat >>confdefs.h <<_ACEOF
-#define _LARGE_FILES $ac_cv_sys_large_files
-_ACEOF
-
-fi
-rm -f conftest*
-fi
-
-
case `pwd` in
*\ * | *\ *)
{ echo "$as_me:$LINENO: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
@@ -5719,13 +5341,13 @@ if test "${lt_cv_nm_interface+set}" = set; then
else
lt_cv_nm_interface="BSD nm"
echo "int some_variable = 0;" > conftest.$ac_ext
- (eval echo "\"\$as_me:5722: $ac_compile\"" >&5)
+ (eval echo "\"\$as_me:5344: $ac_compile\"" >&5)
(eval "$ac_compile" 2>conftest.err)
cat conftest.err >&5
- (eval echo "\"\$as_me:5725: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
+ (eval echo "\"\$as_me:5347: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
(eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
cat conftest.err >&5
- (eval echo "\"\$as_me:5728: output\"" >&5)
+ (eval echo "\"\$as_me:5350: output\"" >&5)
cat conftest.out >&5
if $GREP 'External.*some_variable' conftest.out > /dev/null; then
lt_cv_nm_interface="MS dumpbin"
@@ -6882,7 +6504,7 @@ ia64-*-hpux*)
;;
*-*-irix6*)
# Find out which ABI we are using.
- echo '#line 6885 "configure"' > conftest.$ac_ext
+ echo '#line 6507 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
@@ -7689,11 +7311,10 @@ done
# Set options
+enable_dlopen=yes
- enable_dlopen=no
-
enable_win32_dll=no
@@ -8158,11 +7779,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:8161: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:7782: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:8165: \$? = $ac_status" >&5
+ echo "$as_me:7786: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -8497,11 +8118,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:8500: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:8121: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:8504: \$? = $ac_status" >&5
+ echo "$as_me:8125: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -8602,11 +8223,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:8605: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:8226: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:8609: \$? = $ac_status" >&5
+ echo "$as_me:8230: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -8657,11 +8278,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:8660: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:8281: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:8664: \$? = $ac_status" >&5
+ echo "$as_me:8285: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -11469,7 +11090,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11472 "configure"
+#line 11093 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -11565,7 +11186,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11568 "configure"
+#line 11189 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -11793,6 +11414,421 @@ CC="$lt_save_CC"
+# Check whether --enable-plugins or --disable-plugins was given.
+if test "${enable_plugins+set}" = set; then
+ enableval="$enable_plugins"
+ case "${enableval}" in
+ yes | "") plugins=yes ;;
+ no) plugins=no ;;
+ *) plugins=yes ;;
+ esac
+else
+ plugins=no
+fi;
+
+
+
+if test "$plugins" = "yes"; then
+ PLUGINS_TRUE=
+ PLUGINS_FALSE='#'
+else
+ PLUGINS_TRUE='#'
+ PLUGINS_FALSE=
+fi
+
+
+if test "$plugins" = "yes"; then
+ if test "$enable_dlopen" != "yes" ; then
+ { { echo "$as_me:$LINENO: error:
+ Building BFD with plugin support requires a host that supports -ldl." >&5
+echo "$as_me: error:
+ Building BFD with plugin support requires a host that supports -ldl." >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+ enable_targets="$enable_targets plugin"
+fi
+
+case "${target}" in
+ sparc-*-solaris*|i[3-7]86-*-solaris*)
+ # On native 32bit sparc and ia32 solaris, large-file and procfs support
+ # are mutually exclusive; and without procfs support, the elf module
+ # cannot provide certain routines such as elfcore_write_prpsinfo
+ # or elfcore_write_prstatus. So unless the user explicitly requested
+ # large-file support through the --enable-largefile switch, disable
+ # large-file support in favor of procfs support.
+ if test "${target}" = "${host}" -a "$enable_largefile" != 'yes'; then
+ if test "$plugins" = "no"; then
+ enable_largefile="no"
+ fi
+ fi
+ ;;
+esac
+
+# Check whether --enable-largefile or --disable-largefile was given.
+if test "${enable_largefile+set}" = set; then
+ enableval="$enable_largefile"
+
+fi;
+if test "$enable_largefile" != no; then
+
+ echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5
+echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6
+if test "${ac_cv_sys_largefile_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_sys_largefile_CC=no
+ if test "$GCC" != yes; then
+ ac_save_CC=$CC
+ while :; do
+ # IRIX 6.2 and later do not support large files by default,
+ # so use the C compiler's -n32 option if that helps.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext
+ CC="$CC -n32"
+ rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_sys_largefile_CC=' -n32'; break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext
+ break
+ done
+ CC=$ac_save_CC
+ rm -f conftest.$ac_ext
+ fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5
+echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6
+ if test "$ac_cv_sys_largefile_CC" != no; then
+ CC=$CC$ac_cv_sys_largefile_CC
+ fi
+
+ echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5
+echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6
+if test "${ac_cv_sys_file_offset_bits+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ while :; do
+ ac_cv_sys_file_offset_bits=no
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#define _FILE_OFFSET_BITS 64
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_sys_file_offset_bits=64; break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ break
+done
+fi
+echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5
+echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6
+if test "$ac_cv_sys_file_offset_bits" != no; then
+
+cat >>confdefs.h <<_ACEOF
+#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
+_ACEOF
+
+fi
+rm -f conftest*
+ echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5
+echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6
+if test "${ac_cv_sys_large_files+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ while :; do
+ ac_cv_sys_large_files=no
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#define _LARGE_FILES 1
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_sys_large_files=1; break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ break
+done
+fi
+echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5
+echo "${ECHO_T}$ac_cv_sys_large_files" >&6
+if test "$ac_cv_sys_large_files" != no; then
+
+cat >>confdefs.h <<_ACEOF
+#define _LARGE_FILES $ac_cv_sys_large_files
+_ACEOF
+
+fi
+rm -f conftest*
+fi
+
+
# Check whether --enable-64-bit-bfd or --disable-64-bit-bfd was given.
if test "${enable_64_bit_bfd+set}" = set; then
enableval="$enable_64_bit_bfd"
@@ -21150,6 +21186,7 @@ do
pef_vec) tb="$tb pef.lo" ;;
pef_xlib_vec) tb="$tb pef.lo" ;;
pdp11_aout_vec) tb="$tb pdp11.lo" ;;
+ plugin_vec) tb="$tb plugin.lo" ;;
pmac_xcoff_vec) tb="$tb coff-rs6000.lo xcofflink.lo" ;;
ppcboot_vec) tb="$tb ppcboot.lo" ;;
riscix_vec) tb="$tb aout32.lo riscix.lo" ;;
@@ -21319,6 +21356,13 @@ esac
+if test "$plugins" = "yes"; then
+ supports_plugins=1
+else
+ supports_plugins=0
+fi
+
+
# Determine the host dependant file_ptr a.k.a. off_t type. In order
# prefer: off64_t - if ftello64 and fseeko64, off_t - if ftello and
# fseeko, long. This assumes that sizeof off_t is .ge. sizeof long.
@@ -22531,6 +22575,13 @@ echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
Usually this means the macro was only invoked conditionally." >&2;}
{ (exit 1); exit 1; }; }
fi
+if test -z "${PLUGINS_TRUE}" && test -z "${PLUGINS_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"PLUGINS\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"PLUGINS\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
{ { echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined.
Usually this means the macro was only invoked conditionally." >&5
@@ -23450,6 +23501,8 @@ s,@OTOOL@,$OTOOL,;t t
s,@ac_ct_OTOOL@,$ac_ct_OTOOL,;t t
s,@OTOOL64@,$OTOOL64,;t t
s,@ac_ct_OTOOL64@,$ac_ct_OTOOL64,;t t
+s,@PLUGINS_TRUE@,$PLUGINS_TRUE,;t t
+s,@PLUGINS_FALSE@,$PLUGINS_FALSE,;t t
s,@DEBUGDIR@,$DEBUGDIR,;t t
s,@PKGVERSION@,$PKGVERSION,;t t
s,@REPORT_BUGS_TO@,$REPORT_BUGS_TO,;t t
@@ -23503,6 +23556,7 @@ s,@all_backends@,$all_backends,;t t
s,@bfd_backends@,$bfd_backends,;t t
s,@bfd_machines@,$bfd_machines,;t t
s,@bfd_default_target_size@,$bfd_default_target_size,;t t
+s,@supports_plugins@,$supports_plugins,;t t
s,@bfd_file_ptr@,$bfd_file_ptr,;t t
s,@bfd_ufile_ptr@,$bfd_ufile_ptr,;t t
s,@tdefaults@,$tdefaults,;t t
diff --git a/bfd/configure.in b/bfd/configure.in
index 81255dd..c7dd581 100644
--- a/bfd/configure.in
+++ b/bfd/configure.in
@@ -23,6 +23,27 @@ AC_PROG_CC
AC_GNU_SOURCE
AC_USE_SYSTEM_EXTENSIONS
+LT_INIT([dlopen])
+
+AC_ARG_ENABLE([plugins],
+AS_HELP_STRING([--enable-plugins], [linker plugins (defaults no)]),
+[case "${enableval}" in
+ yes | "") plugins=yes ;;
+ no) plugins=no ;;
+ *) plugins=yes ;;
+ esac],
+[plugins=no])
+
+AM_CONDITIONAL(PLUGINS, test "$plugins" = "yes")
+
+if test "$plugins" = "yes"; then
+ if test "$enable_dlopen" != "yes" ; then
+ AC_MSG_ERROR([
+ Building BFD with plugin support requires a host that supports -ldl.])
+ fi
+ enable_targets="$enable_targets plugin"
+fi
+
case "${target}" in
changequote(,)dnl
sparc-*-solaris*|i[3-7]86-*-solaris*)
@@ -34,15 +55,15 @@ changequote([,])dnl
# large-file support through the --enable-largefile switch, disable
# large-file support in favor of procfs support.
if test "${target}" = "${host}" -a "$enable_largefile" != 'yes'; then
- enable_largefile="no"
+ if test "$plugins" = "no"; then
+ enable_largefile="no"
+ fi
fi
;;
esac
AC_SYS_LARGEFILE
-LT_INIT
-
AC_ARG_ENABLE(64-bit-bfd,
[ --enable-64-bit-bfd 64-bit support (on hosts with narrower word sizes)],
[case "${enableval}" in
@@ -871,6 +892,7 @@ do
pef_vec) tb="$tb pef.lo" ;;
pef_xlib_vec) tb="$tb pef.lo" ;;
pdp11_aout_vec) tb="$tb pdp11.lo" ;;
+ plugin_vec) tb="$tb plugin.lo" ;;
pmac_xcoff_vec) tb="$tb coff-rs6000.lo xcofflink.lo" ;;
ppcboot_vec) tb="$tb ppcboot.lo" ;;
riscix_vec) tb="$tb aout32.lo riscix.lo" ;;
@@ -1018,6 +1040,13 @@ AC_SUBST(bfd_backends)
AC_SUBST(bfd_machines)
AC_SUBST(bfd_default_target_size)
+if test "$plugins" = "yes"; then
+ supports_plugins=1
+else
+ supports_plugins=0
+fi
+AC_SUBST(supports_plugins)
+
# Determine the host dependant file_ptr a.k.a. off_t type. In order
# prefer: off64_t - if ftello64 and fseeko64, off_t - if ftello and
# fseeko, long. This assumes that sizeof off_t is .ge. sizeof long.
diff --git a/bfd/cpu-plugin.c b/bfd/cpu-plugin.c
new file mode 100644
index 0000000..f0f7dbd
--- /dev/null
+++ b/bfd/cpu-plugin.c
@@ -0,0 +1,40 @@
+/* BFD support for plugins.
+ Copyright 2009
+ Free Software Foundation, Inc.
+
+ This file is part of BFD, the Binary File Descriptor library.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
+ MA 02110-1301, USA. */
+
+#include "sysdep.h"
+#include "bfd.h"
+#include "libbfd.h"
+
+const bfd_arch_info_type bfd_plugin_arch =
+{
+ 32, /* 32 bits in a word. */
+ 32, /* 32 bits in an address. */
+ 8, /* 8 bits in a byte. */
+ bfd_arch_plugin,
+ 0, /* Only 1 machine. */
+ "plugin",
+ "plugin",
+ 3,
+ TRUE,
+ bfd_default_compatible,
+ bfd_default_scan,
+ 0
+};
diff --git a/bfd/doc/Makefile.in b/bfd/doc/Makefile.in
index 2c54e29..e2ce0b1 100644
--- a/bfd/doc/Makefile.in
+++ b/bfd/doc/Makefile.in
@@ -171,6 +171,8 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKGVERSION = @PKGVERSION@
+PLUGINS_FALSE = @PLUGINS_FALSE@
+PLUGINS_TRUE = @PLUGINS_TRUE@
POSUB = @POSUB@
RANLIB = @RANLIB@
REPORT_BUGS_TEXI = @REPORT_BUGS_TEXI@
@@ -245,6 +247,7 @@ prefix = @prefix@
program_transform_name = @program_transform_name@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
+supports_plugins = @supports_plugins@
sysconfdir = @sysconfdir@
target = @target@
target_alias = @target_alias@
diff --git a/bfd/plugin.c b/bfd/plugin.c
new file mode 100644
index 0000000..49395e8
--- /dev/null
+++ b/bfd/plugin.c
@@ -0,0 +1,488 @@
+/* Plugin support for BFD.
+ Copyright 2009
+ Free Software Foundation, Inc.
+
+ This file is part of BFD, the Binary File Descriptor library.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
+ MA 02110-1301, USA. */
+
+#include "config.h"
+#include <assert.h>
+#include <dlfcn.h>
+#include <stdarg.h>
+#include "plugin-api.h"
+#include "sysdep.h"
+#include "plugin.h"
+#include "libbfd.h"
+#include "libiberty.h"
+#include <dirent.h>
+
+#define bfd_plugin_close_and_cleanup _bfd_generic_close_and_cleanup
+#define bfd_plugin_bfd_free_cached_info _bfd_generic_bfd_free_cached_info
+#define bfd_plugin_new_section_hook _bfd_generic_new_section_hook
+#define bfd_plugin_get_section_contents _bfd_generic_get_section_contents
+#define bfd_plugin_get_section_contents_in_window _bfd_generic_get_section_contents_in_window
+#define bfd_plugin_bfd_copy_private_header_data _bfd_generic_bfd_copy_private_header_data
+#define bfd_plugin_bfd_merge_private_bfd_data _bfd_generic_bfd_merge_private_bfd_data
+#define bfd_plugin_bfd_copy_private_header_data _bfd_generic_bfd_copy_private_header_data
+#define bfd_plugin_bfd_set_private_flags _bfd_generic_bfd_set_private_flags
+#define bfd_plugin_core_file_matches_executable_p generic_core_file_matches_executable_p
+#define bfd_plugin_bfd_is_local_label_name _bfd_nosymbols_bfd_is_local_label_name
+#define bfd_plugin_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
+#define bfd_plugin_get_lineno _bfd_nosymbols_get_lineno
+#define bfd_plugin_find_nearest_line _bfd_nosymbols_find_nearest_line
+#define bfd_plugin_find_inliner_info _bfd_nosymbols_find_inliner_info
+#define bfd_plugin_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
+#define bfd_plugin_read_minisymbols _bfd_generic_read_minisymbols
+#define bfd_plugin_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol
+#define bfd_plugin_set_arch_mach bfd_default_set_arch_mach
+#define bfd_plugin_set_section_contents _bfd_generic_set_section_contents
+#define bfd_plugin_bfd_get_relocated_section_contents bfd_generic_get_relocated_section_contents
+#define bfd_plugin_bfd_relax_section bfd_generic_relax_section
+#define bfd_plugin_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
+#define bfd_plugin_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
+#define bfd_plugin_bfd_link_add_symbols _bfd_generic_link_add_symbols
+#define bfd_plugin_bfd_link_just_syms _bfd_generic_link_just_syms
+#define bfd_plugin_bfd_final_link _bfd_generic_final_link
+#define bfd_plugin_bfd_link_split_section _bfd_generic_link_split_section
+#define bfd_plugin_bfd_gc_sections bfd_generic_gc_sections
+#define bfd_plugin_bfd_merge_sections bfd_generic_merge_sections
+#define bfd_plugin_bfd_is_group_section bfd_generic_is_group_section
+#define bfd_plugin_bfd_discard_group bfd_generic_discard_group
+#define bfd_plugin_section_already_linked _bfd_generic_section_already_linked
+#define bfd_plugin_bfd_define_common_symbol bfd_generic_define_common_symbol
+
+static enum ld_plugin_status
+message (int level ATTRIBUTE_UNUSED,
+ const char * format, ...)
+{
+ va_list args;
+ va_start (args, format);
+ printf ("bfd plugin: ");
+ vprintf (format, args);
+ va_end (args);
+ return LDPS_OK;
+}
+
+/* Register a claim-file handler. */
+static ld_plugin_claim_file_handler claim_file;
+
+static enum ld_plugin_status
+register_claim_file (ld_plugin_claim_file_handler handler)
+{
+ claim_file = handler;
+ return LDPS_OK;
+}
+
+static enum ld_plugin_status
+add_symbols (void * handle,
+ int nsyms,
+ const struct ld_plugin_symbol * syms)
+{
+ bfd *abfd = handle;
+ struct plugin_data_struct *plugin_data =
+ bfd_alloc (abfd, sizeof (plugin_data_struct));;
+
+ plugin_data->nsyms = nsyms;
+ plugin_data->syms = syms;
+
+ if (nsyms != 0)
+ abfd->flags |= HAS_SYMS;
+
+ abfd->tdata.plugin_data = plugin_data;
+ return LDPS_OK;
+}
+
+extern char *program_name __attribute__ ((weak));
+
+static int
+try_load_plugin (const char *pname)
+{
+ static void *plugin_handle;
+ int tv_size = 4;
+ struct ld_plugin_tv tv[tv_size];
+ int i;
+ ld_plugin_onload onload;
+ enum ld_plugin_status status;
+
+ plugin_handle = dlopen (pname, RTLD_NOW);
+ if (!plugin_handle)
+ {
+ (*_bfd_error_handler)("%s\n", dlerror ());
+ return 0;
+ }
+
+ onload = dlsym (plugin_handle, "onload");
+ if (!onload)
+ goto err;
+
+ i = 0;
+ tv[i].tv_tag = LDPT_MESSAGE;
+ tv[i].tv_u.tv_message = message;
+
+ ++i;
+ tv[i].tv_tag = LDPT_REGISTER_CLAIM_FILE_HOOK;
+ tv[i].tv_u.tv_register_claim_file = register_claim_file;
+
+ ++i;
+ tv[i].tv_tag = LDPT_ADD_SYMBOLS;
+ tv[i].tv_u.tv_add_symbols = add_symbols;
+
+ ++i;
+ tv[i].tv_tag = LDPT_NULL;
+ tv[i].tv_u.tv_val = 0;
+
+ status = (*onload)(tv);
+
+ if (status != LDPS_OK)
+ goto err;
+
+ if (!claim_file)
+ goto err;
+
+ return 1;
+
+ err:
+ plugin_handle = NULL;
+ return 0;
+}
+
+static const char *plugin_name;
+
+void
+bfd_plugin_set_plugin (const char *p)
+{
+ plugin_name = p;
+}
+
+static int
+load_plugin (void)
+{
+ char *plugin_dir;
+ char *p;
+ DIR *d;
+ struct dirent *ent;
+ int found = 0;
+
+ if (plugin_name)
+ return try_load_plugin (plugin_name);
+
+ if (!program_name)
+ return 0;
+
+ plugin_dir = concat (BINDIR, "/../lib/bfd-plugins", NULL);
+ p = make_relative_prefix (program_name,
+ BINDIR,
+ plugin_dir);
+ free (plugin_dir);
+ plugin_dir = NULL;
+
+ d = opendir (p);
+ if (!d)
+ goto out;
+
+ while ((ent = readdir (d)))
+ {
+ char *full_name;
+ if (ent->d_type != DT_REG && ent->d_type != DT_LNK)
+ continue;
+
+ full_name = concat (p, "/", ent->d_name, NULL);
+ found = try_load_plugin (full_name);
+ free (full_name);
+ if (found)
+ break;
+ }
+
+ out:
+ free (p);
+ if (d)
+ closedir (d);
+
+ return found;
+}
+
+
+static const bfd_target *
+bfd_plugin_object_p (bfd *abfd)
+{
+ int claimed = 0;
+ int t = load_plugin ();
+ struct ld_plugin_input_file file;
+ if (!t)
+ return NULL;
+
+ file.name = abfd->filename;
+
+ if (abfd->iostream)
+ {
+ file.fd = fileno (abfd->iostream);
+ file.offset = 0;
+ file.filesize = 0; /*FIXME*/
+ }
+ else
+ {
+ bfd *archive = abfd->my_archive;
+ BFD_ASSERT (archive);
+ file.fd = fileno (archive->iostream);
+ file.offset = abfd->origin;
+ file.filesize = arelt_size (abfd);
+
+ }
+ file.handle = abfd;
+ claim_file (&file, &claimed);
+ if (!claimed)
+ return NULL;
+
+ return abfd->xvec;
+}
+
+/* Copy any private info we understand from the input bfd
+ to the output bfd. */
+
+static bfd_boolean
+bfd_plugin_bfd_copy_private_bfd_data (bfd *ibfd ATTRIBUTE_UNUSED,
+ bfd *obfd ATTRIBUTE_UNUSED)
+{
+ BFD_ASSERT (0);
+ return TRUE;
+}
+
+/* Copy any private info we understand from the input section
+ to the output section. */
+
+static bfd_boolean
+bfd_plugin_bfd_copy_private_section_data (bfd *ibfd ATTRIBUTE_UNUSED,
+ asection *isection ATTRIBUTE_UNUSED,
+ bfd *obfd ATTRIBUTE_UNUSED,
+ asection *osection ATTRIBUTE_UNUSED)
+{
+ BFD_ASSERT (0);
+ return TRUE;
+}
+
+/* Copy any private info we understand from the input symbol
+ to the output symbol. */
+
+static bfd_boolean
+bfd_plugin_bfd_copy_private_symbol_data (bfd *ibfd ATTRIBUTE_UNUSED,
+ asymbol *isymbol ATTRIBUTE_UNUSED,
+ bfd *obfd ATTRIBUTE_UNUSED,
+ asymbol *osymbol ATTRIBUTE_UNUSED)
+{
+ BFD_ASSERT (0);
+ return TRUE;
+}
+
+static bfd_boolean
+bfd_plugin_bfd_print_private_bfd_data (bfd *abfd ATTRIBUTE_UNUSED, PTR ptr ATTRIBUTE_UNUSED)
+{
+ BFD_ASSERT (0);
+ return TRUE;
+}
+
+static char *
+bfd_plugin_core_file_failing_command (bfd *abfd ATTRIBUTE_UNUSED)
+{
+ BFD_ASSERT (0);
+ return NULL;
+}
+
+static int
+bfd_plugin_core_file_failing_signal (bfd *abfd ATTRIBUTE_UNUSED)
+{
+ BFD_ASSERT (0);
+ return 0;
+}
+
+static long
+bfd_plugin_get_symtab_upper_bound (bfd *abfd)
+{
+ struct plugin_data_struct *plugin_data = abfd->tdata.plugin_data;
+ long nsyms = plugin_data->nsyms;
+
+ BFD_ASSERT (nsyms >= 0);
+
+ return ((nsyms + 1) * sizeof (asymbol *));
+}
+
+static flagword
+convert_flags (const struct ld_plugin_symbol *sym)
+{
+ switch (sym->def)
+ {
+ case LDPK_DEF:
+ case LDPK_COMMON:
+ case LDPK_UNDEF:
+ return BSF_GLOBAL;
+
+ case LDPK_WEAKUNDEF:
+ case LDPK_WEAKDEF:
+ return BSF_GLOBAL | BSF_WEAK;
+
+ default:
+ BFD_ASSERT (0);
+ return 0;
+ }
+}
+
+static long
+bfd_plugin_canonicalize_symtab (bfd *abfd,
+ asymbol **alocation)
+{
+ struct plugin_data_struct *plugin_data = abfd->tdata.plugin_data;
+ long nsyms = plugin_data->nsyms;
+ const struct ld_plugin_symbol *syms = plugin_data->syms;
+ static asection fake_section;
+ static asection fake_common_section;
+ int i;
+
+ fake_section.name = ".text";
+ fake_common_section.flags = SEC_IS_COMMON;
+
+ for (i = 0; i < nsyms; i++)
+ {
+ asymbol *s = bfd_alloc (abfd, sizeof (asymbol));
+
+ BFD_ASSERT (s);
+ alocation[i] = s;
+
+ s->the_bfd = abfd;
+ s->name = syms[i].name;
+ s->value = 0;
+ s->flags = convert_flags (&syms[i]);
+ switch (syms[i].def)
+ {
+ case LDPK_COMMON:
+ s->section = &fake_common_section;
+ break;
+ case LDPK_UNDEF:
+ case LDPK_WEAKUNDEF:
+ s->section = bfd_und_section_ptr;
+ break;
+ case LDPK_DEF:
+ case LDPK_WEAKDEF:
+ s->section = &fake_section;
+ break;
+ default:
+ BFD_ASSERT (0);
+ }
+
+ s->udata.p = (void *) &syms[i];
+ }
+
+ return nsyms;
+}
+
+static void
+bfd_plugin_print_symbol (bfd *abfd ATTRIBUTE_UNUSED,
+ PTR afile ATTRIBUTE_UNUSED,
+ asymbol *symbol ATTRIBUTE_UNUSED,
+ bfd_print_symbol_type how ATTRIBUTE_UNUSED)
+{
+ BFD_ASSERT (0);
+}
+
+static void
+bfd_plugin_get_symbol_info (bfd *abfd ATTRIBUTE_UNUSED,
+ asymbol *symbol,
+ symbol_info *ret)
+{
+ bfd_symbol_info (symbol, ret);
+}
+
+/* Make an empty symbol. */
+
+static asymbol *
+bfd_plugin_make_empty_symbol (bfd *abfd)
+{
+ asymbol *new = bfd_zalloc (abfd, sizeof (asymbol));
+ if (new == NULL)
+ return new;
+ new->the_bfd = abfd;
+ return new;
+}
+
+static int
+bfd_plugin_sizeof_headers (bfd *a ATTRIBUTE_UNUSED,
+ struct bfd_link_info *info ATTRIBUTE_UNUSED)
+{
+ BFD_ASSERT (0);
+ return 0;
+}
+
+static bfd_boolean
+bfd_plugin_mkobject (bfd *abfd ATTRIBUTE_UNUSED)
+{
+ BFD_ASSERT (0);
+ return 0;
+}
+
+const bfd_target plugin_vec =
+{
+ "plugin", /* Name. */
+ bfd_target_unknown_flavour,
+ BFD_ENDIAN_LITTLE, /* Target byte order. */
+ BFD_ENDIAN_LITTLE, /* Target headers byte order. */
+ (HAS_RELOC | EXEC_P | /* Object flags. */
+ HAS_LINENO | HAS_DEBUG |
+ HAS_SYMS | HAS_LOCALS | DYNAMIC | WP_TEXT | D_PAGED),
+ (SEC_CODE | SEC_DATA | SEC_ROM | SEC_HAS_CONTENTS
+ | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* Section flags. */
+ 0, /* symbol_leading_char. */
+ '/', /* ar_pad_char. */
+ 15, /* ar_max_namelen. */
+
+ bfd_getl64, bfd_getl_signed_64, bfd_putl64,
+ bfd_getl32, bfd_getl_signed_32, bfd_putl32,
+ bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */
+ bfd_getl64, bfd_getl_signed_64, bfd_putl64,
+ bfd_getl32, bfd_getl_signed_32, bfd_putl32,
+ bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */
+
+ { /* bfd_check_format. */
+ _bfd_dummy_target,
+ bfd_plugin_object_p,
+ bfd_generic_archive_p,
+ _bfd_dummy_target
+ },
+ { /* bfd_set_format. */
+ bfd_false,
+ bfd_plugin_mkobject,
+ _bfd_generic_mkarchive,
+ bfd_false,
+ },
+ { /* bfd_write_contents. */
+ bfd_false,
+ bfd_false,
+ _bfd_write_archive_contents,
+ bfd_false,
+ },
+
+ BFD_JUMP_TABLE_GENERIC (bfd_plugin),
+ BFD_JUMP_TABLE_COPY (bfd_plugin),
+ BFD_JUMP_TABLE_CORE (bfd_plugin),
+ BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff),
+ BFD_JUMP_TABLE_SYMBOLS (bfd_plugin),
+ BFD_JUMP_TABLE_RELOCS (_bfd_norelocs),
+ BFD_JUMP_TABLE_WRITE (bfd_plugin),
+ BFD_JUMP_TABLE_LINK (bfd_plugin),
+ BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
+
+ NULL,
+
+ NULL /* backend_data. */
+};
diff --git a/bfd/plugin.h b/bfd/plugin.h
new file mode 100644
index 0000000..2fae2de
--- /dev/null
+++ b/bfd/plugin.h
@@ -0,0 +1,35 @@
+/* Plugin support for BFD.
+ Copyright 2009 Free Software Foundation, Inc.
+
+ This file is part of BFD, the Binary File Descriptor library.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
+ MA 02110-1301, USA. */
+
+#ifndef _PLUGIN_H_
+#define _PLUGIN_H_
+
+#include "bfd.h"
+
+void bfd_plugin_set_plugin (const char *);
+
+typedef struct plugin_data_struct
+{
+ int nsyms;
+ const struct ld_plugin_symbol *syms;
+}
+plugin_data_struct;
+
+#endif
diff --git a/bfd/targets.c b/bfd/targets.c
index 57a400d..6ec6a6c 100644
--- a/bfd/targets.c
+++ b/bfd/targets.c
@@ -766,6 +766,7 @@ extern const bfd_target pc532netbsd_vec;
extern const bfd_target pdp11_aout_vec;
extern const bfd_target pef_vec;
extern const bfd_target pef_xlib_vec;
+extern const bfd_target plugin_vec;
extern const bfd_target pmac_xcoff_vec;
extern const bfd_target ppcboot_vec;
extern const bfd_target riscix_vec;
@@ -1144,6 +1145,7 @@ static const bfd_target * const _bfd_target_vector[] =
&pdp11_aout_vec,
&pef_vec,
&pef_xlib_vec,
+ &plugin_vec,
#if 0
/* This has the same magic number as RS/6000. */
&pmac_xcoff_vec,
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index ff0e640..12ea1d1 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,16 @@
+2009-05-26 Rafael Avila de Espindola <espindola@google.com>
+
+ * ar.c: Include plugin.h.
+ (main): Handle the --plugin option.
+ * nm.c: Include plugin.h.
+ (OPTION_PLUGIN): New.
+ (long_options): Add plugin.
+ (main): Handle OPTION_PLUGIN.
+ * NEWS: Mention the new feature.
+ * doc/binutils: Documement the new command line options.
+ * configure.in: Check for --enable-plugins.
+ * configure: Regenerate.
+
2009-05-26 Alan Modra <amodra@bigpond.net.au>
* dep-in.sed: Output one filename per line with all lines having
diff --git a/binutils/NEWS b/binutils/NEWS
index 02d27c4..7ce6d66 100644
--- a/binutils/NEWS
+++ b/binutils/NEWS
@@ -1,5 +1,8 @@
-*- text -*-
+* The plugin target has been added to bfd. It can load the same shared objects
+ used by gold and uses them to provide basic support for new file formats.
+
* The verilog memory hex dump file format is now supported as an output format
for objcopy.
diff --git a/binutils/ar.c b/binutils/ar.c
index 73ab1d4..d28419f 100644
--- a/binutils/ar.c
+++ b/binutils/ar.c
@@ -1,6 +1,6 @@
/* ar.c - Archive modify and extract.
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
- 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+ 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
Free Software Foundation, Inc.
This file is part of GNU Binutils.
@@ -37,6 +37,7 @@
#include "arsup.h"
#include "filenames.h"
#include "binemul.h"
+#include "plugin.h"
#include <sys/stat.h>
#ifdef __GO32___
@@ -230,8 +231,14 @@ usage (int help)
if (! is_ranlib)
{
/* xgettext:c-format */
- fprintf (s, _("Usage: %s [emulation options] [-]{dmpqrstx}[abcfilNoPsSuvV] [member-name] [count] archive-file file...\n"),
- program_name);
+ const char * command_line =
+#if BFD_SUPPORTS_PLUGINS
+ _("Usage: %s [emulation options] [--plugin <name>] [-]{dmpqrstx}[abcfilNoPsSuvV] [member-name] [count] archive-file file...\n");
+#else
+ _("Usage: %s [emulation options] [-]{dmpqrstx}[abcfilNoPsSuvV] [member-name] [count] archive-file file...\n");
+#endif
+ fprintf (s, command_line, program_name);
+
/* xgettext:c-format */
fprintf (s, _(" %s -M [<mri-script]\n"), program_name);
fprintf (s, _(" commands:\n"));
@@ -259,7 +266,10 @@ usage (int help)
fprintf (s, _(" [v] - be verbose\n"));
fprintf (s, _(" [V] - display the version number\n"));
fprintf (s, _(" @<file> - read options from <file>\n"));
-
+#if BFD_SUPPORTS_PLUGINS
+ fprintf (s, _(" optional:\n"));
+ fprintf (s, _(" --plugin <p> - load the specified plugin\n"));
+#endif
ar_emul_usage (s);
}
else
@@ -268,8 +278,11 @@ usage (int help)
fprintf (s, _("Usage: %s [options] archive\n"), program_name);
fprintf (s, _(" Generate an index to speed access to archives\n"));
fprintf (s, _(" The options are:\n\
- @<file> Read options from <file>\n\
- -t Update the archive's symbol map timestamp\n\
+ @<file> Read options from <file>\n"
+#if BFD_SUPPORTS_PLUGINS
+" --plugin <name> Load the specified plugin\n"
+#endif
+" -t Update the archive's symbol map timestamp\n\
-h --help Print this help message\n\
-v --version Print version information\n"));
}
@@ -480,6 +493,22 @@ main (int argc, char **argv)
arg_index = 1;
arg_ptr = argv[arg_index];
+ if (strcmp (arg_ptr, "--plugin") == 0)
+ {
+#if BFD_SUPPORTS_PLUGINS
+ if (argc < 4)
+ usage (1);
+
+ bfd_plugin_set_plugin (argv[2]);
+
+ arg_index += 2;
+ arg_ptr = argv[arg_index];
+#else
+ fprintf (stderr, _("sorry - this program has been built without plugin support\n"));
+ xexit (1);
+#endif
+ }
+
if (*arg_ptr == '-')
{
/* When the first option starts with '-' we support POSIX-compatible
diff --git a/binutils/configure b/binutils/configure
index d646ab6..83ba316 100755
--- a/binutils/configure
+++ b/binutils/configure
@@ -1002,6 +1002,7 @@ Optional Features:
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--disable-dependency-tracking speeds up one-time build
--enable-dependency-tracking do not reject slow dependency extractors
+ --enable-plugins linker plugins (defaults no)
--disable-largefile omit support for large files
--enable-shared[=PKGS]
build shared libraries [default=yes]
@@ -4736,6 +4737,18 @@ _ACEOF
+# Check whether --enable-plugins or --disable-plugins was given.
+if test "${enable_plugins+set}" = set; then
+ enableval="$enable_plugins"
+ case "${enableval}" in
+ yes | "") plugins=yes ;;
+ no) plugins=no ;;
+ *) plugins=yes ;;
+ esac
+else
+ plugins=no
+fi;
+
case "${target}" in
sparc-*-solaris*|i[3-7]86-*-solaris*)
# See comment in bfd/configure.in for the reason for this test.
@@ -4743,7 +4756,9 @@ case "${target}" in
# configure script so that the utilities in this directory agree
# on the size of structures used to describe files.
if test "${target}" = "${host}" -a "$enable_largefile" != 'yes'; then
- enable_largefile="no"
+ if test "$plugins" = "no"; then
+ enable_largefile="no"
+ fi
fi
;;
esac
@@ -5518,13 +5533,13 @@ if test "${lt_cv_nm_interface+set}" = set; then
else
lt_cv_nm_interface="BSD nm"
echo "int some_variable = 0;" > conftest.$ac_ext
- (eval echo "\"\$as_me:5521: $ac_compile\"" >&5)
+ (eval echo "\"\$as_me:5536: $ac_compile\"" >&5)
(eval "$ac_compile" 2>conftest.err)
cat conftest.err >&5
- (eval echo "\"\$as_me:5524: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
+ (eval echo "\"\$as_me:5539: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
(eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
cat conftest.err >&5
- (eval echo "\"\$as_me:5527: output\"" >&5)
+ (eval echo "\"\$as_me:5542: output\"" >&5)
cat conftest.out >&5
if $GREP 'External.*some_variable' conftest.out > /dev/null; then
lt_cv_nm_interface="MS dumpbin"
@@ -6681,7 +6696,7 @@ ia64-*-hpux*)
;;
*-*-irix6*)
# Find out which ABI we are using.
- echo '#line 6684 "configure"' > conftest.$ac_ext
+ echo '#line 6699 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
@@ -7987,11 +8002,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:7990: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:8005: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:7994: \$? = $ac_status" >&5
+ echo "$as_me:8009: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -8326,11 +8341,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:8329: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:8344: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:8333: \$? = $ac_status" >&5
+ echo "$as_me:8348: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -8431,11 +8446,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:8434: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:8449: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:8438: \$? = $ac_status" >&5
+ echo "$as_me:8453: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -8486,11 +8501,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:8489: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:8504: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:8493: \$? = $ac_status" >&5
+ echo "$as_me:8508: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -11298,7 +11313,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11301 "configure"
+#line 11316 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -11394,7 +11409,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11397 "configure"
+#line 11412 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
diff --git a/binutils/configure.in b/binutils/configure.in
index e35b169..3fdb349 100644
--- a/binutils/configure.in
+++ b/binutils/configure.in
@@ -16,6 +16,15 @@ AC_PROG_CC
AC_GNU_SOURCE
AC_USE_SYSTEM_EXTENSIONS
+AC_ARG_ENABLE([plugins],
+AS_HELP_STRING([--enable-plugins], [linker plugins (defaults no)]),
+[case "${enableval}" in
+ yes | "") plugins=yes ;;
+ no) plugins=no ;;
+ *) plugins=yes ;;
+ esac],
+[plugins=no])
+
case "${target}" in
changequote(,)dnl
sparc-*-solaris*|i[3-7]86-*-solaris*)
@@ -25,7 +34,9 @@ changequote([,])dnl
# configure script so that the utilities in this directory agree
# on the size of structures used to describe files.
if test "${target}" = "${host}" -a "$enable_largefile" != 'yes'; then
- enable_largefile="no"
+ if test "$plugins" = "no"; then
+ enable_largefile="no"
+ fi
fi
;;
esac
diff --git a/binutils/doc/binutils.texi b/binutils/doc/binutils.texi
index cdec81f..39a3806 100644
--- a/binutils/doc/binutils.texi
+++ b/binutils/doc/binutils.texi
@@ -170,7 +170,7 @@ in the section entitled ``GNU Free Documentation License''.
@c man title ar create, modify, and extract from archives
@smallexample
-ar [-]@var{p}[@var{mod} [@var{relpos}] [@var{count}]] @var{archive} [@var{member}@dots{}]
+ar [@option{--plugin} @var{name}] [-]@var{p}[@var{mod} [@var{relpos}] [@var{count}]] @var{archive} [@var{member}@dots{}]
ar -M [ <mri-script ]
@end smallexample
@@ -245,7 +245,7 @@ program.
@smallexample
@c man begin SYNOPSIS ar
-ar [@option{-X32_64}] [@option{-}]@var{p}[@var{mod} [@var{relpos}] [@var{count}]] @var{archive} [@var{member}@dots{}]
+ar [@option{--plugin} @var{name}] [@option{-X32_64}] [@option{-}]@var{p}[@var{mod} [@var{relpos}] [@var{count}]] @var{archive} [@var{member}@dots{}]
@c man end
@end smallexample
@@ -488,6 +488,11 @@ default for @sc{gnu} @command{ar}. @command{ar} does not support any of the oth
@samp{-X} options; in particular, it does not support @option{-X32}
which is the default for AIX @command{ar}.
+The optional command line switch @option{--plugin} @var{name} causes
+@command{ar} to load the plugin called @var{name} which adds support
+for more file formats. This option is only available if the toolchain
+has been built with plugin support enabled.
+
@c man end
@ignore
@@ -677,7 +682,8 @@ The @sc{gnu} linker @command{ld} is now described in a separate manual.
@smallexample
@c man begin SYNOPSIS nm
-nm [@option{-a}|@option{--debug-syms}] [@option{-g}|@option{--extern-only}]
+nm [@option{-a}|@option{--debug-syms}]
+ [@option{-g}|@option{--extern-only}][@option{--plugin} @var{name}]
[@option{-B}] [@option{-C}|@option{--demangle}[=@var{style}]] [@option{-D}|@option{--dynamic}]
[@option{-S}|@option{--print-size}] [@option{-s}|@option{--print-armap}]
[@option{-A}|@option{-o}|@option{--print-file-name}][@option{--special-syms}]
@@ -859,6 +865,12 @@ either upper or lower case.
@cindex external symbols
Display only external symbols.
+@item --plugin @var{name}
+@cindex load plugin
+Load the plugin called @var{name} to add support for extra target
+types. This option is only available if the toolchain has been built
+with plugin support enabled.
+
@item -l
@itemx --line-numbers
@cindex symbol line numbers
diff --git a/binutils/nm.c b/binutils/nm.c
index e11568a..b03d1b6 100644
--- a/binutils/nm.c
+++ b/binutils/nm.c
@@ -1,6 +1,6 @@
/* nm.c -- Describe symbol table of a rel file.
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
- 2001, 2002, 2003, 2004, 2005, 2007
+ 2001, 2002, 2003, 2004, 2005, 2007, 2009
Free Software Foundation, Inc.
This file is part of GNU Binutils.
@@ -31,6 +31,7 @@
#include "elf-bfd.h"
#include "elf/common.h"
#include "bucomm.h"
+#include "plugin.h"
/* When sorting by size, we use this structure to hold the size and a
pointer to the minisymbol. */
@@ -178,6 +179,7 @@ static bfd *lineno_cache_bfd;
static bfd *lineno_cache_rel_bfd;
#define OPTION_TARGET 200
+#define OPTION_PLUGIN 201
static struct option long_options[] =
{
@@ -192,6 +194,7 @@ static struct option long_options[] =
{"no-demangle", no_argument, &do_demangle, 0},
{"no-sort", no_argument, &no_sort, 1},
{"numeric-sort", no_argument, &sort_numerically, 1},
+ {"plugin", required_argument, 0, OPTION_PLUGIN},
{"portability", no_argument, 0, 'P'},
{"print-armap", no_argument, &print_armap, 1},
{"print-file-name", no_argument, 0, 'o'},
@@ -237,8 +240,11 @@ usage (FILE *stream, int status)
-o Same as -A\n\
-p, --no-sort Do not sort the symbols\n\
-P, --portability Same as --format=posix\n\
- -r, --reverse-sort Reverse the sense of the sort\n\
- -S, --print-size Print size of defined symbols\n\
+ -r, --reverse-sort Reverse the sense of the sort\n"
+#if BFD_SUPPORTS_PLUGINS
+" --plugin NAME Load the specified plugin\n"
+#endif
+" -S, --print-size Print size of defined symbols\n\
-s, --print-armap Include index for symbols from archive members\n\
--size-sort Sort symbols by size\n\
--special-syms Include special symbols in the output\n\
@@ -1608,6 +1614,14 @@ main (int argc, char **argv)
target = optarg;
break;
+ case OPTION_PLUGIN: /* --plugin */
+#if BFD_SUPPORTS_PLUGINS
+ bfd_plugin_set_plugin (optarg);
+#else
+ fatal (_("sorry - this program has been built without plugin support\n"));
+#endif
+ break;
+
case 0: /* A long option that just sets a flag. */
break;