Age | Commit message (Collapse) | Author | Files | Lines |
|
|
|
|
|
|
|
Some messing with plugin code in order to not need arelt_size in
ld code. File descriptor handling in ld/plugin.c is tidied too,
simply duping the open fd rather than opening the file again.
bfd/
* elflink.c: Include plugin-api.h.
* plugin.c (bfd_plugin_open_input): New function, extracted from..
(try_claim): ..here.
* plugin.h: Don't include bfd.h.
(bfd_plugin_open_input): Declare.
binutils/
* ar.c: Include plugin-api.h.
* nm.c: Likewise.
ld/
* plugin.c: Don't include libbfd.h. Include plugin-api.h
before bfd/plugin.h.
(plugin_object_p): Use bfd_plugin_open_input.
|
|
ELF linker shouldn't skip the IR object when searching the symbol table
of an archive element. If linker doesn't know if the object file is an
IR object, it should give LTO plugin a chance to get the correct symbol
table and use the IR symbol table if the input is an IR object.
bfd/
PR ld/18250
PR ld/20267
* elflink.c: Include plugin.h if BFD_SUPPORTS_PLUGINS is
defined.
(elf_link_is_defined_archive_symbol): Call
bfd_link_plugin_object_p on unknown plugin object and use the
IR symbol table if the input is an IR object.
* plugin.c (bfd_link_plugin_object_p): New function.
* plugin.h (bfd_link_plugin_object_p): New prototype.
ld/
PR ld/20267
* testsuite/ld-plugin/lto.exp (lto_link_tests): Add test for
PR ld/20267.
(lto_run_tests): Likewise.
* testsuite/ld-plugin/pr20267a.c: New file.
* testsuite/ld-plugin/pr20267b.c: Likewise.
|
|
|
|
Linker plugin_maybe_claim is the interface of linker plugin support.
This patch extracts linker plugin_maybe_claim into plugin_object_p and
makes it available to BFD via a new function:
void register_ld_plugin_object_p (const bfd_target *(*) (bfd *));
bfd_plugin_object_p calls plugin_object_p registered by linker first. It
adds an enum bfd_plugin_format field and a pointer to plugin dummy BFD so
that plugin_object_p stores plugin dummy BFD to allow plugin_maybe_claim
to retrieve it later.
bfd/
PR ld/17878
* bfd.c (bfd_plugin_format): New.
(bfd): Add plugin_format and plugin_dummy_bfd.
* plugin.c (try_load_plugin): Take a pointer to bfd_boolean
argument to return TRUE if any plugin is found. Set plugin_format.
(has_plugin): New.
(bfd_plugin_target_p): New.
(bfd_plugin_specified_p): Likewise.
(bfd_plugin_target_p): Likewise.
(register_ld_plugin_object_p): Likewise.
(bfd_plugin_set_plugin): Set has_plugin.
(load_plugin): Cache try_load_plugin result.
(bfd_plugin_object_p): Try ld_plugin_object_p first. Check
plugin_format.
* plugin.h (bfd_plugin_target_p): New.
(bfd_plugin_specified_p): Likewise.
(register_ld_plugin_object_p): Likewise.
* bfd-in2.h: Regenerated.
ld/
PR ld/17878
* plugin.c: Include ../bfd/plugin.h.
(plugin_get_ir_dummy_bfd): Call bfd_create with
link_info.output_bfd instead of srctemplate. Copy BFD info
from srctemplate only if it doesn't use BFD plugin target
vector.
(plugin_load_plugins): Call register_ld_plugin_object_p with
(plugin_object_p)
(plugin_maybe_claim): Renamed to ...
(plugin_object_p): This. Return dummy BFD target vector if
input is calimed by plugin library, otherwise return NULL.
Update plugin_format and plugin_dummy_bfd.
(plugin_maybe_claim): New. Use plugin_object_p.
xx
|
|
|
|
|
|
* targets.c (_bfd_target_vector): Only include plugin target in
all-targets build if BFD_SUPPORTS_PLUGINS is non-zero.
2009-05-27 Rafael Avila de Espindola <espindola@google.com>
* plugin.c (program_name): Remove.
(plugin_program_name): New.
(bfd_plugin_set_program_name): New.
(try_load_plugin): Use plugin_program_name.
* plugin.h (bfd_plugin_set_program_name): New.
2009-05-27 Rafael Avila de Espindola <espindola@google.com>
* ar.c (main): Call bfd_plugin_set_program_name.
* nm.c (main): Call bfd_plugin_set_program_name.
|
|
(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.
* 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.
|