This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH 0/8] PR ld/17878: Add and use bfd_maybe_object_p
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: binutils at sourceware dot org
- Date: Thu, 5 Feb 2015 05:52:02 -0800
- Subject: [PATCH 0/8] PR ld/17878: Add and use bfd_maybe_object_p
- Authentication-results: sourceware.org; auth=none
Hi,
LTO IR file can have any format. It is incorrect to assume that LTO IR
can only be stored in an object file. This series of patches add and
use bfd_maybe_object_p, which is similar to
bfd_check_format (abfd, bfd_object)
The difference is bfd_maybe_object_p takes an argument to indicate if a
compiler plug-in library is applied. When a compiler plug-in library is
active, it also returns TRUE if the file is not an archive or a coredump
file.
Linker is updated to use bfd_maybe_object_p instead of bfd_check_format
when checking if an input file can be claimed by compiler plug-in library
in plugin_maybe_claim. When processing archive member, we also use
bfd_maybe_object_p instead of bfd_check_format to check if an archive
member is an object file for linker.
Tests are added to verify if nm, ar and ld can properly handle LTO IR
stored in plain text file.
H.J. Lu (8):
Add bfd_maybe_object_p
Use bfd_maybe_object_p in linker.c
Use bfd_maybe_object_p in elf64-ia64-vms.c
Use bfd_maybe_object_p in vms-alpha.c
Use bfd_maybe_object_p in vms-lib.c
Use bfd_maybe_object_p in xcofflink.c
Use bfd_maybe_object_p in ecoff.c
Use bfd_maybe_object_p in coff-rs6000.c
bfd/archive.c | 6 +-
bfd/bfd-in2.h | 11 +
bfd/coff-rs6000.c | 8 +-
bfd/ecoff.c | 2 +-
bfd/elf64-ia64-vms.c | 5 +-
bfd/elflink.c | 10 +-
bfd/format.c | 25 ++
bfd/linker.c | 3 +-
bfd/targets.c | 8 +
bfd/vms-alpha.c | 5 +-
bfd/vms-lib.c | 3 +-
bfd/xcofflink.c | 2 +-
ld/Makefile.am | 8 +-
ld/Makefile.in | 49 ++-
ld/ldfile.c | 6 +-
ld/plugin.c | 14 +-
ld/testplug2.c | 691 +++++++++++++++++++++++++++++++++++++
ld/testplug3.c | 674 ++++++++++++++++++++++++++++++++++++
ld/testsuite/ld-plugin/func.c | 3 +
ld/testsuite/ld-plugin/plugin-13.d | 22 ++
ld/testsuite/ld-plugin/plugin-14.d | 33 ++
ld/testsuite/ld-plugin/plugin-15.d | 33 ++
ld/testsuite/ld-plugin/plugin-16.d | 37 ++
ld/testsuite/ld-plugin/plugin-17.d | 37 ++
ld/testsuite/ld-plugin/plugin-18.d | 38 ++
ld/testsuite/ld-plugin/plugin-19.d | 42 +++
ld/testsuite/ld-plugin/plugin-20.d | 6 +
ld/testsuite/ld-plugin/plugin-21.d | 6 +
ld/testsuite/ld-plugin/plugin-22.d | 6 +
ld/testsuite/ld-plugin/plugin-23.d | 6 +
ld/testsuite/ld-plugin/plugin.exp | 115 ++++++
31 files changed, 1886 insertions(+), 28 deletions(-)
create mode 100644 ld/testplug2.c
create mode 100644 ld/testplug3.c
create mode 100644 ld/testsuite/ld-plugin/plugin-13.d
create mode 100644 ld/testsuite/ld-plugin/plugin-14.d
create mode 100644 ld/testsuite/ld-plugin/plugin-15.d
create mode 100644 ld/testsuite/ld-plugin/plugin-16.d
create mode 100644 ld/testsuite/ld-plugin/plugin-17.d
create mode 100644 ld/testsuite/ld-plugin/plugin-18.d
create mode 100644 ld/testsuite/ld-plugin/plugin-19.d
create mode 100644 ld/testsuite/ld-plugin/plugin-20.d
create mode 100644 ld/testsuite/ld-plugin/plugin-21.d
create mode 100644 ld/testsuite/ld-plugin/plugin-22.d
create mode 100644 ld/testsuite/ld-plugin/plugin-23.d
--
2.1.0