binutils-gdb/bfd/plugin.c

759 lines
20 KiB
C
Raw Normal View History

/* Plugin support for BFD.
Copyright (C) 2009-2020 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"
#if BFD_SUPPORTS_PLUGINS
#include <assert.h>
#ifdef HAVE_DLFCN_H
#include <dlfcn.h>
#elif defined (HAVE_WINDOWS_H)
#include <windows.h>
#else
#error Unknown how to handle dynamic-load-libraries.
#endif
#include <stdarg.h>
#include "plugin-api.h"
#include "plugin.h"
#include "libbfd.h"
#include "libiberty.h"
#include <dirent.h>
#if !defined (HAVE_DLFCN_H) && defined (HAVE_WINDOWS_H)
#define RTLD_NOW 0 /* Dummy value. */
static void *
dlopen (const char *file, int mode ATTRIBUTE_UNUSED)
{
return LoadLibrary (file);
}
static void *
dlsym (void *handle, const char *name)
{
return GetProcAddress (handle, name);
}
static int ATTRIBUTE_UNUSED
dlclose (void *handle)
{
FreeLibrary (handle);
return 0;
}
static const char *
dlerror (void)
{
return "Unable to load DLL.";
}
#endif /* !defined (HAVE_DLFCN_H) && defined (HAVE_WINDOWS_H) */
#define bfd_plugin_close_and_cleanup _bfd_generic_close_and_cleanup
BFD whitespace fixes Binutils is supposed to use tabs. In my git config I have whitespace = indent-with-non-tab,space-before-tab,trailing-space and I got annoyed enough seeing red in "git diff" output to fix the problems. * doc/header.sed: Trim trailing space when splitting lines. * aix386-core.c, * aout-adobe.c, * aout-arm.c, * aout-cris.c, * aout-ns32k.c, * aout-target.h, * aout-tic30.c, * aoutf1.h, * aoutx.h, * arc-got.h, * arc-plt.def, * arc-plt.h, * archive.c, * archive64.c, * archures.c, * armnetbsd.c, * bfd-in.h, * bfd.c, * bfdio.c, * binary.c, * bout.c, * cache.c, * cisco-core.c, * coff-alpha.c, * coff-apollo.c, * coff-arm.c, * coff-h8300.c, * coff-i386.c, * coff-i860.c, * coff-i960.c, * coff-m68k.c, * coff-m88k.c, * coff-mcore.c, * coff-mips.c, * coff-ppc.c, * coff-rs6000.c, * coff-sh.c, * coff-stgo32.c, * coff-tic4x.c, * coff-tic54x.c, * coff-tic80.c, * coff-we32k.c, * coff-x86_64.c, * coff-z80.c, * coff-z8k.c, * coff64-rs6000.c, * coffcode.h, * coffgen.c, * cofflink.c, * coffswap.h, * compress.c, * corefile.c, * cpu-alpha.c, * cpu-arm.c, * cpu-avr.c, * cpu-bfin.c, * cpu-cr16.c, * cpu-cr16c.c, * cpu-crx.c, * cpu-d10v.c, * cpu-frv.c, * cpu-ft32.c, * cpu-i370.c, * cpu-i960.c, * cpu-ia64-opc.c, * cpu-ip2k.c, * cpu-lm32.c, * cpu-m32r.c, * cpu-mcore.c, * cpu-microblaze.c, * cpu-mips.c, * cpu-moxie.c, * cpu-mt.c, * cpu-nios2.c, * cpu-ns32k.c, * cpu-or1k.c, * cpu-powerpc.c, * cpu-pru.c, * cpu-sh.c, * cpu-spu.c, * cpu-v850.c, * cpu-v850_rh850.c, * cpu-xgate.c, * cpu-z80.c, * dwarf1.c, * dwarf2.c, * ecoff.c, * ecofflink.c, * ecoffswap.h, * elf-bfd.h, * elf-eh-frame.c, * elf-hppa.h, * elf-m10200.c, * elf-m10300.c, * elf-s390-common.c, * elf-strtab.c, * elf-vxworks.c, * elf.c, * elf32-am33lin.c, * elf32-arc.c, * elf32-arm.c, * elf32-avr.c, * elf32-avr.h, * elf32-bfin.c, * elf32-cr16.c, * elf32-cr16c.c, * elf32-cris.c, * elf32-crx.c, * elf32-d10v.c, * elf32-d30v.c, * elf32-dlx.c, * elf32-epiphany.c, * elf32-fr30.c, * elf32-frv.c, * elf32-ft32.c, * elf32-h8300.c, * elf32-hppa.c, * elf32-i386.c, * elf32-i860.c, * elf32-i960.c, * elf32-ip2k.c, * elf32-lm32.c, * elf32-m32c.c, * elf32-m32r.c, * elf32-m68hc11.c, * elf32-m68hc12.c, * elf32-m68hc1x.c, * elf32-m68hc1x.h, * elf32-m68k.c, * elf32-m88k.c, * elf32-mcore.c, * elf32-mep.c, * elf32-metag.c, * elf32-microblaze.c, * elf32-mips.c, * elf32-moxie.c, * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c, * elf32-nds32.h, * elf32-nios2.c, * elf32-or1k.c, * elf32-pj.c, * elf32-ppc.c, * elf32-ppc.h, * elf32-pru.c, * elf32-rl78.c, * elf32-rx.c, * elf32-s390.c, * elf32-score.c, * elf32-score.h, * elf32-score7.c, * elf32-sh-symbian.c, * elf32-sh.c, * elf32-sh64.c, * elf32-sparc.c, * elf32-spu.c, * elf32-tic6x.c, * elf32-tilegx.c, * elf32-tilegx.h, * elf32-tilepro.c, * elf32-tilepro.h, * elf32-v850.c, * elf32-vax.c, * elf32-wasm32.c, * elf32-xc16x.c, * elf32-xgate.c, * elf32-xgate.h, * elf32-xstormy16.c, * elf32-xtensa.c, * elf64-alpha.c, * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mips.c, * elf64-mmix.c, * elf64-ppc.c, * elf64-s390.c, * elf64-sh64.c, * elf64-sparc.c, * elf64-tilegx.c, * elf64-tilegx.h, * elf64-x86-64.c, * elfcore.h, * elflink.c, * elfn32-mips.c, * elfnn-aarch64.c, * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-aarch64.c, * elfxx-aarch64.h, * elfxx-ia64.c, * elfxx-ia64.h, * elfxx-mips.c, * elfxx-riscv.c, * elfxx-sparc.c, * elfxx-tilegx.c, * elfxx-x86.c, * elfxx-x86.h, * freebsd.h, * hash.c, * host-aout.c, * hp300hpux.c, * hppabsd-core.c, * hpux-core.c, * i386aout.c, * i386linux.c, * i386lynx.c, * i386mach3.c, * i386msdos.c, * i386netbsd.c, * ieee.c, * ihex.c, * irix-core.c, * libaout.h, * libbfd-in.h, * libbfd.c, * libcoff-in.h, * libnlm.h, * libpei.h, * libxcoff.h, * linker.c, * lynx-core.c, * m68k4knetbsd.c, * m68klinux.c, * m68knetbsd.c, * m88kmach3.c, * mach-o-aarch64.c, * mach-o-arm.c, * mach-o-i386.c, * mach-o-target.c, * mach-o-x86-64.c, * mach-o.c, * mach-o.h, * merge.c, * mipsbsd.c, * mmo.c, * netbsd.h, * netbsd-core.c, * newsos3.c, * nlm-target.h, * nlm32-ppc.c, * nlm32-sparc.c, * nlmcode.h, * ns32k.h, * ns32knetbsd.c, * oasys.c, * opncls.c, * pc532-mach.c, * pdp11.c, * pe-arm.c, * pe-i386.c, * pe-mcore.c, * pe-mips.c, * pe-x86_64.c, * peXXigen.c, * pef.c, * pef.h, * pei-arm.c, * pei-i386.c, * pei-mcore.c, * pei-x86_64.c, * peicode.h, * plugin.c, * ppcboot.c, * ptrace-core.c, * reloc.c, * riscix.c, * rs6000-core.c, * section.c, * som.c, * som.h, * sparclinux.c, * sparcnetbsd.c, * srec.c, * stabs.c, * sunos.c, * syms.c, * targets.c, * tekhex.c, * trad-core.c, * vax1knetbsd.c, * vaxnetbsd.c, * verilog.c, * versados.c, * vms-alpha.c, * vms-lib.c, * vms-misc.c, * wasm-module.c, * wasm-module.h, * xcofflink.c, * xsym.c, * xsym.h: Whitespace fixes. * bfd-in2.h, * libbfd.h, * libcoff.h: Regenerate.
2017-12-05 23:56:00 +01:00
#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
BFD whitespace fixes Binutils is supposed to use tabs. In my git config I have whitespace = indent-with-non-tab,space-before-tab,trailing-space and I got annoyed enough seeing red in "git diff" output to fix the problems. * doc/header.sed: Trim trailing space when splitting lines. * aix386-core.c, * aout-adobe.c, * aout-arm.c, * aout-cris.c, * aout-ns32k.c, * aout-target.h, * aout-tic30.c, * aoutf1.h, * aoutx.h, * arc-got.h, * arc-plt.def, * arc-plt.h, * archive.c, * archive64.c, * archures.c, * armnetbsd.c, * bfd-in.h, * bfd.c, * bfdio.c, * binary.c, * bout.c, * cache.c, * cisco-core.c, * coff-alpha.c, * coff-apollo.c, * coff-arm.c, * coff-h8300.c, * coff-i386.c, * coff-i860.c, * coff-i960.c, * coff-m68k.c, * coff-m88k.c, * coff-mcore.c, * coff-mips.c, * coff-ppc.c, * coff-rs6000.c, * coff-sh.c, * coff-stgo32.c, * coff-tic4x.c, * coff-tic54x.c, * coff-tic80.c, * coff-we32k.c, * coff-x86_64.c, * coff-z80.c, * coff-z8k.c, * coff64-rs6000.c, * coffcode.h, * coffgen.c, * cofflink.c, * coffswap.h, * compress.c, * corefile.c, * cpu-alpha.c, * cpu-arm.c, * cpu-avr.c, * cpu-bfin.c, * cpu-cr16.c, * cpu-cr16c.c, * cpu-crx.c, * cpu-d10v.c, * cpu-frv.c, * cpu-ft32.c, * cpu-i370.c, * cpu-i960.c, * cpu-ia64-opc.c, * cpu-ip2k.c, * cpu-lm32.c, * cpu-m32r.c, * cpu-mcore.c, * cpu-microblaze.c, * cpu-mips.c, * cpu-moxie.c, * cpu-mt.c, * cpu-nios2.c, * cpu-ns32k.c, * cpu-or1k.c, * cpu-powerpc.c, * cpu-pru.c, * cpu-sh.c, * cpu-spu.c, * cpu-v850.c, * cpu-v850_rh850.c, * cpu-xgate.c, * cpu-z80.c, * dwarf1.c, * dwarf2.c, * ecoff.c, * ecofflink.c, * ecoffswap.h, * elf-bfd.h, * elf-eh-frame.c, * elf-hppa.h, * elf-m10200.c, * elf-m10300.c, * elf-s390-common.c, * elf-strtab.c, * elf-vxworks.c, * elf.c, * elf32-am33lin.c, * elf32-arc.c, * elf32-arm.c, * elf32-avr.c, * elf32-avr.h, * elf32-bfin.c, * elf32-cr16.c, * elf32-cr16c.c, * elf32-cris.c, * elf32-crx.c, * elf32-d10v.c, * elf32-d30v.c, * elf32-dlx.c, * elf32-epiphany.c, * elf32-fr30.c, * elf32-frv.c, * elf32-ft32.c, * elf32-h8300.c, * elf32-hppa.c, * elf32-i386.c, * elf32-i860.c, * elf32-i960.c, * elf32-ip2k.c, * elf32-lm32.c, * elf32-m32c.c, * elf32-m32r.c, * elf32-m68hc11.c, * elf32-m68hc12.c, * elf32-m68hc1x.c, * elf32-m68hc1x.h, * elf32-m68k.c, * elf32-m88k.c, * elf32-mcore.c, * elf32-mep.c, * elf32-metag.c, * elf32-microblaze.c, * elf32-mips.c, * elf32-moxie.c, * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c, * elf32-nds32.h, * elf32-nios2.c, * elf32-or1k.c, * elf32-pj.c, * elf32-ppc.c, * elf32-ppc.h, * elf32-pru.c, * elf32-rl78.c, * elf32-rx.c, * elf32-s390.c, * elf32-score.c, * elf32-score.h, * elf32-score7.c, * elf32-sh-symbian.c, * elf32-sh.c, * elf32-sh64.c, * elf32-sparc.c, * elf32-spu.c, * elf32-tic6x.c, * elf32-tilegx.c, * elf32-tilegx.h, * elf32-tilepro.c, * elf32-tilepro.h, * elf32-v850.c, * elf32-vax.c, * elf32-wasm32.c, * elf32-xc16x.c, * elf32-xgate.c, * elf32-xgate.h, * elf32-xstormy16.c, * elf32-xtensa.c, * elf64-alpha.c, * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mips.c, * elf64-mmix.c, * elf64-ppc.c, * elf64-s390.c, * elf64-sh64.c, * elf64-sparc.c, * elf64-tilegx.c, * elf64-tilegx.h, * elf64-x86-64.c, * elfcore.h, * elflink.c, * elfn32-mips.c, * elfnn-aarch64.c, * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-aarch64.c, * elfxx-aarch64.h, * elfxx-ia64.c, * elfxx-ia64.h, * elfxx-mips.c, * elfxx-riscv.c, * elfxx-sparc.c, * elfxx-tilegx.c, * elfxx-x86.c, * elfxx-x86.h, * freebsd.h, * hash.c, * host-aout.c, * hp300hpux.c, * hppabsd-core.c, * hpux-core.c, * i386aout.c, * i386linux.c, * i386lynx.c, * i386mach3.c, * i386msdos.c, * i386netbsd.c, * ieee.c, * ihex.c, * irix-core.c, * libaout.h, * libbfd-in.h, * libbfd.c, * libcoff-in.h, * libnlm.h, * libpei.h, * libxcoff.h, * linker.c, * lynx-core.c, * m68k4knetbsd.c, * m68klinux.c, * m68knetbsd.c, * m88kmach3.c, * mach-o-aarch64.c, * mach-o-arm.c, * mach-o-i386.c, * mach-o-target.c, * mach-o-x86-64.c, * mach-o.c, * mach-o.h, * merge.c, * mipsbsd.c, * mmo.c, * netbsd.h, * netbsd-core.c, * newsos3.c, * nlm-target.h, * nlm32-ppc.c, * nlm32-sparc.c, * nlmcode.h, * ns32k.h, * ns32knetbsd.c, * oasys.c, * opncls.c, * pc532-mach.c, * pdp11.c, * pe-arm.c, * pe-i386.c, * pe-mcore.c, * pe-mips.c, * pe-x86_64.c, * peXXigen.c, * pef.c, * pef.h, * pei-arm.c, * pei-i386.c, * pei-mcore.c, * pei-x86_64.c, * peicode.h, * plugin.c, * ppcboot.c, * ptrace-core.c, * reloc.c, * riscix.c, * rs6000-core.c, * section.c, * som.c, * som.h, * sparclinux.c, * sparcnetbsd.c, * srec.c, * stabs.c, * sunos.c, * syms.c, * targets.c, * tekhex.c, * trad-core.c, * vax1knetbsd.c, * vaxnetbsd.c, * verilog.c, * versados.c, * vms-alpha.c, * vms-lib.c, * vms-misc.c, * wasm-module.c, * wasm-module.h, * xcofflink.c, * xsym.c, * xsym.h: Whitespace fixes. * bfd-in2.h, * libbfd.h, * libcoff.h: Regenerate.
2017-12-05 23:56:00 +01:00
#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
BFD whitespace fixes Binutils is supposed to use tabs. In my git config I have whitespace = indent-with-non-tab,space-before-tab,trailing-space and I got annoyed enough seeing red in "git diff" output to fix the problems. * doc/header.sed: Trim trailing space when splitting lines. * aix386-core.c, * aout-adobe.c, * aout-arm.c, * aout-cris.c, * aout-ns32k.c, * aout-target.h, * aout-tic30.c, * aoutf1.h, * aoutx.h, * arc-got.h, * arc-plt.def, * arc-plt.h, * archive.c, * archive64.c, * archures.c, * armnetbsd.c, * bfd-in.h, * bfd.c, * bfdio.c, * binary.c, * bout.c, * cache.c, * cisco-core.c, * coff-alpha.c, * coff-apollo.c, * coff-arm.c, * coff-h8300.c, * coff-i386.c, * coff-i860.c, * coff-i960.c, * coff-m68k.c, * coff-m88k.c, * coff-mcore.c, * coff-mips.c, * coff-ppc.c, * coff-rs6000.c, * coff-sh.c, * coff-stgo32.c, * coff-tic4x.c, * coff-tic54x.c, * coff-tic80.c, * coff-we32k.c, * coff-x86_64.c, * coff-z80.c, * coff-z8k.c, * coff64-rs6000.c, * coffcode.h, * coffgen.c, * cofflink.c, * coffswap.h, * compress.c, * corefile.c, * cpu-alpha.c, * cpu-arm.c, * cpu-avr.c, * cpu-bfin.c, * cpu-cr16.c, * cpu-cr16c.c, * cpu-crx.c, * cpu-d10v.c, * cpu-frv.c, * cpu-ft32.c, * cpu-i370.c, * cpu-i960.c, * cpu-ia64-opc.c, * cpu-ip2k.c, * cpu-lm32.c, * cpu-m32r.c, * cpu-mcore.c, * cpu-microblaze.c, * cpu-mips.c, * cpu-moxie.c, * cpu-mt.c, * cpu-nios2.c, * cpu-ns32k.c, * cpu-or1k.c, * cpu-powerpc.c, * cpu-pru.c, * cpu-sh.c, * cpu-spu.c, * cpu-v850.c, * cpu-v850_rh850.c, * cpu-xgate.c, * cpu-z80.c, * dwarf1.c, * dwarf2.c, * ecoff.c, * ecofflink.c, * ecoffswap.h, * elf-bfd.h, * elf-eh-frame.c, * elf-hppa.h, * elf-m10200.c, * elf-m10300.c, * elf-s390-common.c, * elf-strtab.c, * elf-vxworks.c, * elf.c, * elf32-am33lin.c, * elf32-arc.c, * elf32-arm.c, * elf32-avr.c, * elf32-avr.h, * elf32-bfin.c, * elf32-cr16.c, * elf32-cr16c.c, * elf32-cris.c, * elf32-crx.c, * elf32-d10v.c, * elf32-d30v.c, * elf32-dlx.c, * elf32-epiphany.c, * elf32-fr30.c, * elf32-frv.c, * elf32-ft32.c, * elf32-h8300.c, * elf32-hppa.c, * elf32-i386.c, * elf32-i860.c, * elf32-i960.c, * elf32-ip2k.c, * elf32-lm32.c, * elf32-m32c.c, * elf32-m32r.c, * elf32-m68hc11.c, * elf32-m68hc12.c, * elf32-m68hc1x.c, * elf32-m68hc1x.h, * elf32-m68k.c, * elf32-m88k.c, * elf32-mcore.c, * elf32-mep.c, * elf32-metag.c, * elf32-microblaze.c, * elf32-mips.c, * elf32-moxie.c, * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c, * elf32-nds32.h, * elf32-nios2.c, * elf32-or1k.c, * elf32-pj.c, * elf32-ppc.c, * elf32-ppc.h, * elf32-pru.c, * elf32-rl78.c, * elf32-rx.c, * elf32-s390.c, * elf32-score.c, * elf32-score.h, * elf32-score7.c, * elf32-sh-symbian.c, * elf32-sh.c, * elf32-sh64.c, * elf32-sparc.c, * elf32-spu.c, * elf32-tic6x.c, * elf32-tilegx.c, * elf32-tilegx.h, * elf32-tilepro.c, * elf32-tilepro.h, * elf32-v850.c, * elf32-vax.c, * elf32-wasm32.c, * elf32-xc16x.c, * elf32-xgate.c, * elf32-xgate.h, * elf32-xstormy16.c, * elf32-xtensa.c, * elf64-alpha.c, * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mips.c, * elf64-mmix.c, * elf64-ppc.c, * elf64-s390.c, * elf64-sh64.c, * elf64-sparc.c, * elf64-tilegx.c, * elf64-tilegx.h, * elf64-x86-64.c, * elfcore.h, * elflink.c, * elfn32-mips.c, * elfnn-aarch64.c, * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-aarch64.c, * elfxx-aarch64.h, * elfxx-ia64.c, * elfxx-ia64.h, * elfxx-mips.c, * elfxx-riscv.c, * elfxx-sparc.c, * elfxx-tilegx.c, * elfxx-x86.c, * elfxx-x86.h, * freebsd.h, * hash.c, * host-aout.c, * hp300hpux.c, * hppabsd-core.c, * hpux-core.c, * i386aout.c, * i386linux.c, * i386lynx.c, * i386mach3.c, * i386msdos.c, * i386netbsd.c, * ieee.c, * ihex.c, * irix-core.c, * libaout.h, * libbfd-in.h, * libbfd.c, * libcoff-in.h, * libnlm.h, * libpei.h, * libxcoff.h, * linker.c, * lynx-core.c, * m68k4knetbsd.c, * m68klinux.c, * m68knetbsd.c, * m88kmach3.c, * mach-o-aarch64.c, * mach-o-arm.c, * mach-o-i386.c, * mach-o-target.c, * mach-o-x86-64.c, * mach-o.c, * mach-o.h, * merge.c, * mipsbsd.c, * mmo.c, * netbsd.h, * netbsd-core.c, * newsos3.c, * nlm-target.h, * nlm32-ppc.c, * nlm32-sparc.c, * nlmcode.h, * ns32k.h, * ns32knetbsd.c, * oasys.c, * opncls.c, * pc532-mach.c, * pdp11.c, * pe-arm.c, * pe-i386.c, * pe-mcore.c, * pe-mips.c, * pe-x86_64.c, * peXXigen.c, * pef.c, * pef.h, * pei-arm.c, * pei-i386.c, * pei-mcore.c, * pei-x86_64.c, * peicode.h, * plugin.c, * ppcboot.c, * ptrace-core.c, * reloc.c, * riscix.c, * rs6000-core.c, * section.c, * som.c, * som.h, * sparclinux.c, * sparcnetbsd.c, * srec.c, * stabs.c, * sunos.c, * syms.c, * targets.c, * tekhex.c, * trad-core.c, * vax1knetbsd.c, * vaxnetbsd.c, * verilog.c, * versados.c, * vms-alpha.c, * vms-lib.c, * vms-misc.c, * wasm-module.c, * wasm-module.h, * xcofflink.c, * xsym.c, * xsym.h: Whitespace fixes. * bfd-in2.h, * libbfd.h, * libcoff.h: Regenerate.
2017-12-05 23:56:00 +01:00
#define bfd_plugin_bfd_is_local_label_name _bfd_nosymbols_bfd_is_local_label_name
Remove bfd stub function casts. This patch defines a bunch of new functions to use in the BFD target structs rather than casting bfd_false or bfd_true and similar stub functions. I've also renamed the stub functions to reflect their parameters and put "error" in the name if they set bfd_error. The latter change is important since there were quite a few uses of bfd_false where setting bfd_error was inappropriate, for example in elf_backend_allow_non_load_phdr and is_target_special_symbol. * libbfd.c (_bfd_bool_bfd_false_error): Rename from bfd_false. (_bfd_bool_bfd_true): Rename from bfd_true. (_bfd_ptr_bfd_null_error): Rename from bfd_nullvoidptr. (_bfd_int_bfd_0): Rename from bfd_0. (_bfd_uint_bfd_0): Rename from bfd_0u. (_bfd_long_bfd_0): Rename from bfd_0l. (_bfd_long_bfd_n1_error): Rename from _bfd_n1. (_bfd_void_bfd): Rename from bfd_void. (_bfd_bool_bfd_false, _bfd_bool_bfd_asymbol_false), (_bfd_bool_bfd_link_false_error), (_bfd_bool_bfd_link_true, _bfd_bool_bfd_bfd_true), (_bfd_bool_bfd_uint_true, _bfd_bool_bfd_ptr_true), (_bfd_bool_bfd_asection_bfd_asection_true), (_bfd_bool_bfd_asymbol_bfd_asymbol_true), (_bfd_void_bfd_link, _bfd_void_bfd_asection): New functions. * archive.c (_bfd_noarchive_get_elt_at_index), (_bfd_noarchive_openr_next_archived_file), (_bfd_noarchive_construct_extended_name_table), (_bfd_noarchive_write_ar_hdr, _bfd_noarchive_truncate_arname), (_bfd_noarchive_write_armap): New functions. * archures.c (_bfd_nowrite_set_arch_mach): New function. * coff-alpha.c (alpha_ecoff_swap_coff_aux_in), (alpha_ecoff_swap_coff_sym_in, alpha_ecoff_swap_coff_lineno_in), (alpha_ecoff_swap_coff_aux_out, alpha_ecoff_swap_coff_sym_out), (alpha_ecoff_swap_coff_lineno_out), (alpha_ecoff_swap_coff_reloc_out): New functions. * coff-mips.c (mips_ecoff_swap_coff_aux_in), (mips_ecoff_swap_coff_sym_in, mips_ecoff_swap_coff_lineno_in), (mips_ecoff_swap_coff_aux_out, mips_ecoff_swap_coff_sym_out), (mips_ecoff_swap_coff_lineno_out), (mips_ecoff_swap_coff_reloc_out): New functions. * coffcode.h (coff_set_alignment_hook): Replace define with new function. (symname_in_debug_hook): Likewise. * ecoff.c (_bfd_ecoff_set_alignment_hook): New function. * elfxx-target.h (elf_backend_allow_non_load_phdr): Default to 0. * elf.c (assign_file_positions_except_relocs): Test elf_backend_allow_non_load_phdr for NULL. * elflink.c (_bfd_elf_omit_section_dynsym_default): Rename from _bfd_elf_link_omit_section_dynsym. Update uses. (_bfd_elf_omit_section_dynsym_all): New function. * elf-bfd.h (_bfd_elf_link_omit_section_dynsym): Delete. (_bfd_elf_omit_section_dynsym_default): Declare. (_bfd_elf_omit_section_dynsym_all): Declare. * linker.c (_bfd_nolink_sizeof_headers, _bfd_nolink_bfd_relax_section), (_bfd_nolink_bfd_get_relocated_section_contents), (_bfd_nolink_bfd_lookup_section_flags), (_bfd_nolink_bfd_is_group_section, _bfd_nolink_bfd_discard_group), (_bfd_nolink_bfd_link_hash_table_create), (_bfd_nolink_bfd_link_just_syms), (_bfd_nolink_bfd_copy_link_hash_symbol_type), (_bfd_nolink_bfd_link_split_section), (_bfd_nolink_section_already_linked), (_bfd_nolink_bfd_define_common_symbol), (_bfd_nolink_bfd_define_start_stop): New functions. * reloc.c (_bfd_norelocs_bfd_reloc_type_lookup), (_bfd_norelocs_bfd_reloc_name_lookup), (_bfd_nodynamic_canonicalize_dynamic_reloc): New functions. * section.c (_bfd_nowrite_set_section_contents): New function. * syms.c (_bfd_nosymbols_canonicalize_symtab), (_bfd_nosymbols_print_symbol, _bfd_nosymbols_get_symbol_info), (_bfd_nosymbols_get_symbol_version_string), (_bfd_nosymbols_bfd_is_local_label_name), (_bfd_nosymbols_get_lineno, _bfd_nosymbols_find_nearest_line), (_bfd_nosymbols_find_line, _bfd_nosymbols_find_inliner_info), (_bfd_nosymbols_bfd_make_debug_symbol), ( _bfd_nosymbols_read_minisymbols), ( _bfd_nosymbols_minisymbol_to_symbol), (_bfd_nodynamic_get_synthetic_symtab): New functions. * libbfd-in.h: Declare new functions. Update existing defines, removing casts. * aix386-core.c: Update to use new hooks. Formatting. * aout-adobe.c: Likewise. * aout-arm.c: Likewise. * aout-target.h: Likewise. * aout-tic30.c: Likewise. * aoutf1.h: Likewise. * binary.c: Likewise. * bout.c: Likewise. * cisco-core.c: Likewise. * coff-alpha.c: Likewise. * coff-i386.c: Likewise. * coff-i860.c: Likewise. * coff-i960.c: Likewise. * coff-ia64.c: Likewise. * coff-mips.c: Likewise. * coff-ppc.c: Likewise. * coff-rs6000.c: Likewise. * coff-sh.c: Likewise. * coff-tic30.c: Likewise. * coff-tic54x.c: Likewise. * coff-x86_64.c: Likewise. * coff64-rs6000.c: Likewise. * coffcode.h: Likewise. * elf-m10300.c: Likewise. * elf32-cr16.c: Likewise. * elf32-lm32.c: Likewise. * elf32-m32r.c: Likewise. * elf32-metag.c: Likewise. * elf32-score.c: Likewise. * elf32-score7.c: Likewise. * elf32-tilepro.c: Likewise. * elf32-xstormy16.c: Likewise. * elf32-xtensa.c: Likewise. * elf64-alpha.c: Likewise. * elf64-hppa.c: Likewise. * elf64-ia64-vms.c: Likewise. * elf64-mmix.c: Likewise. * elf64-sh64.c: Likewise. * elfnn-ia64.c: Likewise. * elfxx-sparc.c: Likewise. * elfxx-target.h: Likewise. * elfxx-tilegx.c: Likewise. * elfxx-x86.h: Likewise. * hp300hpux.c: Likewise. * hppabsd-core.c: Likewise. * hpux-core.c: Likewise. * i386msdos.c: Likewise. * i386os9k.c: Likewise. * ieee.c: Likewise. * ihex.c: Likewise. * irix-core.c: Likewise. * libaout.h: Likewise. * libecoff.h: Likewise. * mach-o-target.c: Likewise. * mach-o.c: Likewise. * mipsbsd.c: Likewise. * mmo.c: Likewise. * netbsd-core.c: Likewise. * nlm-target.h: Likewise. * oasys.c: Likewise. * osf-core.c: Likewise. * pdp11.c: Likewise. * pe-mips.c: Likewise. * pe-x86_64.c: Likewise. * pef.c: Likewise. * plugin.c: Likewise. * ppcboot.c: Likewise. * ptrace-core.c: Likewise. * sco5-core.c: Likewise. * som.c: Likewise. * sparclynx.c: Likewise. * srec.c: Likewise. * tekhex.c: Likewise. * trad-core.c: Likewise. * verilog.c: Likewise. * versados.c: Likewise. * vms-alpha.c: Likewise. * vms-lib.c: Likewise. * wasm-module.c: Likewise. * xsym.c: Likewise. * libbfd.h: Regenerate.
2018-02-15 01:28:06 +01:00
#define bfd_plugin_bfd_is_target_special_symbol _bfd_bool_bfd_asymbol_false
BFD whitespace fixes Binutils is supposed to use tabs. In my git config I have whitespace = indent-with-non-tab,space-before-tab,trailing-space and I got annoyed enough seeing red in "git diff" output to fix the problems. * doc/header.sed: Trim trailing space when splitting lines. * aix386-core.c, * aout-adobe.c, * aout-arm.c, * aout-cris.c, * aout-ns32k.c, * aout-target.h, * aout-tic30.c, * aoutf1.h, * aoutx.h, * arc-got.h, * arc-plt.def, * arc-plt.h, * archive.c, * archive64.c, * archures.c, * armnetbsd.c, * bfd-in.h, * bfd.c, * bfdio.c, * binary.c, * bout.c, * cache.c, * cisco-core.c, * coff-alpha.c, * coff-apollo.c, * coff-arm.c, * coff-h8300.c, * coff-i386.c, * coff-i860.c, * coff-i960.c, * coff-m68k.c, * coff-m88k.c, * coff-mcore.c, * coff-mips.c, * coff-ppc.c, * coff-rs6000.c, * coff-sh.c, * coff-stgo32.c, * coff-tic4x.c, * coff-tic54x.c, * coff-tic80.c, * coff-we32k.c, * coff-x86_64.c, * coff-z80.c, * coff-z8k.c, * coff64-rs6000.c, * coffcode.h, * coffgen.c, * cofflink.c, * coffswap.h, * compress.c, * corefile.c, * cpu-alpha.c, * cpu-arm.c, * cpu-avr.c, * cpu-bfin.c, * cpu-cr16.c, * cpu-cr16c.c, * cpu-crx.c, * cpu-d10v.c, * cpu-frv.c, * cpu-ft32.c, * cpu-i370.c, * cpu-i960.c, * cpu-ia64-opc.c, * cpu-ip2k.c, * cpu-lm32.c, * cpu-m32r.c, * cpu-mcore.c, * cpu-microblaze.c, * cpu-mips.c, * cpu-moxie.c, * cpu-mt.c, * cpu-nios2.c, * cpu-ns32k.c, * cpu-or1k.c, * cpu-powerpc.c, * cpu-pru.c, * cpu-sh.c, * cpu-spu.c, * cpu-v850.c, * cpu-v850_rh850.c, * cpu-xgate.c, * cpu-z80.c, * dwarf1.c, * dwarf2.c, * ecoff.c, * ecofflink.c, * ecoffswap.h, * elf-bfd.h, * elf-eh-frame.c, * elf-hppa.h, * elf-m10200.c, * elf-m10300.c, * elf-s390-common.c, * elf-strtab.c, * elf-vxworks.c, * elf.c, * elf32-am33lin.c, * elf32-arc.c, * elf32-arm.c, * elf32-avr.c, * elf32-avr.h, * elf32-bfin.c, * elf32-cr16.c, * elf32-cr16c.c, * elf32-cris.c, * elf32-crx.c, * elf32-d10v.c, * elf32-d30v.c, * elf32-dlx.c, * elf32-epiphany.c, * elf32-fr30.c, * elf32-frv.c, * elf32-ft32.c, * elf32-h8300.c, * elf32-hppa.c, * elf32-i386.c, * elf32-i860.c, * elf32-i960.c, * elf32-ip2k.c, * elf32-lm32.c, * elf32-m32c.c, * elf32-m32r.c, * elf32-m68hc11.c, * elf32-m68hc12.c, * elf32-m68hc1x.c, * elf32-m68hc1x.h, * elf32-m68k.c, * elf32-m88k.c, * elf32-mcore.c, * elf32-mep.c, * elf32-metag.c, * elf32-microblaze.c, * elf32-mips.c, * elf32-moxie.c, * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c, * elf32-nds32.h, * elf32-nios2.c, * elf32-or1k.c, * elf32-pj.c, * elf32-ppc.c, * elf32-ppc.h, * elf32-pru.c, * elf32-rl78.c, * elf32-rx.c, * elf32-s390.c, * elf32-score.c, * elf32-score.h, * elf32-score7.c, * elf32-sh-symbian.c, * elf32-sh.c, * elf32-sh64.c, * elf32-sparc.c, * elf32-spu.c, * elf32-tic6x.c, * elf32-tilegx.c, * elf32-tilegx.h, * elf32-tilepro.c, * elf32-tilepro.h, * elf32-v850.c, * elf32-vax.c, * elf32-wasm32.c, * elf32-xc16x.c, * elf32-xgate.c, * elf32-xgate.h, * elf32-xstormy16.c, * elf32-xtensa.c, * elf64-alpha.c, * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mips.c, * elf64-mmix.c, * elf64-ppc.c, * elf64-s390.c, * elf64-sh64.c, * elf64-sparc.c, * elf64-tilegx.c, * elf64-tilegx.h, * elf64-x86-64.c, * elfcore.h, * elflink.c, * elfn32-mips.c, * elfnn-aarch64.c, * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-aarch64.c, * elfxx-aarch64.h, * elfxx-ia64.c, * elfxx-ia64.h, * elfxx-mips.c, * elfxx-riscv.c, * elfxx-sparc.c, * elfxx-tilegx.c, * elfxx-x86.c, * elfxx-x86.h, * freebsd.h, * hash.c, * host-aout.c, * hp300hpux.c, * hppabsd-core.c, * hpux-core.c, * i386aout.c, * i386linux.c, * i386lynx.c, * i386mach3.c, * i386msdos.c, * i386netbsd.c, * ieee.c, * ihex.c, * irix-core.c, * libaout.h, * libbfd-in.h, * libbfd.c, * libcoff-in.h, * libnlm.h, * libpei.h, * libxcoff.h, * linker.c, * lynx-core.c, * m68k4knetbsd.c, * m68klinux.c, * m68knetbsd.c, * m88kmach3.c, * mach-o-aarch64.c, * mach-o-arm.c, * mach-o-i386.c, * mach-o-target.c, * mach-o-x86-64.c, * mach-o.c, * mach-o.h, * merge.c, * mipsbsd.c, * mmo.c, * netbsd.h, * netbsd-core.c, * newsos3.c, * nlm-target.h, * nlm32-ppc.c, * nlm32-sparc.c, * nlmcode.h, * ns32k.h, * ns32knetbsd.c, * oasys.c, * opncls.c, * pc532-mach.c, * pdp11.c, * pe-arm.c, * pe-i386.c, * pe-mcore.c, * pe-mips.c, * pe-x86_64.c, * peXXigen.c, * pef.c, * pef.h, * pei-arm.c, * pei-i386.c, * pei-mcore.c, * pei-x86_64.c, * peicode.h, * plugin.c, * ppcboot.c, * ptrace-core.c, * reloc.c, * riscix.c, * rs6000-core.c, * section.c, * som.c, * som.h, * sparclinux.c, * sparcnetbsd.c, * srec.c, * stabs.c, * sunos.c, * syms.c, * targets.c, * tekhex.c, * trad-core.c, * vax1knetbsd.c, * vaxnetbsd.c, * verilog.c, * versados.c, * vms-alpha.c, * vms-lib.c, * vms-misc.c, * wasm-module.c, * wasm-module.h, * xcofflink.c, * xsym.c, * xsym.h: Whitespace fixes. * bfd-in2.h, * libbfd.h, * libcoff.h: Regenerate.
2017-12-05 23:56:00 +01:00
#define bfd_plugin_get_lineno _bfd_nosymbols_get_lineno
#define bfd_plugin_find_nearest_line _bfd_nosymbols_find_nearest_line
#define bfd_plugin_find_line _bfd_nosymbols_find_line
#define bfd_plugin_find_inliner_info _bfd_nosymbols_find_inliner_info
Use get_symbol_version_string in BFD_JUMP_TABLE_SYMBOLS This patch adds get_symbol_version_string to BFD_JUMP_TABLE_SYMBOLS so that we can use bfd_get_symbol_version_string in objdump for non-ELF targets. bfd/ * targets.c (BFD_JUMP_TABLE_SYMBOLS): Use NAME##_get_symbol_version_string. (bfd_get_symbol_version_string): New. * aout-adobe.c (aout_32_get_symbol_version_string): Define using _bfd_nosymbols define. * aout-target.h (MY_get_symbol_version_string): Likewise. * aout-tic30.c (MY_get_symbol_version_string): Likewise. * binary.c (binary_get_symbol_version_string): Likewise. * bout.c (aout_32_get_symbol_version_string): Likewise. * coff-rs6000.c (_bfd_xcoff_get_symbol_version_string): Likewise. * i386msdos.c (msdos_get_symbol_version_string): Likewise. * i386os9k.c (aout_32_get_symbol_version_string): Likewise. * ieee.c (ieee_get_symbol_version_string): Likewise. * ihex.c (ihex_get_symbol_version_string): Likewise. * libecoff.h (_bfd_ecoff_get_symbol_version_string): Likewise. * mach-o-target.c (bfd_mach_o_get_symbol_version_string): Likewise. * mmo.c (mmo_get_symbol_version_string): Likewise. * nlm-target.h (nlm_get_symbol_version_string): Likewise. * oasys.c (oasys_get_symbol_version_string): Likewise. * pef.c (bfd_pef_get_symbol_version_string): Likewise. * plugin.c (bfd_plugin_get_symbol_version_string): Likewise. * ppcboot.c (ppcboot_get_symbol_version_string): Likewise. * som.c (som_get_symbol_version_string): Likewise. * srec.c (srec_get_symbol_version_string): Likewise. * tekhex.c (tekhex_get_symbol_version_string): Likewise. * versados.c (versados_get_symbol_version_string): Likewise. * vms-alpha.c (alpha_vms_get_symbol_version_string): Likewise. * xsym.c (bfd_sym_get_symbol_version_string): Likewise. * coff64-rs6000.c (rs6000_xcoff64_vec): Use coff_get_symbol_version_string. (rs6000_xcoff64_aix_vec): Likewise. * elf-bfd.h (bfd_elf_get_symbol_version_string): Renamed to ... (_bfd_elf_get_symbol_version_string): This. * elf.c: Likewise. (bfd_elf_print_symbol): Updated. * elfxx-target.h (bfd_elfNN_get_symbol_version_string): Define. * libbfd-in.h (_bfd_nosymbols_get_symbol_version_string): Define. * libcoff-in.h (coff_get_symbol_version_string): Likewise. * bfd-in2.h: Regenerated. * libbfd.h: Likewise. * libcoff.h: Likewise. binutils/ * objdump.c (objdump_print_symname): Replace bfd_elf_get_symbol_version_string with bfd_get_symbol_version_string.
2014-11-25 18:28:32 +01:00
#define bfd_plugin_get_symbol_version_string _bfd_nosymbols_get_symbol_version_string
BFD whitespace fixes Binutils is supposed to use tabs. In my git config I have whitespace = indent-with-non-tab,space-before-tab,trailing-space and I got annoyed enough seeing red in "git diff" output to fix the problems. * doc/header.sed: Trim trailing space when splitting lines. * aix386-core.c, * aout-adobe.c, * aout-arm.c, * aout-cris.c, * aout-ns32k.c, * aout-target.h, * aout-tic30.c, * aoutf1.h, * aoutx.h, * arc-got.h, * arc-plt.def, * arc-plt.h, * archive.c, * archive64.c, * archures.c, * armnetbsd.c, * bfd-in.h, * bfd.c, * bfdio.c, * binary.c, * bout.c, * cache.c, * cisco-core.c, * coff-alpha.c, * coff-apollo.c, * coff-arm.c, * coff-h8300.c, * coff-i386.c, * coff-i860.c, * coff-i960.c, * coff-m68k.c, * coff-m88k.c, * coff-mcore.c, * coff-mips.c, * coff-ppc.c, * coff-rs6000.c, * coff-sh.c, * coff-stgo32.c, * coff-tic4x.c, * coff-tic54x.c, * coff-tic80.c, * coff-we32k.c, * coff-x86_64.c, * coff-z80.c, * coff-z8k.c, * coff64-rs6000.c, * coffcode.h, * coffgen.c, * cofflink.c, * coffswap.h, * compress.c, * corefile.c, * cpu-alpha.c, * cpu-arm.c, * cpu-avr.c, * cpu-bfin.c, * cpu-cr16.c, * cpu-cr16c.c, * cpu-crx.c, * cpu-d10v.c, * cpu-frv.c, * cpu-ft32.c, * cpu-i370.c, * cpu-i960.c, * cpu-ia64-opc.c, * cpu-ip2k.c, * cpu-lm32.c, * cpu-m32r.c, * cpu-mcore.c, * cpu-microblaze.c, * cpu-mips.c, * cpu-moxie.c, * cpu-mt.c, * cpu-nios2.c, * cpu-ns32k.c, * cpu-or1k.c, * cpu-powerpc.c, * cpu-pru.c, * cpu-sh.c, * cpu-spu.c, * cpu-v850.c, * cpu-v850_rh850.c, * cpu-xgate.c, * cpu-z80.c, * dwarf1.c, * dwarf2.c, * ecoff.c, * ecofflink.c, * ecoffswap.h, * elf-bfd.h, * elf-eh-frame.c, * elf-hppa.h, * elf-m10200.c, * elf-m10300.c, * elf-s390-common.c, * elf-strtab.c, * elf-vxworks.c, * elf.c, * elf32-am33lin.c, * elf32-arc.c, * elf32-arm.c, * elf32-avr.c, * elf32-avr.h, * elf32-bfin.c, * elf32-cr16.c, * elf32-cr16c.c, * elf32-cris.c, * elf32-crx.c, * elf32-d10v.c, * elf32-d30v.c, * elf32-dlx.c, * elf32-epiphany.c, * elf32-fr30.c, * elf32-frv.c, * elf32-ft32.c, * elf32-h8300.c, * elf32-hppa.c, * elf32-i386.c, * elf32-i860.c, * elf32-i960.c, * elf32-ip2k.c, * elf32-lm32.c, * elf32-m32c.c, * elf32-m32r.c, * elf32-m68hc11.c, * elf32-m68hc12.c, * elf32-m68hc1x.c, * elf32-m68hc1x.h, * elf32-m68k.c, * elf32-m88k.c, * elf32-mcore.c, * elf32-mep.c, * elf32-metag.c, * elf32-microblaze.c, * elf32-mips.c, * elf32-moxie.c, * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c, * elf32-nds32.h, * elf32-nios2.c, * elf32-or1k.c, * elf32-pj.c, * elf32-ppc.c, * elf32-ppc.h, * elf32-pru.c, * elf32-rl78.c, * elf32-rx.c, * elf32-s390.c, * elf32-score.c, * elf32-score.h, * elf32-score7.c, * elf32-sh-symbian.c, * elf32-sh.c, * elf32-sh64.c, * elf32-sparc.c, * elf32-spu.c, * elf32-tic6x.c, * elf32-tilegx.c, * elf32-tilegx.h, * elf32-tilepro.c, * elf32-tilepro.h, * elf32-v850.c, * elf32-vax.c, * elf32-wasm32.c, * elf32-xc16x.c, * elf32-xgate.c, * elf32-xgate.h, * elf32-xstormy16.c, * elf32-xtensa.c, * elf64-alpha.c, * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mips.c, * elf64-mmix.c, * elf64-ppc.c, * elf64-s390.c, * elf64-sh64.c, * elf64-sparc.c, * elf64-tilegx.c, * elf64-tilegx.h, * elf64-x86-64.c, * elfcore.h, * elflink.c, * elfn32-mips.c, * elfnn-aarch64.c, * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-aarch64.c, * elfxx-aarch64.h, * elfxx-ia64.c, * elfxx-ia64.h, * elfxx-mips.c, * elfxx-riscv.c, * elfxx-sparc.c, * elfxx-tilegx.c, * elfxx-x86.c, * elfxx-x86.h, * freebsd.h, * hash.c, * host-aout.c, * hp300hpux.c, * hppabsd-core.c, * hpux-core.c, * i386aout.c, * i386linux.c, * i386lynx.c, * i386mach3.c, * i386msdos.c, * i386netbsd.c, * ieee.c, * ihex.c, * irix-core.c, * libaout.h, * libbfd-in.h, * libbfd.c, * libcoff-in.h, * libnlm.h, * libpei.h, * libxcoff.h, * linker.c, * lynx-core.c, * m68k4knetbsd.c, * m68klinux.c, * m68knetbsd.c, * m88kmach3.c, * mach-o-aarch64.c, * mach-o-arm.c, * mach-o-i386.c, * mach-o-target.c, * mach-o-x86-64.c, * mach-o.c, * mach-o.h, * merge.c, * mipsbsd.c, * mmo.c, * netbsd.h, * netbsd-core.c, * newsos3.c, * nlm-target.h, * nlm32-ppc.c, * nlm32-sparc.c, * nlmcode.h, * ns32k.h, * ns32knetbsd.c, * oasys.c, * opncls.c, * pc532-mach.c, * pdp11.c, * pe-arm.c, * pe-i386.c, * pe-mcore.c, * pe-mips.c, * pe-x86_64.c, * peXXigen.c, * pef.c, * pef.h, * pei-arm.c, * pei-i386.c, * pei-mcore.c, * pei-x86_64.c, * peicode.h, * plugin.c, * ppcboot.c, * ptrace-core.c, * reloc.c, * riscix.c, * rs6000-core.c, * section.c, * som.c, * som.h, * sparclinux.c, * sparcnetbsd.c, * srec.c, * stabs.c, * sunos.c, * syms.c, * targets.c, * tekhex.c, * trad-core.c, * vax1knetbsd.c, * vaxnetbsd.c, * verilog.c, * versados.c, * vms-alpha.c, * vms-lib.c, * vms-misc.c, * wasm-module.c, * wasm-module.h, * xcofflink.c, * xsym.c, * xsym.h: Whitespace fixes. * bfd-in2.h, * libbfd.h, * libcoff.h: Regenerate.
2017-12-05 23:56:00 +01:00
#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
BFD whitespace fixes Binutils is supposed to use tabs. In my git config I have whitespace = indent-with-non-tab,space-before-tab,trailing-space and I got annoyed enough seeing red in "git diff" output to fix the problems. * doc/header.sed: Trim trailing space when splitting lines. * aix386-core.c, * aout-adobe.c, * aout-arm.c, * aout-cris.c, * aout-ns32k.c, * aout-target.h, * aout-tic30.c, * aoutf1.h, * aoutx.h, * arc-got.h, * arc-plt.def, * arc-plt.h, * archive.c, * archive64.c, * archures.c, * armnetbsd.c, * bfd-in.h, * bfd.c, * bfdio.c, * binary.c, * bout.c, * cache.c, * cisco-core.c, * coff-alpha.c, * coff-apollo.c, * coff-arm.c, * coff-h8300.c, * coff-i386.c, * coff-i860.c, * coff-i960.c, * coff-m68k.c, * coff-m88k.c, * coff-mcore.c, * coff-mips.c, * coff-ppc.c, * coff-rs6000.c, * coff-sh.c, * coff-stgo32.c, * coff-tic4x.c, * coff-tic54x.c, * coff-tic80.c, * coff-we32k.c, * coff-x86_64.c, * coff-z80.c, * coff-z8k.c, * coff64-rs6000.c, * coffcode.h, * coffgen.c, * cofflink.c, * coffswap.h, * compress.c, * corefile.c, * cpu-alpha.c, * cpu-arm.c, * cpu-avr.c, * cpu-bfin.c, * cpu-cr16.c, * cpu-cr16c.c, * cpu-crx.c, * cpu-d10v.c, * cpu-frv.c, * cpu-ft32.c, * cpu-i370.c, * cpu-i960.c, * cpu-ia64-opc.c, * cpu-ip2k.c, * cpu-lm32.c, * cpu-m32r.c, * cpu-mcore.c, * cpu-microblaze.c, * cpu-mips.c, * cpu-moxie.c, * cpu-mt.c, * cpu-nios2.c, * cpu-ns32k.c, * cpu-or1k.c, * cpu-powerpc.c, * cpu-pru.c, * cpu-sh.c, * cpu-spu.c, * cpu-v850.c, * cpu-v850_rh850.c, * cpu-xgate.c, * cpu-z80.c, * dwarf1.c, * dwarf2.c, * ecoff.c, * ecofflink.c, * ecoffswap.h, * elf-bfd.h, * elf-eh-frame.c, * elf-hppa.h, * elf-m10200.c, * elf-m10300.c, * elf-s390-common.c, * elf-strtab.c, * elf-vxworks.c, * elf.c, * elf32-am33lin.c, * elf32-arc.c, * elf32-arm.c, * elf32-avr.c, * elf32-avr.h, * elf32-bfin.c, * elf32-cr16.c, * elf32-cr16c.c, * elf32-cris.c, * elf32-crx.c, * elf32-d10v.c, * elf32-d30v.c, * elf32-dlx.c, * elf32-epiphany.c, * elf32-fr30.c, * elf32-frv.c, * elf32-ft32.c, * elf32-h8300.c, * elf32-hppa.c, * elf32-i386.c, * elf32-i860.c, * elf32-i960.c, * elf32-ip2k.c, * elf32-lm32.c, * elf32-m32c.c, * elf32-m32r.c, * elf32-m68hc11.c, * elf32-m68hc12.c, * elf32-m68hc1x.c, * elf32-m68hc1x.h, * elf32-m68k.c, * elf32-m88k.c, * elf32-mcore.c, * elf32-mep.c, * elf32-metag.c, * elf32-microblaze.c, * elf32-mips.c, * elf32-moxie.c, * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c, * elf32-nds32.h, * elf32-nios2.c, * elf32-or1k.c, * elf32-pj.c, * elf32-ppc.c, * elf32-ppc.h, * elf32-pru.c, * elf32-rl78.c, * elf32-rx.c, * elf32-s390.c, * elf32-score.c, * elf32-score.h, * elf32-score7.c, * elf32-sh-symbian.c, * elf32-sh.c, * elf32-sh64.c, * elf32-sparc.c, * elf32-spu.c, * elf32-tic6x.c, * elf32-tilegx.c, * elf32-tilegx.h, * elf32-tilepro.c, * elf32-tilepro.h, * elf32-v850.c, * elf32-vax.c, * elf32-wasm32.c, * elf32-xc16x.c, * elf32-xgate.c, * elf32-xgate.h, * elf32-xstormy16.c, * elf32-xtensa.c, * elf64-alpha.c, * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mips.c, * elf64-mmix.c, * elf64-ppc.c, * elf64-s390.c, * elf64-sh64.c, * elf64-sparc.c, * elf64-tilegx.c, * elf64-tilegx.h, * elf64-x86-64.c, * elfcore.h, * elflink.c, * elfn32-mips.c, * elfnn-aarch64.c, * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-aarch64.c, * elfxx-aarch64.h, * elfxx-ia64.c, * elfxx-ia64.h, * elfxx-mips.c, * elfxx-riscv.c, * elfxx-sparc.c, * elfxx-tilegx.c, * elfxx-x86.c, * elfxx-x86.h, * freebsd.h, * hash.c, * host-aout.c, * hp300hpux.c, * hppabsd-core.c, * hpux-core.c, * i386aout.c, * i386linux.c, * i386lynx.c, * i386mach3.c, * i386msdos.c, * i386netbsd.c, * ieee.c, * ihex.c, * irix-core.c, * libaout.h, * libbfd-in.h, * libbfd.c, * libcoff-in.h, * libnlm.h, * libpei.h, * libxcoff.h, * linker.c, * lynx-core.c, * m68k4knetbsd.c, * m68klinux.c, * m68knetbsd.c, * m88kmach3.c, * mach-o-aarch64.c, * mach-o-arm.c, * mach-o-i386.c, * mach-o-target.c, * mach-o-x86-64.c, * mach-o.c, * mach-o.h, * merge.c, * mipsbsd.c, * mmo.c, * netbsd.h, * netbsd-core.c, * newsos3.c, * nlm-target.h, * nlm32-ppc.c, * nlm32-sparc.c, * nlmcode.h, * ns32k.h, * ns32knetbsd.c, * oasys.c, * opncls.c, * pc532-mach.c, * pdp11.c, * pe-arm.c, * pe-i386.c, * pe-mcore.c, * pe-mips.c, * pe-x86_64.c, * peXXigen.c, * pef.c, * pef.h, * pei-arm.c, * pei-i386.c, * pei-mcore.c, * pei-x86_64.c, * peicode.h, * plugin.c, * ppcboot.c, * ptrace-core.c, * reloc.c, * riscix.c, * rs6000-core.c, * section.c, * som.c, * som.h, * sparclinux.c, * sparcnetbsd.c, * srec.c, * stabs.c, * sunos.c, * syms.c, * targets.c, * tekhex.c, * trad-core.c, * vax1knetbsd.c, * vaxnetbsd.c, * verilog.c, * versados.c, * vms-alpha.c, * vms-lib.c, * vms-misc.c, * wasm-module.c, * wasm-module.h, * xcofflink.c, * xsym.c, * xsym.h: Whitespace fixes. * bfd-in2.h, * libbfd.h, * libcoff.h: Regenerate.
2017-12-05 23:56:00 +01:00
#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_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_lookup_section_flags bfd_generic_lookup_section_flags
#define bfd_plugin_bfd_merge_sections bfd_generic_merge_sections
#define bfd_plugin_bfd_is_group_section bfd_generic_is_group_section
Tidy ld/ldmisc.c The idea here is to not use elf-bfd.h and coff-bfd.h in generic linker code. bfd/ * targets.c (struct bfd_target): Add _bfd_group_name. (BFD_JUMP_TABLE): Likewise. * coffgen.c (bfd_coff_group_name): New function. * elf.c (bfd_elf_group_name): New function. * linker.c (_bfd_nolink_bfd_group_name): New function. * section.c (bfd_generic_group_name): New function. * elf-bfd.h (bfd_elf_group_name): Declare. * libbfd-in.h (_bfd_nolink_bfd_group_name): Declare. * libcoff-in.h (bfd_coff_group_name): Declare. * aout-target.h (MY_bfd_group_name): Define. * aout-tic30.c (MY_bfd_group_name): Define. * bfd.c (bfd_group_name): Define. * binary.c (binary_bfd_group_name): Define. * coff-alpha.c (_bfd_ecoff_bfd_group_name): Define. * coff-mips.c (_bfd_ecoff_bfd_group_name): Define. * coff-rs6000.c (_bfd_xcoff_bfd_group_name): Define. * coffcode.h (coff_bfd_group_name): Define. * elfxx-target.h (bfd_elfNN_bfd_group_name): Define. * i386msdos.c (msdos_bfd_group_name): Define. * ihex.c (ihex_bfd_group_name): Define. * mach-o-target.c (bfd_mach_o_bfd_group_name): Define. * mmo.c (mmo_bfd_group_name): Define. * pef.c (bfd_pef_bfd_group_name): Define. * plugin.c (bfd_plugin_bfd_group_name): Define. * ppcboot.c (ppcboot_bfd_group_name): Define. * som.c (som_bfd_group_name): Define. * srec.c (srec_bfd_group_name): Define. * tekhex.c (tekhex_bfd_group_name): Define. * verilog.c (verilog_bfd_group_name): Define. * vms-alpha.c (vms_bfd_group_name, alpha_vms_bfd_group_name): Define. * xsym.c (bfd_sym_bfd_group_name): Define. * coff64-rs6000.c (rs6000_xcoff64_vec): Init new field. (rs6000_xcoff64_aix_vec): Likewise. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. * libcoff.h: Regenerate. ld/ * ldmisc.c: Don't #include elf-bfd.h or coff-bfd.h. (vfinfo): Use bfd_group_name.
2019-09-09 07:53:27 +02:00
#define bfd_plugin_bfd_group_name bfd_generic_group_name
BFD whitespace fixes Binutils is supposed to use tabs. In my git config I have whitespace = indent-with-non-tab,space-before-tab,trailing-space and I got annoyed enough seeing red in "git diff" output to fix the problems. * doc/header.sed: Trim trailing space when splitting lines. * aix386-core.c, * aout-adobe.c, * aout-arm.c, * aout-cris.c, * aout-ns32k.c, * aout-target.h, * aout-tic30.c, * aoutf1.h, * aoutx.h, * arc-got.h, * arc-plt.def, * arc-plt.h, * archive.c, * archive64.c, * archures.c, * armnetbsd.c, * bfd-in.h, * bfd.c, * bfdio.c, * binary.c, * bout.c, * cache.c, * cisco-core.c, * coff-alpha.c, * coff-apollo.c, * coff-arm.c, * coff-h8300.c, * coff-i386.c, * coff-i860.c, * coff-i960.c, * coff-m68k.c, * coff-m88k.c, * coff-mcore.c, * coff-mips.c, * coff-ppc.c, * coff-rs6000.c, * coff-sh.c, * coff-stgo32.c, * coff-tic4x.c, * coff-tic54x.c, * coff-tic80.c, * coff-we32k.c, * coff-x86_64.c, * coff-z80.c, * coff-z8k.c, * coff64-rs6000.c, * coffcode.h, * coffgen.c, * cofflink.c, * coffswap.h, * compress.c, * corefile.c, * cpu-alpha.c, * cpu-arm.c, * cpu-avr.c, * cpu-bfin.c, * cpu-cr16.c, * cpu-cr16c.c, * cpu-crx.c, * cpu-d10v.c, * cpu-frv.c, * cpu-ft32.c, * cpu-i370.c, * cpu-i960.c, * cpu-ia64-opc.c, * cpu-ip2k.c, * cpu-lm32.c, * cpu-m32r.c, * cpu-mcore.c, * cpu-microblaze.c, * cpu-mips.c, * cpu-moxie.c, * cpu-mt.c, * cpu-nios2.c, * cpu-ns32k.c, * cpu-or1k.c, * cpu-powerpc.c, * cpu-pru.c, * cpu-sh.c, * cpu-spu.c, * cpu-v850.c, * cpu-v850_rh850.c, * cpu-xgate.c, * cpu-z80.c, * dwarf1.c, * dwarf2.c, * ecoff.c, * ecofflink.c, * ecoffswap.h, * elf-bfd.h, * elf-eh-frame.c, * elf-hppa.h, * elf-m10200.c, * elf-m10300.c, * elf-s390-common.c, * elf-strtab.c, * elf-vxworks.c, * elf.c, * elf32-am33lin.c, * elf32-arc.c, * elf32-arm.c, * elf32-avr.c, * elf32-avr.h, * elf32-bfin.c, * elf32-cr16.c, * elf32-cr16c.c, * elf32-cris.c, * elf32-crx.c, * elf32-d10v.c, * elf32-d30v.c, * elf32-dlx.c, * elf32-epiphany.c, * elf32-fr30.c, * elf32-frv.c, * elf32-ft32.c, * elf32-h8300.c, * elf32-hppa.c, * elf32-i386.c, * elf32-i860.c, * elf32-i960.c, * elf32-ip2k.c, * elf32-lm32.c, * elf32-m32c.c, * elf32-m32r.c, * elf32-m68hc11.c, * elf32-m68hc12.c, * elf32-m68hc1x.c, * elf32-m68hc1x.h, * elf32-m68k.c, * elf32-m88k.c, * elf32-mcore.c, * elf32-mep.c, * elf32-metag.c, * elf32-microblaze.c, * elf32-mips.c, * elf32-moxie.c, * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c, * elf32-nds32.h, * elf32-nios2.c, * elf32-or1k.c, * elf32-pj.c, * elf32-ppc.c, * elf32-ppc.h, * elf32-pru.c, * elf32-rl78.c, * elf32-rx.c, * elf32-s390.c, * elf32-score.c, * elf32-score.h, * elf32-score7.c, * elf32-sh-symbian.c, * elf32-sh.c, * elf32-sh64.c, * elf32-sparc.c, * elf32-spu.c, * elf32-tic6x.c, * elf32-tilegx.c, * elf32-tilegx.h, * elf32-tilepro.c, * elf32-tilepro.h, * elf32-v850.c, * elf32-vax.c, * elf32-wasm32.c, * elf32-xc16x.c, * elf32-xgate.c, * elf32-xgate.h, * elf32-xstormy16.c, * elf32-xtensa.c, * elf64-alpha.c, * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mips.c, * elf64-mmix.c, * elf64-ppc.c, * elf64-s390.c, * elf64-sh64.c, * elf64-sparc.c, * elf64-tilegx.c, * elf64-tilegx.h, * elf64-x86-64.c, * elfcore.h, * elflink.c, * elfn32-mips.c, * elfnn-aarch64.c, * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-aarch64.c, * elfxx-aarch64.h, * elfxx-ia64.c, * elfxx-ia64.h, * elfxx-mips.c, * elfxx-riscv.c, * elfxx-sparc.c, * elfxx-tilegx.c, * elfxx-x86.c, * elfxx-x86.h, * freebsd.h, * hash.c, * host-aout.c, * hp300hpux.c, * hppabsd-core.c, * hpux-core.c, * i386aout.c, * i386linux.c, * i386lynx.c, * i386mach3.c, * i386msdos.c, * i386netbsd.c, * ieee.c, * ihex.c, * irix-core.c, * libaout.h, * libbfd-in.h, * libbfd.c, * libcoff-in.h, * libnlm.h, * libpei.h, * libxcoff.h, * linker.c, * lynx-core.c, * m68k4knetbsd.c, * m68klinux.c, * m68knetbsd.c, * m88kmach3.c, * mach-o-aarch64.c, * mach-o-arm.c, * mach-o-i386.c, * mach-o-target.c, * mach-o-x86-64.c, * mach-o.c, * mach-o.h, * merge.c, * mipsbsd.c, * mmo.c, * netbsd.h, * netbsd-core.c, * newsos3.c, * nlm-target.h, * nlm32-ppc.c, * nlm32-sparc.c, * nlmcode.h, * ns32k.h, * ns32knetbsd.c, * oasys.c, * opncls.c, * pc532-mach.c, * pdp11.c, * pe-arm.c, * pe-i386.c, * pe-mcore.c, * pe-mips.c, * pe-x86_64.c, * peXXigen.c, * pef.c, * pef.h, * pei-arm.c, * pei-i386.c, * pei-mcore.c, * pei-x86_64.c, * peicode.h, * plugin.c, * ppcboot.c, * ptrace-core.c, * reloc.c, * riscix.c, * rs6000-core.c, * section.c, * som.c, * som.h, * sparclinux.c, * sparcnetbsd.c, * srec.c, * stabs.c, * sunos.c, * syms.c, * targets.c, * tekhex.c, * trad-core.c, * vax1knetbsd.c, * vaxnetbsd.c, * verilog.c, * versados.c, * vms-alpha.c, * vms-lib.c, * vms-misc.c, * wasm-module.c, * wasm-module.h, * xcofflink.c, * xsym.c, * xsym.h: Whitespace fixes. * bfd-in2.h, * libbfd.h, * libcoff.h: Regenerate.
2017-12-05 23:56:00 +01:00
#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
ld: Hide symbols defined by HIDDEN/PROVIDE_HIDDEN There should be no difference in output for symbols defined by HIDDEN or PROVIDE_HIDDEN assignments whether they are explicitly marked as hidden or not. This patch adds a new BFD function, bfd_link_hide_symbol, to hide symbols defined by HIDDEN and PROVIDE_HIDDEN assignments. bfd PR ld/23201 * aout-target.h (MY_bfd_link_hide_symbol): New. * aout-tic30.c (MY_bfd_link_hide_symbol): Likewise. * binary.c (binary_bfd_link_hide_symbol): Likewise. * coff-alpha.c (_bfd_ecoff_bfd_link_hide_symbol): Likewise. * coff-mips.c (_bfd_ecoff_bfd_link_hide_symbol): Likewise. * coff-rs6000.c (_bfd_xcoff_bfd_link_hide_symbol): Likewise. * coffcode.h (coff_bfd_link_hide_symbol): Likewise. * elf-bfd.h (_bfd_elf_link_hide_symbol): Likewise. * elfxx-target.h (bfd_elfNN_bfd_link_hide_symbol): Likewise. * i386msdos.c (msdos_bfd_link_hide_symbol): Likewise. * ihex.c (ihex_bfd_link_hide_symbol): Likewise. * libbfd-in.h (_bfd_nolink_bfd_link_hide_symbol): Likewise. * linker.c (_bfd_generic_link_hide_symbol): Likewise. (bfd_link_hide_symbol): Likewise. * mach-o-target.c (bfd_mach_o_bfd_link_hide_symbol): Likewise. * mmo.c (mmo_bfd_link_hide_symbol): Likewise. * pef.c (bfd_pef_bfd_link_hide_symbol): Likewise. * plugin.c (bfd_plugin_bfd_link_hide_symbol): Likewise. * ppcboot.c (ppcboot_bfd_link_hide_symbol): Likewise. * som.c (som_bfd_link_hide_symbol): Likewise. * srec.c (srec_bfd_link_hide_symbol): Likewise. * tekhex.c (tekhex_bfd_link_hide_symbol): Likewise. * vms-alpha.c (vms_bfd_link_hide_symbol): Likewise. (alpha_vms_bfd_link_hide_symbol): Likewise. * xsym.c (bfd_sym_bfd_link_hide_symbol): Likewise. * coff64-rs6000.c (rs6000_xcoff64_vec): Add _bfd_generic_link_hide_symbol. (rs6000_xcoff64_aix_vec): Likewise. * elflink.c (bfd_elf_record_link_assignment): Don't make forced local symbol dynamic. (_bfd_elf_link_hide_symbol): New function. * elfxx-x86.c (_bfd_x86_elf_link_symbol_references_local): Don't check root.ldscript_def. * targets.c (bfd_target): Add _bfd_link_hide_symbol. (BFD_JUMP_TABLE_LINK): Add NAME##_bfd_link_hide_symbol. * bfd-in2.h: Regenerated. * libbfd.h: Likewise. ld/ PR ld/23201 * ldexp.c (exp_fold_tree_1): Call bfd_link_hide_symbol to hide a symbol. * testsuite/ld-elf/provide-hidden-dynabs.nd: Removed. * testsuite/ld-elf/provide-hidden-dynsec.nd: Likewise. * testsuite/ld-elf/provide-hidden.exp: Replace provide-hidden-dynsec.nd with provide-hidden-sec.nd and provide-hidden-dyn.nd. Replace provide-hidden-dynabs.nd with provide-hidden-abs.nd and provide-hidden-dyn.nd. * testsuite/ld-i386/pr23189.d: Expect no dynamic relocation. * testsuite/ld-x86-64/pr23189.d: Likewise.
2018-05-22 05:39:09 +02:00
#define bfd_plugin_bfd_link_hide_symbol _bfd_generic_link_hide_symbol
BFD whitespace fixes Binutils is supposed to use tabs. In my git config I have whitespace = indent-with-non-tab,space-before-tab,trailing-space and I got annoyed enough seeing red in "git diff" output to fix the problems. * doc/header.sed: Trim trailing space when splitting lines. * aix386-core.c, * aout-adobe.c, * aout-arm.c, * aout-cris.c, * aout-ns32k.c, * aout-target.h, * aout-tic30.c, * aoutf1.h, * aoutx.h, * arc-got.h, * arc-plt.def, * arc-plt.h, * archive.c, * archive64.c, * archures.c, * armnetbsd.c, * bfd-in.h, * bfd.c, * bfdio.c, * binary.c, * bout.c, * cache.c, * cisco-core.c, * coff-alpha.c, * coff-apollo.c, * coff-arm.c, * coff-h8300.c, * coff-i386.c, * coff-i860.c, * coff-i960.c, * coff-m68k.c, * coff-m88k.c, * coff-mcore.c, * coff-mips.c, * coff-ppc.c, * coff-rs6000.c, * coff-sh.c, * coff-stgo32.c, * coff-tic4x.c, * coff-tic54x.c, * coff-tic80.c, * coff-we32k.c, * coff-x86_64.c, * coff-z80.c, * coff-z8k.c, * coff64-rs6000.c, * coffcode.h, * coffgen.c, * cofflink.c, * coffswap.h, * compress.c, * corefile.c, * cpu-alpha.c, * cpu-arm.c, * cpu-avr.c, * cpu-bfin.c, * cpu-cr16.c, * cpu-cr16c.c, * cpu-crx.c, * cpu-d10v.c, * cpu-frv.c, * cpu-ft32.c, * cpu-i370.c, * cpu-i960.c, * cpu-ia64-opc.c, * cpu-ip2k.c, * cpu-lm32.c, * cpu-m32r.c, * cpu-mcore.c, * cpu-microblaze.c, * cpu-mips.c, * cpu-moxie.c, * cpu-mt.c, * cpu-nios2.c, * cpu-ns32k.c, * cpu-or1k.c, * cpu-powerpc.c, * cpu-pru.c, * cpu-sh.c, * cpu-spu.c, * cpu-v850.c, * cpu-v850_rh850.c, * cpu-xgate.c, * cpu-z80.c, * dwarf1.c, * dwarf2.c, * ecoff.c, * ecofflink.c, * ecoffswap.h, * elf-bfd.h, * elf-eh-frame.c, * elf-hppa.h, * elf-m10200.c, * elf-m10300.c, * elf-s390-common.c, * elf-strtab.c, * elf-vxworks.c, * elf.c, * elf32-am33lin.c, * elf32-arc.c, * elf32-arm.c, * elf32-avr.c, * elf32-avr.h, * elf32-bfin.c, * elf32-cr16.c, * elf32-cr16c.c, * elf32-cris.c, * elf32-crx.c, * elf32-d10v.c, * elf32-d30v.c, * elf32-dlx.c, * elf32-epiphany.c, * elf32-fr30.c, * elf32-frv.c, * elf32-ft32.c, * elf32-h8300.c, * elf32-hppa.c, * elf32-i386.c, * elf32-i860.c, * elf32-i960.c, * elf32-ip2k.c, * elf32-lm32.c, * elf32-m32c.c, * elf32-m32r.c, * elf32-m68hc11.c, * elf32-m68hc12.c, * elf32-m68hc1x.c, * elf32-m68hc1x.h, * elf32-m68k.c, * elf32-m88k.c, * elf32-mcore.c, * elf32-mep.c, * elf32-metag.c, * elf32-microblaze.c, * elf32-mips.c, * elf32-moxie.c, * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c, * elf32-nds32.h, * elf32-nios2.c, * elf32-or1k.c, * elf32-pj.c, * elf32-ppc.c, * elf32-ppc.h, * elf32-pru.c, * elf32-rl78.c, * elf32-rx.c, * elf32-s390.c, * elf32-score.c, * elf32-score.h, * elf32-score7.c, * elf32-sh-symbian.c, * elf32-sh.c, * elf32-sh64.c, * elf32-sparc.c, * elf32-spu.c, * elf32-tic6x.c, * elf32-tilegx.c, * elf32-tilegx.h, * elf32-tilepro.c, * elf32-tilepro.h, * elf32-v850.c, * elf32-vax.c, * elf32-wasm32.c, * elf32-xc16x.c, * elf32-xgate.c, * elf32-xgate.h, * elf32-xstormy16.c, * elf32-xtensa.c, * elf64-alpha.c, * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mips.c, * elf64-mmix.c, * elf64-ppc.c, * elf64-s390.c, * elf64-sh64.c, * elf64-sparc.c, * elf64-tilegx.c, * elf64-tilegx.h, * elf64-x86-64.c, * elfcore.h, * elflink.c, * elfn32-mips.c, * elfnn-aarch64.c, * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-aarch64.c, * elfxx-aarch64.h, * elfxx-ia64.c, * elfxx-ia64.h, * elfxx-mips.c, * elfxx-riscv.c, * elfxx-sparc.c, * elfxx-tilegx.c, * elfxx-x86.c, * elfxx-x86.h, * freebsd.h, * hash.c, * host-aout.c, * hp300hpux.c, * hppabsd-core.c, * hpux-core.c, * i386aout.c, * i386linux.c, * i386lynx.c, * i386mach3.c, * i386msdos.c, * i386netbsd.c, * ieee.c, * ihex.c, * irix-core.c, * libaout.h, * libbfd-in.h, * libbfd.c, * libcoff-in.h, * libnlm.h, * libpei.h, * libxcoff.h, * linker.c, * lynx-core.c, * m68k4knetbsd.c, * m68klinux.c, * m68knetbsd.c, * m88kmach3.c, * mach-o-aarch64.c, * mach-o-arm.c, * mach-o-i386.c, * mach-o-target.c, * mach-o-x86-64.c, * mach-o.c, * mach-o.h, * merge.c, * mipsbsd.c, * mmo.c, * netbsd.h, * netbsd-core.c, * newsos3.c, * nlm-target.h, * nlm32-ppc.c, * nlm32-sparc.c, * nlmcode.h, * ns32k.h, * ns32knetbsd.c, * oasys.c, * opncls.c, * pc532-mach.c, * pdp11.c, * pe-arm.c, * pe-i386.c, * pe-mcore.c, * pe-mips.c, * pe-x86_64.c, * peXXigen.c, * pef.c, * pef.h, * pei-arm.c, * pei-i386.c, * pei-mcore.c, * pei-x86_64.c, * peicode.h, * plugin.c, * ppcboot.c, * ptrace-core.c, * reloc.c, * riscix.c, * rs6000-core.c, * section.c, * som.c, * som.h, * sparclinux.c, * sparcnetbsd.c, * srec.c, * stabs.c, * sunos.c, * syms.c, * targets.c, * tekhex.c, * trad-core.c, * vax1knetbsd.c, * vaxnetbsd.c, * verilog.c, * versados.c, * vms-alpha.c, * vms-lib.c, * vms-misc.c, * wasm-module.c, * wasm-module.h, * xcofflink.c, * xsym.c, * xsym.h: Whitespace fixes. * bfd-in2.h, * libbfd.h, * libcoff.h: Regenerate.
2017-12-05 23:56:00 +01:00
#define bfd_plugin_bfd_define_start_stop bfd_generic_define_start_stop
#define bfd_plugin_bfd_copy_link_hash_symbol_type _bfd_generic_copy_link_hash_symbol_type
BFD whitespace fixes Binutils is supposed to use tabs. In my git config I have whitespace = indent-with-non-tab,space-before-tab,trailing-space and I got annoyed enough seeing red in "git diff" output to fix the problems. * doc/header.sed: Trim trailing space when splitting lines. * aix386-core.c, * aout-adobe.c, * aout-arm.c, * aout-cris.c, * aout-ns32k.c, * aout-target.h, * aout-tic30.c, * aoutf1.h, * aoutx.h, * arc-got.h, * arc-plt.def, * arc-plt.h, * archive.c, * archive64.c, * archures.c, * armnetbsd.c, * bfd-in.h, * bfd.c, * bfdio.c, * binary.c, * bout.c, * cache.c, * cisco-core.c, * coff-alpha.c, * coff-apollo.c, * coff-arm.c, * coff-h8300.c, * coff-i386.c, * coff-i860.c, * coff-i960.c, * coff-m68k.c, * coff-m88k.c, * coff-mcore.c, * coff-mips.c, * coff-ppc.c, * coff-rs6000.c, * coff-sh.c, * coff-stgo32.c, * coff-tic4x.c, * coff-tic54x.c, * coff-tic80.c, * coff-we32k.c, * coff-x86_64.c, * coff-z80.c, * coff-z8k.c, * coff64-rs6000.c, * coffcode.h, * coffgen.c, * cofflink.c, * coffswap.h, * compress.c, * corefile.c, * cpu-alpha.c, * cpu-arm.c, * cpu-avr.c, * cpu-bfin.c, * cpu-cr16.c, * cpu-cr16c.c, * cpu-crx.c, * cpu-d10v.c, * cpu-frv.c, * cpu-ft32.c, * cpu-i370.c, * cpu-i960.c, * cpu-ia64-opc.c, * cpu-ip2k.c, * cpu-lm32.c, * cpu-m32r.c, * cpu-mcore.c, * cpu-microblaze.c, * cpu-mips.c, * cpu-moxie.c, * cpu-mt.c, * cpu-nios2.c, * cpu-ns32k.c, * cpu-or1k.c, * cpu-powerpc.c, * cpu-pru.c, * cpu-sh.c, * cpu-spu.c, * cpu-v850.c, * cpu-v850_rh850.c, * cpu-xgate.c, * cpu-z80.c, * dwarf1.c, * dwarf2.c, * ecoff.c, * ecofflink.c, * ecoffswap.h, * elf-bfd.h, * elf-eh-frame.c, * elf-hppa.h, * elf-m10200.c, * elf-m10300.c, * elf-s390-common.c, * elf-strtab.c, * elf-vxworks.c, * elf.c, * elf32-am33lin.c, * elf32-arc.c, * elf32-arm.c, * elf32-avr.c, * elf32-avr.h, * elf32-bfin.c, * elf32-cr16.c, * elf32-cr16c.c, * elf32-cris.c, * elf32-crx.c, * elf32-d10v.c, * elf32-d30v.c, * elf32-dlx.c, * elf32-epiphany.c, * elf32-fr30.c, * elf32-frv.c, * elf32-ft32.c, * elf32-h8300.c, * elf32-hppa.c, * elf32-i386.c, * elf32-i860.c, * elf32-i960.c, * elf32-ip2k.c, * elf32-lm32.c, * elf32-m32c.c, * elf32-m32r.c, * elf32-m68hc11.c, * elf32-m68hc12.c, * elf32-m68hc1x.c, * elf32-m68hc1x.h, * elf32-m68k.c, * elf32-m88k.c, * elf32-mcore.c, * elf32-mep.c, * elf32-metag.c, * elf32-microblaze.c, * elf32-mips.c, * elf32-moxie.c, * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c, * elf32-nds32.h, * elf32-nios2.c, * elf32-or1k.c, * elf32-pj.c, * elf32-ppc.c, * elf32-ppc.h, * elf32-pru.c, * elf32-rl78.c, * elf32-rx.c, * elf32-s390.c, * elf32-score.c, * elf32-score.h, * elf32-score7.c, * elf32-sh-symbian.c, * elf32-sh.c, * elf32-sh64.c, * elf32-sparc.c, * elf32-spu.c, * elf32-tic6x.c, * elf32-tilegx.c, * elf32-tilegx.h, * elf32-tilepro.c, * elf32-tilepro.h, * elf32-v850.c, * elf32-vax.c, * elf32-wasm32.c, * elf32-xc16x.c, * elf32-xgate.c, * elf32-xgate.h, * elf32-xstormy16.c, * elf32-xtensa.c, * elf64-alpha.c, * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mips.c, * elf64-mmix.c, * elf64-ppc.c, * elf64-s390.c, * elf64-sh64.c, * elf64-sparc.c, * elf64-tilegx.c, * elf64-tilegx.h, * elf64-x86-64.c, * elfcore.h, * elflink.c, * elfn32-mips.c, * elfnn-aarch64.c, * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-aarch64.c, * elfxx-aarch64.h, * elfxx-ia64.c, * elfxx-ia64.h, * elfxx-mips.c, * elfxx-riscv.c, * elfxx-sparc.c, * elfxx-tilegx.c, * elfxx-x86.c, * elfxx-x86.h, * freebsd.h, * hash.c, * host-aout.c, * hp300hpux.c, * hppabsd-core.c, * hpux-core.c, * i386aout.c, * i386linux.c, * i386lynx.c, * i386mach3.c, * i386msdos.c, * i386netbsd.c, * ieee.c, * ihex.c, * irix-core.c, * libaout.h, * libbfd-in.h, * libbfd.c, * libcoff-in.h, * libnlm.h, * libpei.h, * libxcoff.h, * linker.c, * lynx-core.c, * m68k4knetbsd.c, * m68klinux.c, * m68knetbsd.c, * m88kmach3.c, * mach-o-aarch64.c, * mach-o-arm.c, * mach-o-i386.c, * mach-o-target.c, * mach-o-x86-64.c, * mach-o.c, * mach-o.h, * merge.c, * mipsbsd.c, * mmo.c, * netbsd.h, * netbsd-core.c, * newsos3.c, * nlm-target.h, * nlm32-ppc.c, * nlm32-sparc.c, * nlmcode.h, * ns32k.h, * ns32knetbsd.c, * oasys.c, * opncls.c, * pc532-mach.c, * pdp11.c, * pe-arm.c, * pe-i386.c, * pe-mcore.c, * pe-mips.c, * pe-x86_64.c, * peXXigen.c, * pef.c, * pef.h, * pei-arm.c, * pei-i386.c, * pei-mcore.c, * pei-x86_64.c, * peicode.h, * plugin.c, * ppcboot.c, * ptrace-core.c, * reloc.c, * riscix.c, * rs6000-core.c, * section.c, * som.c, * som.h, * sparclinux.c, * sparcnetbsd.c, * srec.c, * stabs.c, * sunos.c, * syms.c, * targets.c, * tekhex.c, * trad-core.c, * vax1knetbsd.c, * vaxnetbsd.c, * verilog.c, * versados.c, * vms-alpha.c, * vms-lib.c, * vms-misc.c, * wasm-module.c, * wasm-module.h, * xcofflink.c, * xsym.c, * xsym.h: Whitespace fixes. * bfd-in2.h, * libbfd.h, * libcoff.h: Regenerate.
2017-12-05 23:56:00 +01:00
#define bfd_plugin_bfd_link_check_relocs _bfd_generic_link_check_relocs
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);
putchar ('\n');
va_end (args);
return LDPS_OK;
}
Use GCC LTO wrapper to get real symbols from LTO IR objects GCC LTO wrapper is needed to extract real symbols from LTO IR objects. This patch does the following: 1. Set up GCC LTO wrapper for each LTO IR object. 2. Run GCC LTO wrapper to get the real object. 3. Extract symbol info from the real object. 4. Cleanup afterwards. bfd/ PR binutils/25355 * configure.ac (HAVE_EXECUTABLE_SUFFIX): New AC_DEFINE. (EXECUTABLE_SUFFIX): Likewise. * config.in: Regenerated. * configure: Likewise. * plugin.c (bfd_plugin_close_and_cleanup): Removed. (plugin_list_entry): Add all_symbols_read, cleanup_handler, gcc, lto_wrapper, resolution_file, resolution_option, gcc_env, real_bfd, real_nsyms, real_syms, lto_nsyms and lto_syms. (get_lto_wrapper): New. (setup_lto_wrapper_env): Likewise. (current_plugin): Likewise. (register_all_symbols_read): Likewise. (register_cleanup): Likewise. (get_symbols): Likewise. (add_input_file): Likewise. (bfd_plugin_close_and_cleanup): Likewise. (claim_file): Removed. (register_claim_file): Set current_plugin->claim_file. (add_symbols): Make a copy of LTO symbols. Set lto_nsyms and lto_syms in current_plugin. (try_claim): Use current_plugin->claim_file. Call LTO plugin all_symbols_read handler. Copy real symbols to plugin_data. Call LTO plugin cleanup handler. Clean up for LTO wrapper. (try_load_plugin): Don't reuse the previous plugin for LTO wrapper. Set up GCC LTO wrapper if possible. Don't set plugin_list_iter->claim_file. (bfd_plugin_canonicalize_symtab): Use real LTO symbols if possible. * plugin.h (plugin_data_struct): Add real_bfd, real_nsyms and real_syms. ld/ PR binutils/25355 * testsuite/ld-plugin/lto.exp: Run PR binutils/25355 test. * testsuite/ld-plugin/pr25355.c: New file. * testsuite/ld-plugin/pr25355.d: Likewise. * testsuite/lib/ld-lib.exp (run_cc_link_tests): Support compile only dump.
2020-02-11 04:01:42 +01:00
struct plugin_list_entry
{
/* These must be initialized for each IR object with LTO wrapper. */
ld_plugin_claim_file_handler claim_file;
ld_plugin_all_symbols_read_handler all_symbols_read;
ld_plugin_all_symbols_read_handler cleanup_handler;
bfd_boolean has_symbol_type;
Use GCC LTO wrapper to get real symbols from LTO IR objects GCC LTO wrapper is needed to extract real symbols from LTO IR objects. This patch does the following: 1. Set up GCC LTO wrapper for each LTO IR object. 2. Run GCC LTO wrapper to get the real object. 3. Extract symbol info from the real object. 4. Cleanup afterwards. bfd/ PR binutils/25355 * configure.ac (HAVE_EXECUTABLE_SUFFIX): New AC_DEFINE. (EXECUTABLE_SUFFIX): Likewise. * config.in: Regenerated. * configure: Likewise. * plugin.c (bfd_plugin_close_and_cleanup): Removed. (plugin_list_entry): Add all_symbols_read, cleanup_handler, gcc, lto_wrapper, resolution_file, resolution_option, gcc_env, real_bfd, real_nsyms, real_syms, lto_nsyms and lto_syms. (get_lto_wrapper): New. (setup_lto_wrapper_env): Likewise. (current_plugin): Likewise. (register_all_symbols_read): Likewise. (register_cleanup): Likewise. (get_symbols): Likewise. (add_input_file): Likewise. (bfd_plugin_close_and_cleanup): Likewise. (claim_file): Removed. (register_claim_file): Set current_plugin->claim_file. (add_symbols): Make a copy of LTO symbols. Set lto_nsyms and lto_syms in current_plugin. (try_claim): Use current_plugin->claim_file. Call LTO plugin all_symbols_read handler. Copy real symbols to plugin_data. Call LTO plugin cleanup handler. Clean up for LTO wrapper. (try_load_plugin): Don't reuse the previous plugin for LTO wrapper. Set up GCC LTO wrapper if possible. Don't set plugin_list_iter->claim_file. (bfd_plugin_canonicalize_symtab): Use real LTO symbols if possible. * plugin.h (plugin_data_struct): Add real_bfd, real_nsyms and real_syms. ld/ PR binutils/25355 * testsuite/ld-plugin/lto.exp: Run PR binutils/25355 test. * testsuite/ld-plugin/pr25355.c: New file. * testsuite/ld-plugin/pr25355.d: Likewise. * testsuite/lib/ld-lib.exp (run_cc_link_tests): Support compile only dump.
2020-02-11 04:01:42 +01:00
struct plugin_list_entry *next;
/* These can be reused for all IR objects. */
const char *plugin_name;
};
static const char *plugin_program_name;
void
bfd_plugin_set_program_name (const char *program_name)
{
plugin_program_name = program_name;
Use GCC LTO wrapper to get real symbols from LTO IR objects GCC LTO wrapper is needed to extract real symbols from LTO IR objects. This patch does the following: 1. Set up GCC LTO wrapper for each LTO IR object. 2. Run GCC LTO wrapper to get the real object. 3. Extract symbol info from the real object. 4. Cleanup afterwards. bfd/ PR binutils/25355 * configure.ac (HAVE_EXECUTABLE_SUFFIX): New AC_DEFINE. (EXECUTABLE_SUFFIX): Likewise. * config.in: Regenerated. * configure: Likewise. * plugin.c (bfd_plugin_close_and_cleanup): Removed. (plugin_list_entry): Add all_symbols_read, cleanup_handler, gcc, lto_wrapper, resolution_file, resolution_option, gcc_env, real_bfd, real_nsyms, real_syms, lto_nsyms and lto_syms. (get_lto_wrapper): New. (setup_lto_wrapper_env): Likewise. (current_plugin): Likewise. (register_all_symbols_read): Likewise. (register_cleanup): Likewise. (get_symbols): Likewise. (add_input_file): Likewise. (bfd_plugin_close_and_cleanup): Likewise. (claim_file): Removed. (register_claim_file): Set current_plugin->claim_file. (add_symbols): Make a copy of LTO symbols. Set lto_nsyms and lto_syms in current_plugin. (try_claim): Use current_plugin->claim_file. Call LTO plugin all_symbols_read handler. Copy real symbols to plugin_data. Call LTO plugin cleanup handler. Clean up for LTO wrapper. (try_load_plugin): Don't reuse the previous plugin for LTO wrapper. Set up GCC LTO wrapper if possible. Don't set plugin_list_iter->claim_file. (bfd_plugin_canonicalize_symtab): Use real LTO symbols if possible. * plugin.h (plugin_data_struct): Add real_bfd, real_nsyms and real_syms. ld/ PR binutils/25355 * testsuite/ld-plugin/lto.exp: Run PR binutils/25355 test. * testsuite/ld-plugin/pr25355.c: New file. * testsuite/ld-plugin/pr25355.d: Likewise. * testsuite/lib/ld-lib.exp (run_cc_link_tests): Support compile only dump.
2020-02-11 04:01:42 +01:00
}
static struct plugin_list_entry *plugin_list = NULL;
static struct plugin_list_entry *current_plugin = NULL;
/* Register a claim-file handler. */
static enum ld_plugin_status
register_claim_file (ld_plugin_claim_file_handler handler)
{
Use GCC LTO wrapper to get real symbols from LTO IR objects GCC LTO wrapper is needed to extract real symbols from LTO IR objects. This patch does the following: 1. Set up GCC LTO wrapper for each LTO IR object. 2. Run GCC LTO wrapper to get the real object. 3. Extract symbol info from the real object. 4. Cleanup afterwards. bfd/ PR binutils/25355 * configure.ac (HAVE_EXECUTABLE_SUFFIX): New AC_DEFINE. (EXECUTABLE_SUFFIX): Likewise. * config.in: Regenerated. * configure: Likewise. * plugin.c (bfd_plugin_close_and_cleanup): Removed. (plugin_list_entry): Add all_symbols_read, cleanup_handler, gcc, lto_wrapper, resolution_file, resolution_option, gcc_env, real_bfd, real_nsyms, real_syms, lto_nsyms and lto_syms. (get_lto_wrapper): New. (setup_lto_wrapper_env): Likewise. (current_plugin): Likewise. (register_all_symbols_read): Likewise. (register_cleanup): Likewise. (get_symbols): Likewise. (add_input_file): Likewise. (bfd_plugin_close_and_cleanup): Likewise. (claim_file): Removed. (register_claim_file): Set current_plugin->claim_file. (add_symbols): Make a copy of LTO symbols. Set lto_nsyms and lto_syms in current_plugin. (try_claim): Use current_plugin->claim_file. Call LTO plugin all_symbols_read handler. Copy real symbols to plugin_data. Call LTO plugin cleanup handler. Clean up for LTO wrapper. (try_load_plugin): Don't reuse the previous plugin for LTO wrapper. Set up GCC LTO wrapper if possible. Don't set plugin_list_iter->claim_file. (bfd_plugin_canonicalize_symtab): Use real LTO symbols if possible. * plugin.h (plugin_data_struct): Add real_bfd, real_nsyms and real_syms. ld/ PR binutils/25355 * testsuite/ld-plugin/lto.exp: Run PR binutils/25355 test. * testsuite/ld-plugin/pr25355.c: New file. * testsuite/ld-plugin/pr25355.d: Likewise. * testsuite/lib/ld-lib.exp (run_cc_link_tests): Support compile only dump.
2020-02-11 04:01:42 +01:00
current_plugin->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));
if (!plugin_data)
return LDPS_ERR;
Use GCC LTO wrapper to get real symbols from LTO IR objects GCC LTO wrapper is needed to extract real symbols from LTO IR objects. This patch does the following: 1. Set up GCC LTO wrapper for each LTO IR object. 2. Run GCC LTO wrapper to get the real object. 3. Extract symbol info from the real object. 4. Cleanup afterwards. bfd/ PR binutils/25355 * configure.ac (HAVE_EXECUTABLE_SUFFIX): New AC_DEFINE. (EXECUTABLE_SUFFIX): Likewise. * config.in: Regenerated. * configure: Likewise. * plugin.c (bfd_plugin_close_and_cleanup): Removed. (plugin_list_entry): Add all_symbols_read, cleanup_handler, gcc, lto_wrapper, resolution_file, resolution_option, gcc_env, real_bfd, real_nsyms, real_syms, lto_nsyms and lto_syms. (get_lto_wrapper): New. (setup_lto_wrapper_env): Likewise. (current_plugin): Likewise. (register_all_symbols_read): Likewise. (register_cleanup): Likewise. (get_symbols): Likewise. (add_input_file): Likewise. (bfd_plugin_close_and_cleanup): Likewise. (claim_file): Removed. (register_claim_file): Set current_plugin->claim_file. (add_symbols): Make a copy of LTO symbols. Set lto_nsyms and lto_syms in current_plugin. (try_claim): Use current_plugin->claim_file. Call LTO plugin all_symbols_read handler. Copy real symbols to plugin_data. Call LTO plugin cleanup handler. Clean up for LTO wrapper. (try_load_plugin): Don't reuse the previous plugin for LTO wrapper. Set up GCC LTO wrapper if possible. Don't set plugin_list_iter->claim_file. (bfd_plugin_canonicalize_symtab): Use real LTO symbols if possible. * plugin.h (plugin_data_struct): Add real_bfd, real_nsyms and real_syms. ld/ PR binutils/25355 * testsuite/ld-plugin/lto.exp: Run PR binutils/25355 test. * testsuite/ld-plugin/pr25355.c: New file. * testsuite/ld-plugin/pr25355.d: Likewise. * testsuite/lib/ld-lib.exp (run_cc_link_tests): Support compile only dump.
2020-02-11 04:01:42 +01:00
plugin_data->nsyms = nsyms;
plugin_data->syms = syms;
if (nsyms != 0)
abfd->flags |= HAS_SYMS;
abfd->tdata.plugin_data = plugin_data;
return LDPS_OK;
}
static enum ld_plugin_status
add_symbols_v2 (void *handle, int nsyms,
const struct ld_plugin_symbol *syms)
{
current_plugin->has_symbol_type = TRUE;
return add_symbols (handle, nsyms, syms);
}
int
bfd_plugin_open_input (bfd *ibfd, struct ld_plugin_input_file *file)
{
bfd *iobfd;
iobfd = ibfd;
while (iobfd->my_archive
&& !bfd_is_thin_archive (iobfd->my_archive))
iobfd = iobfd->my_archive;
file->name = iobfd->filename;
if (!iobfd->iostream && !bfd_open_file (iobfd))
return 0;
/* The plugin API expects that the file descriptor won't be closed
and reused as done by the bfd file cache. So open it again.
dup isn't good enough. plugin IO uses lseek/read while BFD uses
fseek/fread. It isn't wise to mix the unistd and stdio calls on
the same underlying file descriptor. */
file->fd = open (file->name, O_RDONLY | O_BINARY);
if (file->fd < 0)
return 0;
if (iobfd == ibfd)
{
struct stat stat_buf;
if (fstat (file->fd, &stat_buf))
{
close(file->fd);
return 0;
}
file->offset = 0;
file->filesize = stat_buf.st_size;
}
else
{
file->offset = ibfd->origin;
file->filesize = arelt_size (ibfd);
}
return 1;
}
static int
try_claim (bfd *abfd)
{
int claimed = 0;
struct ld_plugin_input_file file;
file.handle = abfd;
if (bfd_plugin_open_input (abfd, &file)
&& current_plugin->claim_file)
Use GCC LTO wrapper to get real symbols from LTO IR objects GCC LTO wrapper is needed to extract real symbols from LTO IR objects. This patch does the following: 1. Set up GCC LTO wrapper for each LTO IR object. 2. Run GCC LTO wrapper to get the real object. 3. Extract symbol info from the real object. 4. Cleanup afterwards. bfd/ PR binutils/25355 * configure.ac (HAVE_EXECUTABLE_SUFFIX): New AC_DEFINE. (EXECUTABLE_SUFFIX): Likewise. * config.in: Regenerated. * configure: Likewise. * plugin.c (bfd_plugin_close_and_cleanup): Removed. (plugin_list_entry): Add all_symbols_read, cleanup_handler, gcc, lto_wrapper, resolution_file, resolution_option, gcc_env, real_bfd, real_nsyms, real_syms, lto_nsyms and lto_syms. (get_lto_wrapper): New. (setup_lto_wrapper_env): Likewise. (current_plugin): Likewise. (register_all_symbols_read): Likewise. (register_cleanup): Likewise. (get_symbols): Likewise. (add_input_file): Likewise. (bfd_plugin_close_and_cleanup): Likewise. (claim_file): Removed. (register_claim_file): Set current_plugin->claim_file. (add_symbols): Make a copy of LTO symbols. Set lto_nsyms and lto_syms in current_plugin. (try_claim): Use current_plugin->claim_file. Call LTO plugin all_symbols_read handler. Copy real symbols to plugin_data. Call LTO plugin cleanup handler. Clean up for LTO wrapper. (try_load_plugin): Don't reuse the previous plugin for LTO wrapper. Set up GCC LTO wrapper if possible. Don't set plugin_list_iter->claim_file. (bfd_plugin_canonicalize_symtab): Use real LTO symbols if possible. * plugin.h (plugin_data_struct): Add real_bfd, real_nsyms and real_syms. ld/ PR binutils/25355 * testsuite/ld-plugin/lto.exp: Run PR binutils/25355 test. * testsuite/ld-plugin/pr25355.c: New file. * testsuite/ld-plugin/pr25355.d: Likewise. * testsuite/lib/ld-lib.exp (run_cc_link_tests): Support compile only dump.
2020-02-11 04:01:42 +01:00
{
current_plugin->claim_file (&file, &claimed);
close (file.fd);
Use GCC LTO wrapper to get real symbols from LTO IR objects GCC LTO wrapper is needed to extract real symbols from LTO IR objects. This patch does the following: 1. Set up GCC LTO wrapper for each LTO IR object. 2. Run GCC LTO wrapper to get the real object. 3. Extract symbol info from the real object. 4. Cleanup afterwards. bfd/ PR binutils/25355 * configure.ac (HAVE_EXECUTABLE_SUFFIX): New AC_DEFINE. (EXECUTABLE_SUFFIX): Likewise. * config.in: Regenerated. * configure: Likewise. * plugin.c (bfd_plugin_close_and_cleanup): Removed. (plugin_list_entry): Add all_symbols_read, cleanup_handler, gcc, lto_wrapper, resolution_file, resolution_option, gcc_env, real_bfd, real_nsyms, real_syms, lto_nsyms and lto_syms. (get_lto_wrapper): New. (setup_lto_wrapper_env): Likewise. (current_plugin): Likewise. (register_all_symbols_read): Likewise. (register_cleanup): Likewise. (get_symbols): Likewise. (add_input_file): Likewise. (bfd_plugin_close_and_cleanup): Likewise. (claim_file): Removed. (register_claim_file): Set current_plugin->claim_file. (add_symbols): Make a copy of LTO symbols. Set lto_nsyms and lto_syms in current_plugin. (try_claim): Use current_plugin->claim_file. Call LTO plugin all_symbols_read handler. Copy real symbols to plugin_data. Call LTO plugin cleanup handler. Clean up for LTO wrapper. (try_load_plugin): Don't reuse the previous plugin for LTO wrapper. Set up GCC LTO wrapper if possible. Don't set plugin_list_iter->claim_file. (bfd_plugin_canonicalize_symtab): Use real LTO symbols if possible. * plugin.h (plugin_data_struct): Add real_bfd, real_nsyms and real_syms. ld/ PR binutils/25355 * testsuite/ld-plugin/lto.exp: Run PR binutils/25355 test. * testsuite/ld-plugin/pr25355.c: New file. * testsuite/ld-plugin/pr25355.d: Likewise. * testsuite/lib/ld-lib.exp (run_cc_link_tests): Support compile only dump.
2020-02-11 04:01:42 +01:00
}
return claimed;
}
static int
try_load_plugin (const char *pname,
struct plugin_list_entry *plugin_list_iter,
bfd *abfd, bfd_boolean build_list_p)
{
void *plugin_handle;
struct ld_plugin_tv tv[5];
int i;
ld_plugin_onload onload;
enum ld_plugin_status status;
int result = 0;
Merge linker plugin handling into BFD plugin support 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
2015-02-11 14:01:03 +01:00
/* NB: Each object is independent. Reuse the previous plugin from
the last run will lead to wrong result. */
if (current_plugin)
memset (current_plugin, 0,
offsetof (struct plugin_list_entry, next));
Use GCC LTO wrapper to get real symbols from LTO IR objects GCC LTO wrapper is needed to extract real symbols from LTO IR objects. This patch does the following: 1. Set up GCC LTO wrapper for each LTO IR object. 2. Run GCC LTO wrapper to get the real object. 3. Extract symbol info from the real object. 4. Cleanup afterwards. bfd/ PR binutils/25355 * configure.ac (HAVE_EXECUTABLE_SUFFIX): New AC_DEFINE. (EXECUTABLE_SUFFIX): Likewise. * config.in: Regenerated. * configure: Likewise. * plugin.c (bfd_plugin_close_and_cleanup): Removed. (plugin_list_entry): Add all_symbols_read, cleanup_handler, gcc, lto_wrapper, resolution_file, resolution_option, gcc_env, real_bfd, real_nsyms, real_syms, lto_nsyms and lto_syms. (get_lto_wrapper): New. (setup_lto_wrapper_env): Likewise. (current_plugin): Likewise. (register_all_symbols_read): Likewise. (register_cleanup): Likewise. (get_symbols): Likewise. (add_input_file): Likewise. (bfd_plugin_close_and_cleanup): Likewise. (claim_file): Removed. (register_claim_file): Set current_plugin->claim_file. (add_symbols): Make a copy of LTO symbols. Set lto_nsyms and lto_syms in current_plugin. (try_claim): Use current_plugin->claim_file. Call LTO plugin all_symbols_read handler. Copy real symbols to plugin_data. Call LTO plugin cleanup handler. Clean up for LTO wrapper. (try_load_plugin): Don't reuse the previous plugin for LTO wrapper. Set up GCC LTO wrapper if possible. Don't set plugin_list_iter->claim_file. (bfd_plugin_canonicalize_symtab): Use real LTO symbols if possible. * plugin.h (plugin_data_struct): Add real_bfd, real_nsyms and real_syms. ld/ PR binutils/25355 * testsuite/ld-plugin/lto.exp: Run PR binutils/25355 test. * testsuite/ld-plugin/pr25355.c: New file. * testsuite/ld-plugin/pr25355.d: Likewise. * testsuite/lib/ld-lib.exp (run_cc_link_tests): Support compile only dump.
2020-02-11 04:01:42 +01:00
if (plugin_list_iter)
pname = plugin_list_iter->plugin_name;
plugin_handle = dlopen (pname, RTLD_NOW);
if (!plugin_handle)
{
Remove syntactic sugar Now that _bfd_error_handler is not a function pointer. * aout-adobe.c: Replace (*_bfd_error_handler) (...) with _bfd_error_handler (...) throughout. * aout-cris.c, * aoutx.h, * archive.c, * bfd.c, * binary.c, * cache.c, * coff-alpha.c, * coff-arm.c, * coff-h8300.c, * coff-i860.c, * coff-mcore.c, * coff-ppc.c, * coff-rs6000.c, * coff-sh.c, * coff-tic4x.c, * coff-tic54x.c, * coff-tic80.c, * coff64-rs6000.c, * coffcode.h, * coffgen.c, * cofflink.c, * coffswap.h, * cpu-arm.c, * cpu-m68k.c, * cpu-sh.c, * dwarf2.c, * ecoff.c, * elf-eh-frame.c, * elf-m10300.c, * elf.c, * elf32-arc.c, * elf32-arm.c, * elf32-avr.c, * elf32-bfin.c, * elf32-cr16.c, * elf32-cris.c, * elf32-crx.c, * elf32-dlx.c, * elf32-frv.c, * elf32-hppa.c, * elf32-i370.c, * elf32-i386.c, * elf32-lm32.c, * elf32-m32c.c, * elf32-m32r.c, * elf32-m68hc1x.c, * elf32-m68k.c, * elf32-mcore.c, * elf32-mep.c, * elf32-metag.c, * elf32-microblaze.c, * elf32-mips.c, * elf32-nds32.c, * elf32-nios2.c, * elf32-or1k.c, * elf32-pj.c, * elf32-ppc.c, * elf32-rl78.c, * elf32-s390.c, * elf32-score.c, * elf32-score7.c, * elf32-sh.c, * elf32-sh64.c, * elf32-sparc.c, * elf32-spu.c, * elf32-tic6x.c, * elf32-tilepro.c, * elf32-v850.c, * elf32-vax.c, * elf32-xtensa.c, * elf64-alpha.c, * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mips.c, * elf64-mmix.c, * elf64-ppc.c, * elf64-s390.c, * elf64-sh64.c, * elf64-sparc.c, * elf64-x86-64.c, * elfcode.h, * elfcore.h, * elflink.c, * elfn32-mips.c, * elfnn-aarch64.c, * elfnn-ia64.c, * elfxx-mips.c, * elfxx-sparc.c, * elfxx-tilegx.c, * hpux-core.c, * i386linux.c, * ieee.c, * ihex.c, * libbfd.c, * linker.c, * m68klinux.c, * mach-o.c, * merge.c, * mmo.c, * oasys.c, * osf-core.c, * pdp11.c, * pe-mips.c, * peXXigen.c, * pef.c, * plugin.c, * reloc.c, * rs6000-core.c, * sco5-core.c, * som.c, * sparclinux.c, * srec.c, * stabs.c, * syms.c, * vms-alpha.c, * vms-lib.c, * vms-misc.c, * xcofflink.c: Likewise.
2016-09-30 05:30:18 +02:00
_bfd_error_handler ("%s\n", dlerror ());
return 0;
}
if (plugin_list_iter == NULL)
{
size_t length_plugin_name = strlen (pname) + 1;
char *plugin_name = bfd_malloc (length_plugin_name);
if (plugin_name == NULL)
goto short_circuit;
plugin_list_iter = bfd_malloc (sizeof *plugin_list_iter);
if (plugin_list_iter == NULL)
{
free (plugin_name);
goto short_circuit;
}
/* Make a copy of PNAME since PNAME from load_plugin () will be
freed. */
memcpy (plugin_name, pname, length_plugin_name);
memset (plugin_list_iter, 0, sizeof (*plugin_list_iter));
plugin_list_iter->plugin_name = plugin_name;
plugin_list_iter->next = plugin_list;
plugin_list = plugin_list_iter;
}
current_plugin = plugin_list_iter;
if (build_list_p)
goto short_circuit;
Use GCC LTO wrapper to get real symbols from LTO IR objects GCC LTO wrapper is needed to extract real symbols from LTO IR objects. This patch does the following: 1. Set up GCC LTO wrapper for each LTO IR object. 2. Run GCC LTO wrapper to get the real object. 3. Extract symbol info from the real object. 4. Cleanup afterwards. bfd/ PR binutils/25355 * configure.ac (HAVE_EXECUTABLE_SUFFIX): New AC_DEFINE. (EXECUTABLE_SUFFIX): Likewise. * config.in: Regenerated. * configure: Likewise. * plugin.c (bfd_plugin_close_and_cleanup): Removed. (plugin_list_entry): Add all_symbols_read, cleanup_handler, gcc, lto_wrapper, resolution_file, resolution_option, gcc_env, real_bfd, real_nsyms, real_syms, lto_nsyms and lto_syms. (get_lto_wrapper): New. (setup_lto_wrapper_env): Likewise. (current_plugin): Likewise. (register_all_symbols_read): Likewise. (register_cleanup): Likewise. (get_symbols): Likewise. (add_input_file): Likewise. (bfd_plugin_close_and_cleanup): Likewise. (claim_file): Removed. (register_claim_file): Set current_plugin->claim_file. (add_symbols): Make a copy of LTO symbols. Set lto_nsyms and lto_syms in current_plugin. (try_claim): Use current_plugin->claim_file. Call LTO plugin all_symbols_read handler. Copy real symbols to plugin_data. Call LTO plugin cleanup handler. Clean up for LTO wrapper. (try_load_plugin): Don't reuse the previous plugin for LTO wrapper. Set up GCC LTO wrapper if possible. Don't set plugin_list_iter->claim_file. (bfd_plugin_canonicalize_symtab): Use real LTO symbols if possible. * plugin.h (plugin_data_struct): Add real_bfd, real_nsyms and real_syms. ld/ PR binutils/25355 * testsuite/ld-plugin/lto.exp: Run PR binutils/25355 test. * testsuite/ld-plugin/pr25355.c: New file. * testsuite/ld-plugin/pr25355.d: Likewise. * testsuite/lib/ld-lib.exp (run_cc_link_tests): Support compile only dump.
2020-02-11 04:01:42 +01:00
onload = dlsym (plugin_handle, "onload");
if (!onload)
goto short_circuit;
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_ADD_SYMBOLS_V2;
tv[i].tv_u.tv_add_symbols = add_symbols_v2;
++i;
tv[i].tv_tag = LDPT_NULL;
tv[i].tv_u.tv_val = 0;
Use GCC LTO wrapper to get real symbols from LTO IR objects GCC LTO wrapper is needed to extract real symbols from LTO IR objects. This patch does the following: 1. Set up GCC LTO wrapper for each LTO IR object. 2. Run GCC LTO wrapper to get the real object. 3. Extract symbol info from the real object. 4. Cleanup afterwards. bfd/ PR binutils/25355 * configure.ac (HAVE_EXECUTABLE_SUFFIX): New AC_DEFINE. (EXECUTABLE_SUFFIX): Likewise. * config.in: Regenerated. * configure: Likewise. * plugin.c (bfd_plugin_close_and_cleanup): Removed. (plugin_list_entry): Add all_symbols_read, cleanup_handler, gcc, lto_wrapper, resolution_file, resolution_option, gcc_env, real_bfd, real_nsyms, real_syms, lto_nsyms and lto_syms. (get_lto_wrapper): New. (setup_lto_wrapper_env): Likewise. (current_plugin): Likewise. (register_all_symbols_read): Likewise. (register_cleanup): Likewise. (get_symbols): Likewise. (add_input_file): Likewise. (bfd_plugin_close_and_cleanup): Likewise. (claim_file): Removed. (register_claim_file): Set current_plugin->claim_file. (add_symbols): Make a copy of LTO symbols. Set lto_nsyms and lto_syms in current_plugin. (try_claim): Use current_plugin->claim_file. Call LTO plugin all_symbols_read handler. Copy real symbols to plugin_data. Call LTO plugin cleanup handler. Clean up for LTO wrapper. (try_load_plugin): Don't reuse the previous plugin for LTO wrapper. Set up GCC LTO wrapper if possible. Don't set plugin_list_iter->claim_file. (bfd_plugin_canonicalize_symtab): Use real LTO symbols if possible. * plugin.h (plugin_data_struct): Add real_bfd, real_nsyms and real_syms. ld/ PR binutils/25355 * testsuite/ld-plugin/lto.exp: Run PR binutils/25355 test. * testsuite/ld-plugin/pr25355.c: New file. * testsuite/ld-plugin/pr25355.d: Likewise. * testsuite/lib/ld-lib.exp (run_cc_link_tests): Support compile only dump.
2020-02-11 04:01:42 +01:00
/* LTO plugin will call handler hooks to set up plugin handlers. */
status = (*onload)(tv);
if (status != LDPS_OK)
goto short_circuit;
Merge linker plugin handling into BFD plugin support 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
2015-02-11 14:01:03 +01:00
abfd->plugin_format = bfd_plugin_no;
Use GCC LTO wrapper to get real symbols from LTO IR objects GCC LTO wrapper is needed to extract real symbols from LTO IR objects. This patch does the following: 1. Set up GCC LTO wrapper for each LTO IR object. 2. Run GCC LTO wrapper to get the real object. 3. Extract symbol info from the real object. 4. Cleanup afterwards. bfd/ PR binutils/25355 * configure.ac (HAVE_EXECUTABLE_SUFFIX): New AC_DEFINE. (EXECUTABLE_SUFFIX): Likewise. * config.in: Regenerated. * configure: Likewise. * plugin.c (bfd_plugin_close_and_cleanup): Removed. (plugin_list_entry): Add all_symbols_read, cleanup_handler, gcc, lto_wrapper, resolution_file, resolution_option, gcc_env, real_bfd, real_nsyms, real_syms, lto_nsyms and lto_syms. (get_lto_wrapper): New. (setup_lto_wrapper_env): Likewise. (current_plugin): Likewise. (register_all_symbols_read): Likewise. (register_cleanup): Likewise. (get_symbols): Likewise. (add_input_file): Likewise. (bfd_plugin_close_and_cleanup): Likewise. (claim_file): Removed. (register_claim_file): Set current_plugin->claim_file. (add_symbols): Make a copy of LTO symbols. Set lto_nsyms and lto_syms in current_plugin. (try_claim): Use current_plugin->claim_file. Call LTO plugin all_symbols_read handler. Copy real symbols to plugin_data. Call LTO plugin cleanup handler. Clean up for LTO wrapper. (try_load_plugin): Don't reuse the previous plugin for LTO wrapper. Set up GCC LTO wrapper if possible. Don't set plugin_list_iter->claim_file. (bfd_plugin_canonicalize_symtab): Use real LTO symbols if possible. * plugin.h (plugin_data_struct): Add real_bfd, real_nsyms and real_syms. ld/ PR binutils/25355 * testsuite/ld-plugin/lto.exp: Run PR binutils/25355 test. * testsuite/ld-plugin/pr25355.c: New file. * testsuite/ld-plugin/pr25355.d: Likewise. * testsuite/lib/ld-lib.exp (run_cc_link_tests): Support compile only dump.
2020-02-11 04:01:42 +01:00
if (!current_plugin->claim_file)
goto short_circuit;
if (!try_claim (abfd))
goto short_circuit;
Merge linker plugin handling into BFD plugin support 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
2015-02-11 14:01:03 +01:00
abfd->plugin_format = bfd_plugin_yes;
result = 1;
Indent labels Labels don't go in the first column according to standard emacs C indent rules, and I got annoyed enough at seeing diff -p show a label rather than the function name to fix this. bfd/ * aoutx.h: Indent labels correctly. Format error strings. * archive.c: Likewise. * archive64.c: Likewise. * coff-arm.c: Likewise. * coff-rs6000.c: Likewise. * coff-stgo32.c: Likewise. * cpu-arm.c: Likewise. * dwarf2.c: Likewise. * elf-ifunc.c: Likewise. * elf-properties.c: Likewise. * elf-s390-common.c: Likewise. * elf-strtab.c: Likewise. * elf.c: Likewise. * elf32-arm.c: Likewise. * elf32-bfin.c: Likewise. * elf32-cr16.c: Likewise. * elf32-csky.c: Likewise. * elf32-i386.c: Likewise. * elf32-m68k.c: Likewise. * elf32-msp430.c: Likewise. * elf32-nds32.c: Likewise. * elf32-nios2.c: Likewise. * elf32-pru.c: Likewise. * elf32-xtensa.c: Likewise. * elf64-ia64-vms.c: Likewise. * elf64-x86-64.c: Likewise. * elfcode.h: Likewise. * elfcore.h: Likewise. * elflink.c: Likewise. * elfnn-aarch64.c: Likewise. * elfnn-ia64.c: Likewise. * elfnn-riscv.c: Likewise. * elfxx-mips.c: Likewise. * elfxx-sparc.c: Likewise. * elfxx-x86.c: Likewise. * i386lynx.c: Likewise. * merge.c: Likewise. * pdp11.c: Likewise. * plugin.c: Likewise. * reloc.c: Likewise. binutils/ * elfedit.c: Indent labels correctly. * readelf.c: Likewise. * resres.c: Likewise. gas/ * config/obj-elf.c: Indent labels correctly. * config/obj-macho.c: Likewise. * config/tc-aarch64.c: Likewise. * config/tc-alpha.c: Likewise. * config/tc-arm.c: Likewise. * config/tc-cr16.c: Likewise. * config/tc-crx.c: Likewise. * config/tc-frv.c: Likewise. * config/tc-i386-intel.c: Likewise. * config/tc-i386.c: Likewise. * config/tc-ia64.c: Likewise. * config/tc-mn10200.c: Likewise. * config/tc-mn10300.c: Likewise. * config/tc-nds32.c: Likewise. * config/tc-riscv.c: Likewise. * config/tc-s12z.c: Likewise. * config/tc-xtensa.c: Likewise. * config/tc-z80.c: Likewise. * read.c: Likewise. * symbols.c: Likewise. * write.c: Likewise. ld/ * emultempl/cskyelf.em: Indent labels correctly. * ldfile.c: Likewise. * ldlang.c: Likewise. * plugin.c: Likewise. opcodes/ * aarch64-asm.c: Indent labels correctly. * aarch64-dis.c: Likewise. * aarch64-gen.c: Likewise. * aarch64-opc.c: Likewise. * alpha-dis.c: Likewise. * i386-dis.c: Likewise. * nds32-asm.c: Likewise. * nfp-dis.c: Likewise. * visium-dis.c: Likewise.
2020-02-25 06:04:46 +01:00
short_circuit:
dlclose (plugin_handle);
return result;
}
Merge linker plugin handling into BFD plugin support 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
2015-02-11 14:01:03 +01:00
/* There may be plugin libraries in lib/bfd-plugins. */
static int has_plugin_list = -1;
Merge linker plugin handling into BFD plugin support 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
2015-02-11 14:01:03 +01:00
bfd_cleanup for object_p The object_p (and archive_p, core_file_p) functions are not supposed to have any target specific malloc'd memory attached to the bfd on their return. This should be obvious on a failure return, but it's also true for a successful return. The reason is that even though the object_p recognises the file, that particular target may not be used and thus the bfd won't be closed calling close_and_cleanup for the target that allocated the memory. It turns out that the object_p bfd_target* return value isn't needed. In all cases except ld/plugin.c the target is abfd->xvec and with ld/plugin.c the target isn't used. So this patch returns a cleanup function from object_p instead, called in bfd_check_format_matches to tidy the bfd before trying a different target match. The only cleanup that does anything at this stage is the alpha-vms one. bfd/ * targets.c (bfd_cleanup): New typedef. (struct bfd <_bfd_check_format>): Return a bfd_cleanup. * libbfd-in.h (_bfd_no_cleanup): Define. * format.c (bfd_reinit): Add cleanup parameter, call it. (bfd_check_format_matches): Set cleanup from _bfd_check_format call and pass to bfd_reinit. Delete temp, use abfd->xvec instead. * aout-target.h (callback, object_p): Return bfd_cleanup. * aout-tic30.c (tic30_aout_callback, tic30_aout_object_p): Likewise. * archive.c (bfd_generic_archive_p): Likewise. * binary.c (binary_object_p): Likewise. * coff-alpha.c (alpha_ecoff_object_p): Likewise. * coff-ia64.c (ia64coff_object_p): Likewise. * coff-rs6000.c (_bfd_xcoff_archive_p, rs6000coff_core_p): Likewise. * coff-sh.c (coff_small_object_p): Likewise. * coff-stgo32.c (go32_check_format): Likewise. * coff64-rs6000.c (xcoff64_archive_p, rs6000coff_core_p), (xcoff64_core_p): Likewise. * coffgen.c (coff_real_object_p, coff_object_p): Likewise. * elf-bfd.h (bfd_elf32_object_p, bfd_elf32_core_file_p), (bfd_elf64_object_p, bfd_elf64_core_file_p): Likewise. * elfcode.h (elf_object_p): Likewise. * elfcore.h (elf_core_file_p): Likewise. * i386msdos.c (msdos_object_p): Likewise. * ihex.c (ihex_object_p): Likewise. * libaout.h (some_aout_object_p): Likewise. * libbfd-in.h (bfd_generic_archive_p, _bfd_dummy_target), (_bfd_vms_lib_alpha_archive_p, _bfd_vms_lib_ia64_archive_p): Likewise. * libbfd.c (_bfd_dummy_target): Likewise. * libcoff-in.h (coff_object_p): Likewise. * mach-o-aarch64.c (bfd_mach_o_arm64_object_p), (bfd_mach_o_arm64_core_p): Likewise. * mach-o-arm.c (bfd_mach_o_arm_object_p), (bfd_mach_o_arm_core_p): Likewise. * mach-o-i386.c (bfd_mach_o_i386_object_p), (bfd_mach_o_i386_core_p): Likewise. * mach-o-x86-64.c (bfd_mach_o_x86_64_object_p), (bfd_mach_o_x86_64_core_p): Likewise. * mach-o.c (bfd_mach_o_header_p, bfd_mach_o_gen_object_p), (bfd_mach_o_gen_core_p, bfd_mach_o_fat_archive_p): Likewise. * mach-o.h (bfd_mach_o_object_p, bfd_mach_o_core_p), (bfd_mach_o_fat_archive_p, bfd_mach_o_header_p): Likewise. * mmo.c (mmo_object_p): Likewise. * pef.c (bfd_pef_object_p, bfd_pef_xlib_object_p): Likewise. * peicode.h (coff_real_object_p, pe_ILF_object_p), (pe_bfd_object_p): Likewise. * plugin.c (ld_plugin_object_p, bfd_plugin_object_p): Likewise. * ppcboot.c (ppcboot_object_p): Likewise. * rs6000-core.c (rs6000coff_core_p): Likewise. * som.c (som_object_setup, som_object_p): Likewise. * srec.c (srec_object_p, symbolsrec_object_p): Likewise. * tekhex.c (tekhex_object_p): Likewise. * vms-alpha.c (alpha_vms_object_p): Likewise. * vms-lib.c (_bfd_vms_lib_archive_p, _bfd_vms_lib_alpha_archive_p), (_bfd_vms_lib_ia64_archive_p, _bfd_vms_lib_txt_archive_p): Likewise. * wasm-module.c (wasm_object_p): Likewise. * xsym.c (bfd_sym_object_p): Likewise. * xsym.h (bfd_sym_object_p): Likewise. * aoutx.h (some_aout_object_p): Likewise, and callback parameter return type. * pdp11.c (some_aout_object_p): Likewise. * plugin.c (register_ld_plugin_object_p): Update object_p parameter type. * plugin.h (register_ld_plugin_object_p): Likewise. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. * libcoff.h: Regenerate. ld/ * plugin.c (plugin_object_p): Return a bfd_cleanup. (plugin_cleanup): New function.
2020-03-02 05:51:09 +01:00
static bfd_cleanup (*ld_plugin_object_p) (bfd *);
Merge linker plugin handling into BFD plugin support 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
2015-02-11 14:01:03 +01:00
static const char *plugin_name;
void
bfd_plugin_set_plugin (const char *p)
{
plugin_name = p;
Merge linker plugin handling into BFD plugin support 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
2015-02-11 14:01:03 +01:00
}
/* Return TRUE if a plugin library is used. */
bfd_boolean
bfd_plugin_specified_p (void)
{
return plugin_list != NULL;
Merge linker plugin handling into BFD plugin support 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
2015-02-11 14:01:03 +01:00
}
/* Return TRUE if ABFD can be claimed by linker LTO plugin. */
bfd_boolean
bfd_link_plugin_object_p (bfd *abfd)
{
if (ld_plugin_object_p)
return ld_plugin_object_p (abfd) != NULL;
return FALSE;
}
Merge linker plugin handling into BFD plugin support 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
2015-02-11 14:01:03 +01:00
extern const bfd_target plugin_vec;
/* Return TRUE if TARGET is a pointer to plugin_vec. */
bfd_boolean
bfd_plugin_target_p (const bfd_target *target)
{
return target == &plugin_vec;
}
/* Register OBJECT_P to be used by bfd_plugin_object_p. */
void
bfd_cleanup for object_p The object_p (and archive_p, core_file_p) functions are not supposed to have any target specific malloc'd memory attached to the bfd on their return. This should be obvious on a failure return, but it's also true for a successful return. The reason is that even though the object_p recognises the file, that particular target may not be used and thus the bfd won't be closed calling close_and_cleanup for the target that allocated the memory. It turns out that the object_p bfd_target* return value isn't needed. In all cases except ld/plugin.c the target is abfd->xvec and with ld/plugin.c the target isn't used. So this patch returns a cleanup function from object_p instead, called in bfd_check_format_matches to tidy the bfd before trying a different target match. The only cleanup that does anything at this stage is the alpha-vms one. bfd/ * targets.c (bfd_cleanup): New typedef. (struct bfd <_bfd_check_format>): Return a bfd_cleanup. * libbfd-in.h (_bfd_no_cleanup): Define. * format.c (bfd_reinit): Add cleanup parameter, call it. (bfd_check_format_matches): Set cleanup from _bfd_check_format call and pass to bfd_reinit. Delete temp, use abfd->xvec instead. * aout-target.h (callback, object_p): Return bfd_cleanup. * aout-tic30.c (tic30_aout_callback, tic30_aout_object_p): Likewise. * archive.c (bfd_generic_archive_p): Likewise. * binary.c (binary_object_p): Likewise. * coff-alpha.c (alpha_ecoff_object_p): Likewise. * coff-ia64.c (ia64coff_object_p): Likewise. * coff-rs6000.c (_bfd_xcoff_archive_p, rs6000coff_core_p): Likewise. * coff-sh.c (coff_small_object_p): Likewise. * coff-stgo32.c (go32_check_format): Likewise. * coff64-rs6000.c (xcoff64_archive_p, rs6000coff_core_p), (xcoff64_core_p): Likewise. * coffgen.c (coff_real_object_p, coff_object_p): Likewise. * elf-bfd.h (bfd_elf32_object_p, bfd_elf32_core_file_p), (bfd_elf64_object_p, bfd_elf64_core_file_p): Likewise. * elfcode.h (elf_object_p): Likewise. * elfcore.h (elf_core_file_p): Likewise. * i386msdos.c (msdos_object_p): Likewise. * ihex.c (ihex_object_p): Likewise. * libaout.h (some_aout_object_p): Likewise. * libbfd-in.h (bfd_generic_archive_p, _bfd_dummy_target), (_bfd_vms_lib_alpha_archive_p, _bfd_vms_lib_ia64_archive_p): Likewise. * libbfd.c (_bfd_dummy_target): Likewise. * libcoff-in.h (coff_object_p): Likewise. * mach-o-aarch64.c (bfd_mach_o_arm64_object_p), (bfd_mach_o_arm64_core_p): Likewise. * mach-o-arm.c (bfd_mach_o_arm_object_p), (bfd_mach_o_arm_core_p): Likewise. * mach-o-i386.c (bfd_mach_o_i386_object_p), (bfd_mach_o_i386_core_p): Likewise. * mach-o-x86-64.c (bfd_mach_o_x86_64_object_p), (bfd_mach_o_x86_64_core_p): Likewise. * mach-o.c (bfd_mach_o_header_p, bfd_mach_o_gen_object_p), (bfd_mach_o_gen_core_p, bfd_mach_o_fat_archive_p): Likewise. * mach-o.h (bfd_mach_o_object_p, bfd_mach_o_core_p), (bfd_mach_o_fat_archive_p, bfd_mach_o_header_p): Likewise. * mmo.c (mmo_object_p): Likewise. * pef.c (bfd_pef_object_p, bfd_pef_xlib_object_p): Likewise. * peicode.h (coff_real_object_p, pe_ILF_object_p), (pe_bfd_object_p): Likewise. * plugin.c (ld_plugin_object_p, bfd_plugin_object_p): Likewise. * ppcboot.c (ppcboot_object_p): Likewise. * rs6000-core.c (rs6000coff_core_p): Likewise. * som.c (som_object_setup, som_object_p): Likewise. * srec.c (srec_object_p, symbolsrec_object_p): Likewise. * tekhex.c (tekhex_object_p): Likewise. * vms-alpha.c (alpha_vms_object_p): Likewise. * vms-lib.c (_bfd_vms_lib_archive_p, _bfd_vms_lib_alpha_archive_p), (_bfd_vms_lib_ia64_archive_p, _bfd_vms_lib_txt_archive_p): Likewise. * wasm-module.c (wasm_object_p): Likewise. * xsym.c (bfd_sym_object_p): Likewise. * xsym.h (bfd_sym_object_p): Likewise. * aoutx.h (some_aout_object_p): Likewise, and callback parameter return type. * pdp11.c (some_aout_object_p): Likewise. * plugin.c (register_ld_plugin_object_p): Update object_p parameter type. * plugin.h (register_ld_plugin_object_p): Likewise. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. * libcoff.h: Regenerate. ld/ * plugin.c (plugin_object_p): Return a bfd_cleanup. (plugin_cleanup): New function.
2020-03-02 05:51:09 +01:00
register_ld_plugin_object_p (bfd_cleanup (*object_p) (bfd *))
Merge linker plugin handling into BFD plugin support 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
2015-02-11 14:01:03 +01:00
{
ld_plugin_object_p = object_p;
}
static void
build_plugin_list (bfd *abfd)
{
/* The intent was to search ${libdir}/bfd-plugins for plugins, but
unfortunately the original implementation wasn't precisely that
when configuring binutils using --libdir. Search in the proper
path first, then the old one for backwards compatibility. */
static const char *path[]
= { LIBDIR "/bfd-plugins", BINDIR "/../lib/bfd-plugins" };
struct stat last_st;
unsigned int i;
if (has_plugin_list >= 0)
return;
/* Try not to search the same dir twice, by looking at st_dev and
st_ino for the dir. If we are on a file system that always sets
st_ino to zero or the actual st_ino is zero we might waste some
time, but that doesn't matter too much. */
last_st.st_dev = 0;
last_st.st_ino = 0;
for (i = 0; i < sizeof (path) / sizeof (path[0]); i++)
{
char *plugin_dir = make_relative_prefix (plugin_program_name,
BINDIR,
path[i]);
if (plugin_dir)
{
struct stat st;
DIR *d;
if (stat (plugin_dir, &st) == 0
&& S_ISDIR (st.st_mode)
&& !(last_st.st_dev == st.st_dev
&& last_st.st_ino == st.st_ino
&& st.st_ino != 0)
&& (d = opendir (plugin_dir)) != NULL)
{
struct dirent *ent;
last_st.st_dev = st.st_dev;
last_st.st_ino = st.st_ino;
while ((ent = readdir (d)) != NULL)
{
char *full_name;
full_name = concat (plugin_dir, "/", ent->d_name, NULL);
if (stat (full_name, &st) == 0 && S_ISREG (st.st_mode))
try_load_plugin (full_name, NULL, abfd, TRUE);
free (full_name);
}
closedir (d);
}
free (plugin_dir);
}
}
has_plugin_list = plugin_list != NULL;
}
static int
load_plugin (bfd *abfd)
{
struct plugin_list_entry *plugin_list_iter;
if (plugin_name)
return try_load_plugin (plugin_name, plugin_list, abfd, FALSE);
if (plugin_program_name == NULL)
return 0;
build_plugin_list (abfd);
for (plugin_list_iter = plugin_list;
plugin_list_iter;
plugin_list_iter = plugin_list_iter->next)
if (try_load_plugin (NULL, plugin_list_iter, abfd, FALSE))
return 1;
return 0;
}
bfd_cleanup for object_p The object_p (and archive_p, core_file_p) functions are not supposed to have any target specific malloc'd memory attached to the bfd on their return. This should be obvious on a failure return, but it's also true for a successful return. The reason is that even though the object_p recognises the file, that particular target may not be used and thus the bfd won't be closed calling close_and_cleanup for the target that allocated the memory. It turns out that the object_p bfd_target* return value isn't needed. In all cases except ld/plugin.c the target is abfd->xvec and with ld/plugin.c the target isn't used. So this patch returns a cleanup function from object_p instead, called in bfd_check_format_matches to tidy the bfd before trying a different target match. The only cleanup that does anything at this stage is the alpha-vms one. bfd/ * targets.c (bfd_cleanup): New typedef. (struct bfd <_bfd_check_format>): Return a bfd_cleanup. * libbfd-in.h (_bfd_no_cleanup): Define. * format.c (bfd_reinit): Add cleanup parameter, call it. (bfd_check_format_matches): Set cleanup from _bfd_check_format call and pass to bfd_reinit. Delete temp, use abfd->xvec instead. * aout-target.h (callback, object_p): Return bfd_cleanup. * aout-tic30.c (tic30_aout_callback, tic30_aout_object_p): Likewise. * archive.c (bfd_generic_archive_p): Likewise. * binary.c (binary_object_p): Likewise. * coff-alpha.c (alpha_ecoff_object_p): Likewise. * coff-ia64.c (ia64coff_object_p): Likewise. * coff-rs6000.c (_bfd_xcoff_archive_p, rs6000coff_core_p): Likewise. * coff-sh.c (coff_small_object_p): Likewise. * coff-stgo32.c (go32_check_format): Likewise. * coff64-rs6000.c (xcoff64_archive_p, rs6000coff_core_p), (xcoff64_core_p): Likewise. * coffgen.c (coff_real_object_p, coff_object_p): Likewise. * elf-bfd.h (bfd_elf32_object_p, bfd_elf32_core_file_p), (bfd_elf64_object_p, bfd_elf64_core_file_p): Likewise. * elfcode.h (elf_object_p): Likewise. * elfcore.h (elf_core_file_p): Likewise. * i386msdos.c (msdos_object_p): Likewise. * ihex.c (ihex_object_p): Likewise. * libaout.h (some_aout_object_p): Likewise. * libbfd-in.h (bfd_generic_archive_p, _bfd_dummy_target), (_bfd_vms_lib_alpha_archive_p, _bfd_vms_lib_ia64_archive_p): Likewise. * libbfd.c (_bfd_dummy_target): Likewise. * libcoff-in.h (coff_object_p): Likewise. * mach-o-aarch64.c (bfd_mach_o_arm64_object_p), (bfd_mach_o_arm64_core_p): Likewise. * mach-o-arm.c (bfd_mach_o_arm_object_p), (bfd_mach_o_arm_core_p): Likewise. * mach-o-i386.c (bfd_mach_o_i386_object_p), (bfd_mach_o_i386_core_p): Likewise. * mach-o-x86-64.c (bfd_mach_o_x86_64_object_p), (bfd_mach_o_x86_64_core_p): Likewise. * mach-o.c (bfd_mach_o_header_p, bfd_mach_o_gen_object_p), (bfd_mach_o_gen_core_p, bfd_mach_o_fat_archive_p): Likewise. * mach-o.h (bfd_mach_o_object_p, bfd_mach_o_core_p), (bfd_mach_o_fat_archive_p, bfd_mach_o_header_p): Likewise. * mmo.c (mmo_object_p): Likewise. * pef.c (bfd_pef_object_p, bfd_pef_xlib_object_p): Likewise. * peicode.h (coff_real_object_p, pe_ILF_object_p), (pe_bfd_object_p): Likewise. * plugin.c (ld_plugin_object_p, bfd_plugin_object_p): Likewise. * ppcboot.c (ppcboot_object_p): Likewise. * rs6000-core.c (rs6000coff_core_p): Likewise. * som.c (som_object_setup, som_object_p): Likewise. * srec.c (srec_object_p, symbolsrec_object_p): Likewise. * tekhex.c (tekhex_object_p): Likewise. * vms-alpha.c (alpha_vms_object_p): Likewise. * vms-lib.c (_bfd_vms_lib_archive_p, _bfd_vms_lib_alpha_archive_p), (_bfd_vms_lib_ia64_archive_p, _bfd_vms_lib_txt_archive_p): Likewise. * wasm-module.c (wasm_object_p): Likewise. * xsym.c (bfd_sym_object_p): Likewise. * xsym.h (bfd_sym_object_p): Likewise. * aoutx.h (some_aout_object_p): Likewise, and callback parameter return type. * pdp11.c (some_aout_object_p): Likewise. * plugin.c (register_ld_plugin_object_p): Update object_p parameter type. * plugin.h (register_ld_plugin_object_p): Likewise. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. * libcoff.h: Regenerate. ld/ * plugin.c (plugin_object_p): Return a bfd_cleanup. (plugin_cleanup): New function.
2020-03-02 05:51:09 +01:00
static bfd_cleanup
bfd_plugin_object_p (bfd *abfd)
{
Merge linker plugin handling into BFD plugin support 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
2015-02-11 14:01:03 +01:00
if (ld_plugin_object_p)
return ld_plugin_object_p (abfd);
if (abfd->plugin_format == bfd_plugin_unknown && !load_plugin (abfd))
return NULL;
bfd_cleanup for object_p The object_p (and archive_p, core_file_p) functions are not supposed to have any target specific malloc'd memory attached to the bfd on their return. This should be obvious on a failure return, but it's also true for a successful return. The reason is that even though the object_p recognises the file, that particular target may not be used and thus the bfd won't be closed calling close_and_cleanup for the target that allocated the memory. It turns out that the object_p bfd_target* return value isn't needed. In all cases except ld/plugin.c the target is abfd->xvec and with ld/plugin.c the target isn't used. So this patch returns a cleanup function from object_p instead, called in bfd_check_format_matches to tidy the bfd before trying a different target match. The only cleanup that does anything at this stage is the alpha-vms one. bfd/ * targets.c (bfd_cleanup): New typedef. (struct bfd <_bfd_check_format>): Return a bfd_cleanup. * libbfd-in.h (_bfd_no_cleanup): Define. * format.c (bfd_reinit): Add cleanup parameter, call it. (bfd_check_format_matches): Set cleanup from _bfd_check_format call and pass to bfd_reinit. Delete temp, use abfd->xvec instead. * aout-target.h (callback, object_p): Return bfd_cleanup. * aout-tic30.c (tic30_aout_callback, tic30_aout_object_p): Likewise. * archive.c (bfd_generic_archive_p): Likewise. * binary.c (binary_object_p): Likewise. * coff-alpha.c (alpha_ecoff_object_p): Likewise. * coff-ia64.c (ia64coff_object_p): Likewise. * coff-rs6000.c (_bfd_xcoff_archive_p, rs6000coff_core_p): Likewise. * coff-sh.c (coff_small_object_p): Likewise. * coff-stgo32.c (go32_check_format): Likewise. * coff64-rs6000.c (xcoff64_archive_p, rs6000coff_core_p), (xcoff64_core_p): Likewise. * coffgen.c (coff_real_object_p, coff_object_p): Likewise. * elf-bfd.h (bfd_elf32_object_p, bfd_elf32_core_file_p), (bfd_elf64_object_p, bfd_elf64_core_file_p): Likewise. * elfcode.h (elf_object_p): Likewise. * elfcore.h (elf_core_file_p): Likewise. * i386msdos.c (msdos_object_p): Likewise. * ihex.c (ihex_object_p): Likewise. * libaout.h (some_aout_object_p): Likewise. * libbfd-in.h (bfd_generic_archive_p, _bfd_dummy_target), (_bfd_vms_lib_alpha_archive_p, _bfd_vms_lib_ia64_archive_p): Likewise. * libbfd.c (_bfd_dummy_target): Likewise. * libcoff-in.h (coff_object_p): Likewise. * mach-o-aarch64.c (bfd_mach_o_arm64_object_p), (bfd_mach_o_arm64_core_p): Likewise. * mach-o-arm.c (bfd_mach_o_arm_object_p), (bfd_mach_o_arm_core_p): Likewise. * mach-o-i386.c (bfd_mach_o_i386_object_p), (bfd_mach_o_i386_core_p): Likewise. * mach-o-x86-64.c (bfd_mach_o_x86_64_object_p), (bfd_mach_o_x86_64_core_p): Likewise. * mach-o.c (bfd_mach_o_header_p, bfd_mach_o_gen_object_p), (bfd_mach_o_gen_core_p, bfd_mach_o_fat_archive_p): Likewise. * mach-o.h (bfd_mach_o_object_p, bfd_mach_o_core_p), (bfd_mach_o_fat_archive_p, bfd_mach_o_header_p): Likewise. * mmo.c (mmo_object_p): Likewise. * pef.c (bfd_pef_object_p, bfd_pef_xlib_object_p): Likewise. * peicode.h (coff_real_object_p, pe_ILF_object_p), (pe_bfd_object_p): Likewise. * plugin.c (ld_plugin_object_p, bfd_plugin_object_p): Likewise. * ppcboot.c (ppcboot_object_p): Likewise. * rs6000-core.c (rs6000coff_core_p): Likewise. * som.c (som_object_setup, som_object_p): Likewise. * srec.c (srec_object_p, symbolsrec_object_p): Likewise. * tekhex.c (tekhex_object_p): Likewise. * vms-alpha.c (alpha_vms_object_p): Likewise. * vms-lib.c (_bfd_vms_lib_archive_p, _bfd_vms_lib_alpha_archive_p), (_bfd_vms_lib_ia64_archive_p, _bfd_vms_lib_txt_archive_p): Likewise. * wasm-module.c (wasm_object_p): Likewise. * xsym.c (bfd_sym_object_p): Likewise. * xsym.h (bfd_sym_object_p): Likewise. * aoutx.h (some_aout_object_p): Likewise, and callback parameter return type. * pdp11.c (some_aout_object_p): Likewise. * plugin.c (register_ld_plugin_object_p): Update object_p parameter type. * plugin.h (register_ld_plugin_object_p): Likewise. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. * libcoff.h: Regenerate. ld/ * plugin.c (plugin_object_p): Return a bfd_cleanup. (plugin_cleanup): New function.
2020-03-02 05:51:09 +01:00
return abfd->plugin_format == bfd_plugin_yes ? _bfd_no_cleanup : NULL;
}
/* 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)
2010-08-18 Pedro Alves <pedro@codesourcery.com> PR corefile/8210 bfd/ * bfd-in2.h: Regenerate. * corefile.c (bfd_core_file_pid): New. * targets.c (BFD_JUMP_TABLE_CORE): Add NAME##_core_file_pid. (struct bfd_target) <_core_file_pid>: New. * libbfd-in.h (_bfd_nocore_core_file_pid): Declare. * libbfd.c (_bfd_nocore_core_file_pid): New. * elf-bfd.h (bfd_elf32_core_file_pid, bfd_elf64_core_file_pid): Declare. * elfcode.h (elf_core_file_pid): New define. * elfcore.h (elf_core_file_pid): New function. * elf.c (elfcore_make_pid): Rewrite. (elfcore_grok_prstatus): Only set core_pid if not set yet. (elfcore_grok_prstatus) [!HAVE_PRSTATUS_T_PR_WHO]: Fallback to getting the lwpid from prstat.pr_pid. * elf64-x86-64.c (elf64_x86_64_grok_prstatus): Write the LWPID to elf_tdata's core_lwpid instead of to core_pid. (elf64_x86_64_grok_psinfo): Extract the the main process's PID, and store it in elf_tdata's core_pid field. * elf32-i386.c (elf_i386_grok_prstatus): Write the LWPID to elf_tdata's core_lwpid instead of to core_pid. (elf_i386_grok_psinfo): Extract the the main process's PID, and store it in elf_tdata's core_pid field. * elf32-am33lin.c (elf32_am33lin_grok_prstatus): Write the LWPID to elf_tdata's core_lwpid instead of to core_pid. * elf32-arm.c (elf32_arm_nabi_grok_prstatus): Write the LWPID to elf_tdata's core_lwpid instead of to core_pid. * elf32-cris.c (cris_elf_grok_prstatus): Write the LWPID to elf_tdata's core_lwpid instead of to core_pid. * elf32-frv.c (elf32_frv_grok_prstatus): Write the LWPID to elf_tdata's core_lwpid instead of to core_pid. * elf32-hppa.c (elf32_hppa_grok_prstatus): Write the LWPID to elf_tdata's core_lwpid instead of to core_pid. * elf32-mips.c (elf32_mips_grok_prstatus): Write the LWPID to elf_tdata's core_lwpid instead of to core_pid. * elf32-ppc.c (ppc_elf_grok_prstatus): Write the LWPID to elf_tdata's core_lwpid instead of to core_pid. * elf32-s390.c (elf_s390_grok_prstatus): Write the LWPID to elf_tdata's core_lwpid instead of to core_pid. * elf32-score.c (s3_bfd_score_elf_grok_prstatus): Write the LWPID to elf_tdata's core_lwpid instead of to core_pid. * elf32-score7.c (s7_bfd_score_elf_grok_prstatus): Write the LWPID to elf_tdata's core_lwpid instead of to core_pid. * elf32-sh.c (elf32_shlin_grok_prstatus): Write the LWPID to elf_tdata's core_lwpid instead of to core_pid. * elf32-xtensa.c (elf_xtensa_grok_prstatus): Write the LWPID to elf_tdata's core_lwpid instead of to core_pid. * elf64-hppa.c (elf64_hppa_grok_prstatus): Write the LWPID to elf_tdata's core_lwpid instead of to core_pid. * elf64-mips.c (elf64_mips_grok_prstatus): Write the LWPID to elf_tdata's core_lwpid instead of to core_pid. * elf64-ppc.c (ppc64_elf_grok_prstatus): Write the LWPID to elf_tdata's core_lwpid instead of to core_pid. * elfn32-mips.c (elf32_mips_grok_prstatus): Write the LWPID to elf_tdata's core_lwpid instead of to core_pid. * plugin.c (bfd_plugin_core_file_pid): New function. * aout-target.h (MY_core_file_pid): Define. * aout-tic30.c (MY_core_file_pid, MY_core_file_p): New defines. * coff-rs6000.c (coff_core_file_pid): New define. (rs6000coff_vec, pmac_xcoff_vec): Use BFD_JUMP_TABLE_CORE. * coff64-rs6000.c (coff_core_file_pid): New define. (rs6000coff64_vec): Use BFD_JUMP_TABLE_CORE. (xcoff64_core_file_pid): New define. (aix5coff64_vec): Use BFD_JUMP_TABLE_CORE. * mach-o-target.c (bfd_mach_o_core_file_pid): New define. * aix386-core.c (aix386_core_file_pid): New define. * hppabsd-core.c (hppabsd_core_core_file_pid): New define. * hpux-core.c (hpux_core_core_file_pid): New define. * irix-core.c (irix_core_core_file_pid): New define. * lynx-core.c (lynx_core_file_pid): New define. * osf-core.c (osf_core_core_file_pid): New define. * ptrace-core.c (ptrace_unix_core_file_pid): New define. * sco5-core.c (sco5_core_file_pid): New define. * xcoff-target.h (coff_core_file_pid): New define. * netbsd-core.c (netbsd_core_core_file_pid): New define. gdb/ 2010-08-18 Pedro Alves <pedro@codesourcery.com> PR corefile/8210 gdb/ * corelow.c (add_to_thread_list): Don't use gdbarch_core_reg_section_encodes_pid. Use bfd_core_file_pid. (get_core_register_section): Don't use gdbarch_core_reg_section_encodes_pid. * gdbarch.sh (core_reg_section_encodes_pid): Delete. * gdbarch.h, gdbarch.c: Regenerate. * amd64-sol2-tdep.c (amd64_sol2_init_abi): Don't set gdbarch_core_reg_section_encodes_pid. * i386-sol2-tdep.c (i386_sol2_init_abi): Ditto. * sparc-sol2-tdep.c (sparc32_sol2_init_abi): Ditto. * sparc64-sol2-tdep.c (sparc64_sol2_init_abi): Ditto.
2010-08-18 14:24:13 +02:00
{
BFD_ASSERT (0);
return 0;
}
static int
bfd_plugin_core_file_pid (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)
Remove trailing white spaces in bfd * aout0.c: Remove trailing white spaces. * archive.c: Likewise. * archures.c: Likewise. * bfd-in.h: Likewise. * bfd-in2.h: Likewise. * coff-alpha.c: Likewise. * coff-i860.c: Likewise. * coff-mips.c: Likewise. * coff-ppc.c: Likewise. * coff-tic80.c: Likewise. * coff-x86_64.c: Likewise. * coff-z80.c: Likewise. * coffcode.h: Likewise. * coffgen.c: Likewise. * cofflink.c: Likewise. * compress.c: Likewise. * corefile.c: Likewise. * cpu-arm.c: Likewise. * cpu-avr.c: Likewise. * cpu-bfin.c: Likewise. * cpu-cr16.c: Likewise. * cpu-cr16c.c: Likewise. * cpu-crx.c: Likewise. * cpu-h8300.c: Likewise. * cpu-i386.c: Likewise. * cpu-lm32.c: Likewise. * cpu-m68k.c: Likewise. * cpu-moxie.c: Likewise. * cpu-msp430.c: Likewise. * cpu-sh.c: Likewise. * cpu-xc16x.c: Likewise. * dwarf2.c: Likewise. * ecofflink.c: Likewise. * ecoffswap.h: Likewise. * elf-ifunc.c: Likewise. * elf-m10300.c: Likewise. * elf-vxworks.c: Likewise. * elf32-avr.c: Likewise. * elf32-avr.h: Likewise. * elf32-cr16.c: Likewise. * elf32-cr16c.c: Likewise. * elf32-cris.c: Likewise. * elf32-crx.c: Likewise. * elf32-frv.c: Likewise. * elf32-hppa.c: Likewise. * elf32-i860.c: Likewise. * elf32-ip2k.c: Likewise. * elf32-iq2000.c: Likewise. * elf32-m32c.c: Likewise. * elf32-m68hc1x.c: Likewise. * elf32-msp430.c: Likewise. * elf32-mt.c: Likewise. * elf32-ppc.c: Likewise. * elf32-rl78.c: Likewise. * elf32-s390.c: Likewise. * elf32-score.h: Likewise. * elf32-sh-symbian.c: Likewise. * elf32-sh.c: Likewise. * elf32-spu.c: Likewise. * elf32-tic6x.c: Likewise. * elf32-v850.c: Likewise. * elf32-xc16x.c: Likewise. * elf32-xtensa.c: Likewise. * elf64-alpha.c: Likewise. * elf64-hppa.c: Likewise. * elf64-ppc.c: Likewise. * elf64-s390.c: Likewise. * elfcore.h: Likewise. * elflink.c: Likewise. * elfxx-mips.c: Likewise. * elfxx-sparc.c: Likewise. * elfxx-tilegx.c: Likewise. * ieee.c: Likewise. * libcoff.h: Likewise. * libpei.h: Likewise. * libxcoff.h: Likewise. * linker.c: Likewise. * mach-o-i386.c: Likewise. * mach-o-target.c: Likewise. * mach-o.c: Likewise. * mach-o.h: Likewise. * mmo.c: Likewise. * opncls.c: Likewise. * pdp11.c: Likewise. * pe-x86_64.c: Likewise. * peXXigen.c: Likewise. * pef-traceback.h: Likewise. * pei-x86_64.c: Likewise. * peicode.h: Likewise. * plugin.c: Likewise. * reloc.c: Likewise. * riscix.c: Likewise. * section.c: Likewise. * som.c: Likewise. * syms.c: Likewise. * tekhex.c: Likewise. * ticoff.h: Likewise. * vaxbsd.c: Likewise. * xcofflink.c: Likewise. * xtensa-isa.c: Likewise.
2013-01-10 21:03:55 +01:00
{
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_text_section
= BFD_FAKE_SECTION (fake_text_section, NULL, "plug", 0,
PR24511, nm should not mark symbols in .init_array as "t" This patch restricts the section names matched in coff_section_type, a function that translates section names to symbol type, and arranges to translate section flags to symbol type before looking at names. The latter change resulted in various test failures due to improper section flags being used in tests, and by the plugin support, so fix that too. The new test fails on many ELF targets that lack .init/fini_array in their scripts. I've just xfailed those. pru-elf oddly defines __init_array_begin rather than __init_array_start. I've left that target as a FAIL, and pj-elf too which reports an error for undefined weak symbols. bfd/ PR 24511 * syms.c (coff_section_type): Only allow '.', '$' and numeric following the standard section names. (bfd_decode_symclass): Prioritize section flag tests in decode_section_type before name tests in coff_section_type. * plugin.c (bfd_plugin_canonicalize_symtab): Init fake_section and fake_common_section using BFD_FAKE_SECTION. Use "fake" as their names and choose standard .text section flags for fake_section. ld/ PR 24511 * testsuite/ld-elf/pr14156a.d: Allow for .init/.fini being a data section on hppa64. * testsuite/ld-elf/pr14156b.d: Likewise. * testsuite/ld-scripts/pr18963.t: Map standard sections to set output section flags. * testsuite/ld-scripts/sane1.t: Likewise. * testsuite/ld-elf/init-fini-arrays.s: Reference __init_array_start and __fini_array_start. Define __start et al. * testsuite/ld-elf/pr24511.d: New test.
2019-05-03 14:06:46 +02:00
SEC_ALLOC | SEC_LOAD | SEC_CODE | SEC_HAS_CONTENTS);
static asection fake_data_section
= BFD_FAKE_SECTION (fake_data_section, NULL, "plug", 0,
SEC_ALLOC | SEC_LOAD | SEC_DATA | SEC_HAS_CONTENTS);
static asection fake_bss_section
= BFD_FAKE_SECTION (fake_bss_section, NULL, "plug", 0,
SEC_ALLOC);
PR24511, nm should not mark symbols in .init_array as "t" This patch restricts the section names matched in coff_section_type, a function that translates section names to symbol type, and arranges to translate section flags to symbol type before looking at names. The latter change resulted in various test failures due to improper section flags being used in tests, and by the plugin support, so fix that too. The new test fails on many ELF targets that lack .init/fini_array in their scripts. I've just xfailed those. pru-elf oddly defines __init_array_begin rather than __init_array_start. I've left that target as a FAIL, and pj-elf too which reports an error for undefined weak symbols. bfd/ PR 24511 * syms.c (coff_section_type): Only allow '.', '$' and numeric following the standard section names. (bfd_decode_symclass): Prioritize section flag tests in decode_section_type before name tests in coff_section_type. * plugin.c (bfd_plugin_canonicalize_symtab): Init fake_section and fake_common_section using BFD_FAKE_SECTION. Use "fake" as their names and choose standard .text section flags for fake_section. ld/ PR 24511 * testsuite/ld-elf/pr14156a.d: Allow for .init/.fini being a data section on hppa64. * testsuite/ld-elf/pr14156b.d: Likewise. * testsuite/ld-scripts/pr18963.t: Map standard sections to set output section flags. * testsuite/ld-scripts/sane1.t: Likewise. * testsuite/ld-elf/init-fini-arrays.s: Reference __init_array_start and __fini_array_start. Define __start et al. * testsuite/ld-elf/pr24511.d: New test.
2019-05-03 14:06:46 +02:00
static asection fake_common_section
= BFD_FAKE_SECTION (fake_common_section, NULL, "plug", 0, SEC_IS_COMMON);
int i;
for (i = 0; i < nsyms; i++)
{
Remove trailing white spaces in bfd * aout0.c: Remove trailing white spaces. * archive.c: Likewise. * archures.c: Likewise. * bfd-in.h: Likewise. * bfd-in2.h: Likewise. * coff-alpha.c: Likewise. * coff-i860.c: Likewise. * coff-mips.c: Likewise. * coff-ppc.c: Likewise. * coff-tic80.c: Likewise. * coff-x86_64.c: Likewise. * coff-z80.c: Likewise. * coffcode.h: Likewise. * coffgen.c: Likewise. * cofflink.c: Likewise. * compress.c: Likewise. * corefile.c: Likewise. * cpu-arm.c: Likewise. * cpu-avr.c: Likewise. * cpu-bfin.c: Likewise. * cpu-cr16.c: Likewise. * cpu-cr16c.c: Likewise. * cpu-crx.c: Likewise. * cpu-h8300.c: Likewise. * cpu-i386.c: Likewise. * cpu-lm32.c: Likewise. * cpu-m68k.c: Likewise. * cpu-moxie.c: Likewise. * cpu-msp430.c: Likewise. * cpu-sh.c: Likewise. * cpu-xc16x.c: Likewise. * dwarf2.c: Likewise. * ecofflink.c: Likewise. * ecoffswap.h: Likewise. * elf-ifunc.c: Likewise. * elf-m10300.c: Likewise. * elf-vxworks.c: Likewise. * elf32-avr.c: Likewise. * elf32-avr.h: Likewise. * elf32-cr16.c: Likewise. * elf32-cr16c.c: Likewise. * elf32-cris.c: Likewise. * elf32-crx.c: Likewise. * elf32-frv.c: Likewise. * elf32-hppa.c: Likewise. * elf32-i860.c: Likewise. * elf32-ip2k.c: Likewise. * elf32-iq2000.c: Likewise. * elf32-m32c.c: Likewise. * elf32-m68hc1x.c: Likewise. * elf32-msp430.c: Likewise. * elf32-mt.c: Likewise. * elf32-ppc.c: Likewise. * elf32-rl78.c: Likewise. * elf32-s390.c: Likewise. * elf32-score.h: Likewise. * elf32-sh-symbian.c: Likewise. * elf32-sh.c: Likewise. * elf32-spu.c: Likewise. * elf32-tic6x.c: Likewise. * elf32-v850.c: Likewise. * elf32-xc16x.c: Likewise. * elf32-xtensa.c: Likewise. * elf64-alpha.c: Likewise. * elf64-hppa.c: Likewise. * elf64-ppc.c: Likewise. * elf64-s390.c: Likewise. * elfcore.h: Likewise. * elflink.c: Likewise. * elfxx-mips.c: Likewise. * elfxx-sparc.c: Likewise. * elfxx-tilegx.c: Likewise. * ieee.c: Likewise. * libcoff.h: Likewise. * libpei.h: Likewise. * libxcoff.h: Likewise. * linker.c: Likewise. * mach-o-i386.c: Likewise. * mach-o-target.c: Likewise. * mach-o.c: Likewise. * mach-o.h: Likewise. * mmo.c: Likewise. * opncls.c: Likewise. * pdp11.c: Likewise. * pe-x86_64.c: Likewise. * peXXigen.c: Likewise. * pef-traceback.h: Likewise. * pei-x86_64.c: Likewise. * peicode.h: Likewise. * plugin.c: Likewise. * reloc.c: Likewise. * riscix.c: Likewise. * section.c: Likewise. * som.c: Likewise. * syms.c: Likewise. * tekhex.c: Likewise. * ticoff.h: Likewise. * vaxbsd.c: Likewise. * xcofflink.c: Likewise. * xtensa-isa.c: Likewise.
2013-01-10 21:03:55 +01:00
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:
if (current_plugin->has_symbol_type)
switch (syms[i].symbol_type)
{
case LDST_UNKNOWN:
/* What is the best fake section for LDST_UNKNOWN? */
case LDST_FUNCTION:
s->section = &fake_text_section;
break;
case LDST_VARIABLE:
if (syms[i].section_kind == LDSSK_BSS)
s->section = &fake_bss_section;
else
s->section = &fake_data_section;
break;
}
else
s->section = &fake_text_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)
{
Updated sources to avoid using the identifier name "new", which is a keyword in c++. * bfd/aoutx.h (NAME (aout, make_empty_symbol)): Rename variable new to new_symbol. * bfd/coffgen.c (coff_make_empty_symbol) (coff_bfd_make_debug_symbol): Rename variable new to new_symbol. * bfd/cpu-ia64-opc.c (ext_reg, ins_imms_scaled): Rename variable new to new_insn. * bfd/doc/chew.c (newentry, add_intrinsic): Rename variable new to new_d. * bfd/ecoff.c (_bfd_ecoff_make_empty_symbol): Rename variable new to new_symbol. * bfd/elf32-m68k.c (elf_m68k_get_got_entry_type): Rename argument new to new_reloc. * bfd/hash.c (bfd_hash_lookup): Rename variable new to new_string. * bfd/ieee.c (ieee_make_empty_symbol): Rename variable new to new_symbol. * bfd/linker.c (bfd_new_link_order): Rename variable new to new_lo. * bfd/mach-o.c (bfd_mach_o_sizeof_headers): Rename variable new to symbol. * bfd/oasys.c (oasys_make_empty_symbol): Rename variable new to new_symbol_type. * bfd/pdp11.c (NAME (aout, make_empty_symbol)): Rename variable new to new_symbol_type. * bfd/plugin.c (bfd_plugin_make_empty_symbol): Rename variable new to new_symbol. * bfd/rs6000-core.c (CoreHdr, VmInfo): Rename union member new to new_dump. (read_hdr, rs6000coff_core_p) (rs6000coff_core_file_matches_executable_p) (rs6000coff_core_file_failing_command) (rs6000coff_core_file_failing_signal): Updated function to use new union member name. * bfd/som.c (som_make_empty_symbol): Rename variable new to new_symbol_type. * bfd/syms.c (_bfd_generic_make_empty_symbol): Rename variable new to new_symbol. * bfd/tekhex.c (first_phase, tekhex_make_empty_symbol): Rename variable new to new_symbol. * binutils/nlmconv.c (main): Rename variable new to new_name. * gas/config/tc-arm.c (insert_reg_alias): Rename variable new to new_reg. * gas/config/tc-dlx.c (parse_operand): Rename variable new to new_pos. * gas/config/tc-ia64.c (ia64_gen_real_reloc_type): Rename variable new to newr. * gas/config/tc-mcore.c (parse_exp, parse_imm): Rename variable new to new_pointer. * gas/config/tc-microblaze.c (parse_exp, parse_imm, check_got): Change name from new to new_pointer. * gas/config/tc-or32.c (parse_operand): Rename variable new to new_pointer. * gas/config/tc-pdp11.c (md_assemble): Rename variable new to new_pointer. * gas/config/tc-pj.c (alias): Change argument new to new_name. * gas/config/tc-score.c (s3_build_score_ops_hsh): Rename variable new to new_opcode. (s3_build_dependency_insn_hsh) Rename variable new to new_i2n. (s3_convert): Rename variables old and new to r_old and r_new. * gas/config/tc-score7.c (s7_build_score_ops_hsh): Rename variable new to new_opcode. (s7_build_dependency_insn_hsh): Rename variable new to new_i2d. (s7_b32_relax_to_b16, s7_convert_frag): Rename variables old and new to r_old and r_new. * gas/config/tc-sh.c (parse_exp): Rename variable new to new_pointer. * gas/config/tc-sh64.c (shmedia_parse_exp): Rename variable new to new_pointer. * gas/config/tc-tic4x.c (tic4x_operand_parse): Rename variable new to new_pointer. * gas/config/tc-z8k.c (parse_exp): Rename variable new to new_pointer. * gas/listing.c (listing_newline): Rename variable new to new_i. * ld/ldexp.c (exp_intop, exp_bigintop, exp_relop, exp_binop) (exp_trinop, exp_unop, exp_nameop, exp_assop): Rename variable new to new_e. * ld/ldfile.c (ldfile_add_library_path): Rename variable new to new_dirs. (ldfile_add_arch): Rename variable new to new_arch. * ld/ldlang.c (new_statement, lang_final, lang_add_wild) (lang_target, lang_add_fill, lang_add_data, lang_add_assignment) (lang_add_insert): Rename variable new to new_stmt. (new_afile): Added missing cast. (lang_memory_region_lookup): Rename variable new to new_region. (init_os): Rename variable new to new_userdata. (lang_add_section): Rename variable new to new_section. (ldlang_add_undef): Rename variable new to new_undef. (realsymbol): Rename variable new to new_name. * opcodes/z8kgen.c (internal, gas): Rename variable new to new_op. Updated sources to avoid using the identifier name "template", which is a keyword in c++. * bfd/elf32-arm.c (struct stub_def): Rename member template to template_sequence. (arm_build_one_stub, find_stub_size_and_template, arm_size_one_stub, arm_map_one_stub): Rename variable template to template_sequence. * bfd/elfxx-ia64.c (elfNN_ia64_relax_br, elfNN_ia64_relax_brl): Rename variable template to template_val. * gas/config/tc-arm.c (struct asm_cond, struct asm_psr, struct asm_barrier_opt): Change member template to template_name. (md_begin): Update code to reflect new member names. * gas/config/tc-i386.c (struct templates, struct _i386_insn) (match_template, cpu_flags_match, match_reg_size, match_mem_size) (operand_size_match, md_begin, i386_print_statistics, pi) (build_vex_prefix, md_assemble, parse_insn, optimize_imm) (optimize_disp): Updated code to use new names. (parse_insn): Added casts. * gas/config/tc-ia64.c (dot_template, emit_one_bundle): Updated code to use new names. * gas/config/tc-score.c (struct s3_asm_opcode): Renamed member template to template_name. (s3_parse_16_32_inst, s3_parse_48_inst, s3_do_macro_ldst_label, s3_build_score_ops_hsh): Update code to use new names. * gas/config/tc-score7.c (struct s7_asm_opcode): Renamed member template to template_name. (s7_parse_16_32_inst, s7_do_macro_ldst_label, s7_build_score_ops_hsh): Update code to use new names. * gas/config/tc-tic30.c (md_begin, struct tic30_insn) (md_assemble): Update code to use new names. * gas/config/tc-tic54x.c (struct _tic54x_insn, md_begin) (optimize_insn, tic54x_parse_insn, next_line_shows_parallel): Update code to use new names. * include/opcode/tic30.h (template): Rename type template to insn_template. Updated code to use new name. * include/opcode/tic54x.h (template): Rename type template to insn_template. * opcodes/cris-dis.c (bytes_to_skip): Update code to use new name. * opcodes/i386-dis.c (putop): Update code to use new name. * opcodes/i386-gen.c (process_i386_opcodes): Update code to use new name. * opcodes/i386-opc.h (struct template): Rename struct template to insn_template. Update code accordingly. * opcodes/i386-tbl.h (i386_optab): Update type to use new name. * opcodes/ia64-dis.c (print_insn_ia64): Rename variable template to template_val. * opcodes/tic30-dis.c (struct instruction, get_tic30_instruction): Update code to use new name. * opcodes/tic54x-dis.c (has_lkaddr, get_insn_size) (print_parallel_instruction, print_insn_tic54x, tic54x_get_insn): Update code to use new name. * opcodes/tic54x-opc.c (tic54x_unknown_opcode, tic54x_optab): Update type to new name.
2009-08-30 00:11:02 +02:00
asymbol *new_symbol = bfd_zalloc (abfd, sizeof (asymbol));
if (new_symbol == NULL)
return new_symbol;
new_symbol->the_bfd = abfd;
return new_symbol;
}
static int
bfd_plugin_sizeof_headers (bfd *a ATTRIBUTE_UNUSED,
struct bfd_link_info *info 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. */
Fix BFD format matching for x86_64-w64-mingw32 -m32 LTO. In <https://sourceware.org/ml/binutils/2015-12/msg00190.html> (commit 4a07dc81356ed8728e204e9aabeb256703c59aef), Kwok fixed a problem with the template used for a dummy BFD for an IR file for LTO on MinGW, where the input and output formats are not the same. A problem, however, remains in the case of linking for x86_64-w64-mingw32 -m32, where LTO linking reports an ambiguity between the pe-i386 and pei-i386 formats. An object (pe-i386) with plugin data is being tested by the linker to see what formats match. The default format initially set by the linker when bfd_check_format_matches is called is pei-i386 (as that's the output format from the linker script), which does not match, so the function goes on to the loop over possible BFD vectors. The pe-i386 vector matches, as it should. One other vector matches: the plugin vector. bfd_check_format_matches tests a vector for matching by temporarily modifying the BFD object to use that vector then using _bfd_check_format on it. So the BFD object is temporarily using plugin_vec. _bfd_check_format ends up using bfd_plugin_object_p which uses plugin_object_p from ld which uses plugin_get_ir_dummy_bfd which succeeds, having created a BFD based on link_info.output_bfd (because srctemplate is the BFD temporarily using plugin_vec, even after Kwok's patch link_info.output_bfd is all that's available to base the dummy BFD on). So we end up with a match from the plugin vector which uses the pei-i386 vector even though the pei-i386 vector itself does not match the input object. (In the i686-mingw32 case, as opposed to this multilib case, pe-i386 is the default BFD target, which would short-circuit that logic.) There are two cases of the linker handling inputs with a plugin: they may be inputs that are also accepted by some non-plugin BFD format, as here, or they may be a format that would not be recognized at all, as with some tests in the ld testsuite. In the former case, there is no need for BFD to accept the objects using the plugin vector, as the linker has its own logic to allow plugins to claim objects accepted by some other BFD vector. Thus, this patch arranges for the plugin vector to have the lowest match priority, and for the priority from that vector to be used in the relevant case (the attempted match to the plugin vector results in TEMP pointing to the pei-i386 vector). Tested for GCC and Binutils testsuites for x86_64-pc-linux-gnu, as well as verifying that it fixes the observed LTO issue for x86_64-w64-mingw32. * plugin.c (plugin_vec): Set match priority to 255. * format.c (bfd_check_format_matches) [BFD_SUPPORTS_PLUGINS]: When matching against the plugin vector, take priority from there not from TEMP.
2016-02-16 01:27:11 +01:00
255, /* match priority. */
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. */
Remove bfd stub function casts. This patch defines a bunch of new functions to use in the BFD target structs rather than casting bfd_false or bfd_true and similar stub functions. I've also renamed the stub functions to reflect their parameters and put "error" in the name if they set bfd_error. The latter change is important since there were quite a few uses of bfd_false where setting bfd_error was inappropriate, for example in elf_backend_allow_non_load_phdr and is_target_special_symbol. * libbfd.c (_bfd_bool_bfd_false_error): Rename from bfd_false. (_bfd_bool_bfd_true): Rename from bfd_true. (_bfd_ptr_bfd_null_error): Rename from bfd_nullvoidptr. (_bfd_int_bfd_0): Rename from bfd_0. (_bfd_uint_bfd_0): Rename from bfd_0u. (_bfd_long_bfd_0): Rename from bfd_0l. (_bfd_long_bfd_n1_error): Rename from _bfd_n1. (_bfd_void_bfd): Rename from bfd_void. (_bfd_bool_bfd_false, _bfd_bool_bfd_asymbol_false), (_bfd_bool_bfd_link_false_error), (_bfd_bool_bfd_link_true, _bfd_bool_bfd_bfd_true), (_bfd_bool_bfd_uint_true, _bfd_bool_bfd_ptr_true), (_bfd_bool_bfd_asection_bfd_asection_true), (_bfd_bool_bfd_asymbol_bfd_asymbol_true), (_bfd_void_bfd_link, _bfd_void_bfd_asection): New functions. * archive.c (_bfd_noarchive_get_elt_at_index), (_bfd_noarchive_openr_next_archived_file), (_bfd_noarchive_construct_extended_name_table), (_bfd_noarchive_write_ar_hdr, _bfd_noarchive_truncate_arname), (_bfd_noarchive_write_armap): New functions. * archures.c (_bfd_nowrite_set_arch_mach): New function. * coff-alpha.c (alpha_ecoff_swap_coff_aux_in), (alpha_ecoff_swap_coff_sym_in, alpha_ecoff_swap_coff_lineno_in), (alpha_ecoff_swap_coff_aux_out, alpha_ecoff_swap_coff_sym_out), (alpha_ecoff_swap_coff_lineno_out), (alpha_ecoff_swap_coff_reloc_out): New functions. * coff-mips.c (mips_ecoff_swap_coff_aux_in), (mips_ecoff_swap_coff_sym_in, mips_ecoff_swap_coff_lineno_in), (mips_ecoff_swap_coff_aux_out, mips_ecoff_swap_coff_sym_out), (mips_ecoff_swap_coff_lineno_out), (mips_ecoff_swap_coff_reloc_out): New functions. * coffcode.h (coff_set_alignment_hook): Replace define with new function. (symname_in_debug_hook): Likewise. * ecoff.c (_bfd_ecoff_set_alignment_hook): New function. * elfxx-target.h (elf_backend_allow_non_load_phdr): Default to 0. * elf.c (assign_file_positions_except_relocs): Test elf_backend_allow_non_load_phdr for NULL. * elflink.c (_bfd_elf_omit_section_dynsym_default): Rename from _bfd_elf_link_omit_section_dynsym. Update uses. (_bfd_elf_omit_section_dynsym_all): New function. * elf-bfd.h (_bfd_elf_link_omit_section_dynsym): Delete. (_bfd_elf_omit_section_dynsym_default): Declare. (_bfd_elf_omit_section_dynsym_all): Declare. * linker.c (_bfd_nolink_sizeof_headers, _bfd_nolink_bfd_relax_section), (_bfd_nolink_bfd_get_relocated_section_contents), (_bfd_nolink_bfd_lookup_section_flags), (_bfd_nolink_bfd_is_group_section, _bfd_nolink_bfd_discard_group), (_bfd_nolink_bfd_link_hash_table_create), (_bfd_nolink_bfd_link_just_syms), (_bfd_nolink_bfd_copy_link_hash_symbol_type), (_bfd_nolink_bfd_link_split_section), (_bfd_nolink_section_already_linked), (_bfd_nolink_bfd_define_common_symbol), (_bfd_nolink_bfd_define_start_stop): New functions. * reloc.c (_bfd_norelocs_bfd_reloc_type_lookup), (_bfd_norelocs_bfd_reloc_name_lookup), (_bfd_nodynamic_canonicalize_dynamic_reloc): New functions. * section.c (_bfd_nowrite_set_section_contents): New function. * syms.c (_bfd_nosymbols_canonicalize_symtab), (_bfd_nosymbols_print_symbol, _bfd_nosymbols_get_symbol_info), (_bfd_nosymbols_get_symbol_version_string), (_bfd_nosymbols_bfd_is_local_label_name), (_bfd_nosymbols_get_lineno, _bfd_nosymbols_find_nearest_line), (_bfd_nosymbols_find_line, _bfd_nosymbols_find_inliner_info), (_bfd_nosymbols_bfd_make_debug_symbol), ( _bfd_nosymbols_read_minisymbols), ( _bfd_nosymbols_minisymbol_to_symbol), (_bfd_nodynamic_get_synthetic_symtab): New functions. * libbfd-in.h: Declare new functions. Update existing defines, removing casts. * aix386-core.c: Update to use new hooks. Formatting. * aout-adobe.c: Likewise. * aout-arm.c: Likewise. * aout-target.h: Likewise. * aout-tic30.c: Likewise. * aoutf1.h: Likewise. * binary.c: Likewise. * bout.c: Likewise. * cisco-core.c: Likewise. * coff-alpha.c: Likewise. * coff-i386.c: Likewise. * coff-i860.c: Likewise. * coff-i960.c: Likewise. * coff-ia64.c: Likewise. * coff-mips.c: Likewise. * coff-ppc.c: Likewise. * coff-rs6000.c: Likewise. * coff-sh.c: Likewise. * coff-tic30.c: Likewise. * coff-tic54x.c: Likewise. * coff-x86_64.c: Likewise. * coff64-rs6000.c: Likewise. * coffcode.h: Likewise. * elf-m10300.c: Likewise. * elf32-cr16.c: Likewise. * elf32-lm32.c: Likewise. * elf32-m32r.c: Likewise. * elf32-metag.c: Likewise. * elf32-score.c: Likewise. * elf32-score7.c: Likewise. * elf32-tilepro.c: Likewise. * elf32-xstormy16.c: Likewise. * elf32-xtensa.c: Likewise. * elf64-alpha.c: Likewise. * elf64-hppa.c: Likewise. * elf64-ia64-vms.c: Likewise. * elf64-mmix.c: Likewise. * elf64-sh64.c: Likewise. * elfnn-ia64.c: Likewise. * elfxx-sparc.c: Likewise. * elfxx-target.h: Likewise. * elfxx-tilegx.c: Likewise. * elfxx-x86.h: Likewise. * hp300hpux.c: Likewise. * hppabsd-core.c: Likewise. * hpux-core.c: Likewise. * i386msdos.c: Likewise. * i386os9k.c: Likewise. * ieee.c: Likewise. * ihex.c: Likewise. * irix-core.c: Likewise. * libaout.h: Likewise. * libecoff.h: Likewise. * mach-o-target.c: Likewise. * mach-o.c: Likewise. * mipsbsd.c: Likewise. * mmo.c: Likewise. * netbsd-core.c: Likewise. * nlm-target.h: Likewise. * oasys.c: Likewise. * osf-core.c: Likewise. * pdp11.c: Likewise. * pe-mips.c: Likewise. * pe-x86_64.c: Likewise. * pef.c: Likewise. * plugin.c: Likewise. * ppcboot.c: Likewise. * ptrace-core.c: Likewise. * sco5-core.c: Likewise. * som.c: Likewise. * sparclynx.c: Likewise. * srec.c: Likewise. * tekhex.c: Likewise. * trad-core.c: Likewise. * verilog.c: Likewise. * versados.c: Likewise. * vms-alpha.c: Likewise. * vms-lib.c: Likewise. * wasm-module.c: Likewise. * xsym.c: Likewise. * libbfd.h: Regenerate.
2018-02-15 01:28:06 +01:00
_bfd_bool_bfd_false_error,
_bfd_bool_bfd_false_error,
_bfd_generic_mkarchive,
Remove bfd stub function casts. This patch defines a bunch of new functions to use in the BFD target structs rather than casting bfd_false or bfd_true and similar stub functions. I've also renamed the stub functions to reflect their parameters and put "error" in the name if they set bfd_error. The latter change is important since there were quite a few uses of bfd_false where setting bfd_error was inappropriate, for example in elf_backend_allow_non_load_phdr and is_target_special_symbol. * libbfd.c (_bfd_bool_bfd_false_error): Rename from bfd_false. (_bfd_bool_bfd_true): Rename from bfd_true. (_bfd_ptr_bfd_null_error): Rename from bfd_nullvoidptr. (_bfd_int_bfd_0): Rename from bfd_0. (_bfd_uint_bfd_0): Rename from bfd_0u. (_bfd_long_bfd_0): Rename from bfd_0l. (_bfd_long_bfd_n1_error): Rename from _bfd_n1. (_bfd_void_bfd): Rename from bfd_void. (_bfd_bool_bfd_false, _bfd_bool_bfd_asymbol_false), (_bfd_bool_bfd_link_false_error), (_bfd_bool_bfd_link_true, _bfd_bool_bfd_bfd_true), (_bfd_bool_bfd_uint_true, _bfd_bool_bfd_ptr_true), (_bfd_bool_bfd_asection_bfd_asection_true), (_bfd_bool_bfd_asymbol_bfd_asymbol_true), (_bfd_void_bfd_link, _bfd_void_bfd_asection): New functions. * archive.c (_bfd_noarchive_get_elt_at_index), (_bfd_noarchive_openr_next_archived_file), (_bfd_noarchive_construct_extended_name_table), (_bfd_noarchive_write_ar_hdr, _bfd_noarchive_truncate_arname), (_bfd_noarchive_write_armap): New functions. * archures.c (_bfd_nowrite_set_arch_mach): New function. * coff-alpha.c (alpha_ecoff_swap_coff_aux_in), (alpha_ecoff_swap_coff_sym_in, alpha_ecoff_swap_coff_lineno_in), (alpha_ecoff_swap_coff_aux_out, alpha_ecoff_swap_coff_sym_out), (alpha_ecoff_swap_coff_lineno_out), (alpha_ecoff_swap_coff_reloc_out): New functions. * coff-mips.c (mips_ecoff_swap_coff_aux_in), (mips_ecoff_swap_coff_sym_in, mips_ecoff_swap_coff_lineno_in), (mips_ecoff_swap_coff_aux_out, mips_ecoff_swap_coff_sym_out), (mips_ecoff_swap_coff_lineno_out), (mips_ecoff_swap_coff_reloc_out): New functions. * coffcode.h (coff_set_alignment_hook): Replace define with new function. (symname_in_debug_hook): Likewise. * ecoff.c (_bfd_ecoff_set_alignment_hook): New function. * elfxx-target.h (elf_backend_allow_non_load_phdr): Default to 0. * elf.c (assign_file_positions_except_relocs): Test elf_backend_allow_non_load_phdr for NULL. * elflink.c (_bfd_elf_omit_section_dynsym_default): Rename from _bfd_elf_link_omit_section_dynsym. Update uses. (_bfd_elf_omit_section_dynsym_all): New function. * elf-bfd.h (_bfd_elf_link_omit_section_dynsym): Delete. (_bfd_elf_omit_section_dynsym_default): Declare. (_bfd_elf_omit_section_dynsym_all): Declare. * linker.c (_bfd_nolink_sizeof_headers, _bfd_nolink_bfd_relax_section), (_bfd_nolink_bfd_get_relocated_section_contents), (_bfd_nolink_bfd_lookup_section_flags), (_bfd_nolink_bfd_is_group_section, _bfd_nolink_bfd_discard_group), (_bfd_nolink_bfd_link_hash_table_create), (_bfd_nolink_bfd_link_just_syms), (_bfd_nolink_bfd_copy_link_hash_symbol_type), (_bfd_nolink_bfd_link_split_section), (_bfd_nolink_section_already_linked), (_bfd_nolink_bfd_define_common_symbol), (_bfd_nolink_bfd_define_start_stop): New functions. * reloc.c (_bfd_norelocs_bfd_reloc_type_lookup), (_bfd_norelocs_bfd_reloc_name_lookup), (_bfd_nodynamic_canonicalize_dynamic_reloc): New functions. * section.c (_bfd_nowrite_set_section_contents): New function. * syms.c (_bfd_nosymbols_canonicalize_symtab), (_bfd_nosymbols_print_symbol, _bfd_nosymbols_get_symbol_info), (_bfd_nosymbols_get_symbol_version_string), (_bfd_nosymbols_bfd_is_local_label_name), (_bfd_nosymbols_get_lineno, _bfd_nosymbols_find_nearest_line), (_bfd_nosymbols_find_line, _bfd_nosymbols_find_inliner_info), (_bfd_nosymbols_bfd_make_debug_symbol), ( _bfd_nosymbols_read_minisymbols), ( _bfd_nosymbols_minisymbol_to_symbol), (_bfd_nodynamic_get_synthetic_symtab): New functions. * libbfd-in.h: Declare new functions. Update existing defines, removing casts. * aix386-core.c: Update to use new hooks. Formatting. * aout-adobe.c: Likewise. * aout-arm.c: Likewise. * aout-target.h: Likewise. * aout-tic30.c: Likewise. * aoutf1.h: Likewise. * binary.c: Likewise. * bout.c: Likewise. * cisco-core.c: Likewise. * coff-alpha.c: Likewise. * coff-i386.c: Likewise. * coff-i860.c: Likewise. * coff-i960.c: Likewise. * coff-ia64.c: Likewise. * coff-mips.c: Likewise. * coff-ppc.c: Likewise. * coff-rs6000.c: Likewise. * coff-sh.c: Likewise. * coff-tic30.c: Likewise. * coff-tic54x.c: Likewise. * coff-x86_64.c: Likewise. * coff64-rs6000.c: Likewise. * coffcode.h: Likewise. * elf-m10300.c: Likewise. * elf32-cr16.c: Likewise. * elf32-lm32.c: Likewise. * elf32-m32r.c: Likewise. * elf32-metag.c: Likewise. * elf32-score.c: Likewise. * elf32-score7.c: Likewise. * elf32-tilepro.c: Likewise. * elf32-xstormy16.c: Likewise. * elf32-xtensa.c: Likewise. * elf64-alpha.c: Likewise. * elf64-hppa.c: Likewise. * elf64-ia64-vms.c: Likewise. * elf64-mmix.c: Likewise. * elf64-sh64.c: Likewise. * elfnn-ia64.c: Likewise. * elfxx-sparc.c: Likewise. * elfxx-target.h: Likewise. * elfxx-tilegx.c: Likewise. * elfxx-x86.h: Likewise. * hp300hpux.c: Likewise. * hppabsd-core.c: Likewise. * hpux-core.c: Likewise. * i386msdos.c: Likewise. * i386os9k.c: Likewise. * ieee.c: Likewise. * ihex.c: Likewise. * irix-core.c: Likewise. * libaout.h: Likewise. * libecoff.h: Likewise. * mach-o-target.c: Likewise. * mach-o.c: Likewise. * mipsbsd.c: Likewise. * mmo.c: Likewise. * netbsd-core.c: Likewise. * nlm-target.h: Likewise. * oasys.c: Likewise. * osf-core.c: Likewise. * pdp11.c: Likewise. * pe-mips.c: Likewise. * pe-x86_64.c: Likewise. * pef.c: Likewise. * plugin.c: Likewise. * ppcboot.c: Likewise. * ptrace-core.c: Likewise. * sco5-core.c: Likewise. * som.c: Likewise. * sparclynx.c: Likewise. * srec.c: Likewise. * tekhex.c: Likewise. * trad-core.c: Likewise. * verilog.c: Likewise. * versados.c: Likewise. * vms-alpha.c: Likewise. * vms-lib.c: Likewise. * wasm-module.c: Likewise. * xsym.c: Likewise. * libbfd.h: Regenerate.
2018-02-15 01:28:06 +01:00
_bfd_bool_bfd_false_error,
},
{ /* bfd_write_contents. */
Remove bfd stub function casts. This patch defines a bunch of new functions to use in the BFD target structs rather than casting bfd_false or bfd_true and similar stub functions. I've also renamed the stub functions to reflect their parameters and put "error" in the name if they set bfd_error. The latter change is important since there were quite a few uses of bfd_false where setting bfd_error was inappropriate, for example in elf_backend_allow_non_load_phdr and is_target_special_symbol. * libbfd.c (_bfd_bool_bfd_false_error): Rename from bfd_false. (_bfd_bool_bfd_true): Rename from bfd_true. (_bfd_ptr_bfd_null_error): Rename from bfd_nullvoidptr. (_bfd_int_bfd_0): Rename from bfd_0. (_bfd_uint_bfd_0): Rename from bfd_0u. (_bfd_long_bfd_0): Rename from bfd_0l. (_bfd_long_bfd_n1_error): Rename from _bfd_n1. (_bfd_void_bfd): Rename from bfd_void. (_bfd_bool_bfd_false, _bfd_bool_bfd_asymbol_false), (_bfd_bool_bfd_link_false_error), (_bfd_bool_bfd_link_true, _bfd_bool_bfd_bfd_true), (_bfd_bool_bfd_uint_true, _bfd_bool_bfd_ptr_true), (_bfd_bool_bfd_asection_bfd_asection_true), (_bfd_bool_bfd_asymbol_bfd_asymbol_true), (_bfd_void_bfd_link, _bfd_void_bfd_asection): New functions. * archive.c (_bfd_noarchive_get_elt_at_index), (_bfd_noarchive_openr_next_archived_file), (_bfd_noarchive_construct_extended_name_table), (_bfd_noarchive_write_ar_hdr, _bfd_noarchive_truncate_arname), (_bfd_noarchive_write_armap): New functions. * archures.c (_bfd_nowrite_set_arch_mach): New function. * coff-alpha.c (alpha_ecoff_swap_coff_aux_in), (alpha_ecoff_swap_coff_sym_in, alpha_ecoff_swap_coff_lineno_in), (alpha_ecoff_swap_coff_aux_out, alpha_ecoff_swap_coff_sym_out), (alpha_ecoff_swap_coff_lineno_out), (alpha_ecoff_swap_coff_reloc_out): New functions. * coff-mips.c (mips_ecoff_swap_coff_aux_in), (mips_ecoff_swap_coff_sym_in, mips_ecoff_swap_coff_lineno_in), (mips_ecoff_swap_coff_aux_out, mips_ecoff_swap_coff_sym_out), (mips_ecoff_swap_coff_lineno_out), (mips_ecoff_swap_coff_reloc_out): New functions. * coffcode.h (coff_set_alignment_hook): Replace define with new function. (symname_in_debug_hook): Likewise. * ecoff.c (_bfd_ecoff_set_alignment_hook): New function. * elfxx-target.h (elf_backend_allow_non_load_phdr): Default to 0. * elf.c (assign_file_positions_except_relocs): Test elf_backend_allow_non_load_phdr for NULL. * elflink.c (_bfd_elf_omit_section_dynsym_default): Rename from _bfd_elf_link_omit_section_dynsym. Update uses. (_bfd_elf_omit_section_dynsym_all): New function. * elf-bfd.h (_bfd_elf_link_omit_section_dynsym): Delete. (_bfd_elf_omit_section_dynsym_default): Declare. (_bfd_elf_omit_section_dynsym_all): Declare. * linker.c (_bfd_nolink_sizeof_headers, _bfd_nolink_bfd_relax_section), (_bfd_nolink_bfd_get_relocated_section_contents), (_bfd_nolink_bfd_lookup_section_flags), (_bfd_nolink_bfd_is_group_section, _bfd_nolink_bfd_discard_group), (_bfd_nolink_bfd_link_hash_table_create), (_bfd_nolink_bfd_link_just_syms), (_bfd_nolink_bfd_copy_link_hash_symbol_type), (_bfd_nolink_bfd_link_split_section), (_bfd_nolink_section_already_linked), (_bfd_nolink_bfd_define_common_symbol), (_bfd_nolink_bfd_define_start_stop): New functions. * reloc.c (_bfd_norelocs_bfd_reloc_type_lookup), (_bfd_norelocs_bfd_reloc_name_lookup), (_bfd_nodynamic_canonicalize_dynamic_reloc): New functions. * section.c (_bfd_nowrite_set_section_contents): New function. * syms.c (_bfd_nosymbols_canonicalize_symtab), (_bfd_nosymbols_print_symbol, _bfd_nosymbols_get_symbol_info), (_bfd_nosymbols_get_symbol_version_string), (_bfd_nosymbols_bfd_is_local_label_name), (_bfd_nosymbols_get_lineno, _bfd_nosymbols_find_nearest_line), (_bfd_nosymbols_find_line, _bfd_nosymbols_find_inliner_info), (_bfd_nosymbols_bfd_make_debug_symbol), ( _bfd_nosymbols_read_minisymbols), ( _bfd_nosymbols_minisymbol_to_symbol), (_bfd_nodynamic_get_synthetic_symtab): New functions. * libbfd-in.h: Declare new functions. Update existing defines, removing casts. * aix386-core.c: Update to use new hooks. Formatting. * aout-adobe.c: Likewise. * aout-arm.c: Likewise. * aout-target.h: Likewise. * aout-tic30.c: Likewise. * aoutf1.h: Likewise. * binary.c: Likewise. * bout.c: Likewise. * cisco-core.c: Likewise. * coff-alpha.c: Likewise. * coff-i386.c: Likewise. * coff-i860.c: Likewise. * coff-i960.c: Likewise. * coff-ia64.c: Likewise. * coff-mips.c: Likewise. * coff-ppc.c: Likewise. * coff-rs6000.c: Likewise. * coff-sh.c: Likewise. * coff-tic30.c: Likewise. * coff-tic54x.c: Likewise. * coff-x86_64.c: Likewise. * coff64-rs6000.c: Likewise. * coffcode.h: Likewise. * elf-m10300.c: Likewise. * elf32-cr16.c: Likewise. * elf32-lm32.c: Likewise. * elf32-m32r.c: Likewise. * elf32-metag.c: Likewise. * elf32-score.c: Likewise. * elf32-score7.c: Likewise. * elf32-tilepro.c: Likewise. * elf32-xstormy16.c: Likewise. * elf32-xtensa.c: Likewise. * elf64-alpha.c: Likewise. * elf64-hppa.c: Likewise. * elf64-ia64-vms.c: Likewise. * elf64-mmix.c: Likewise. * elf64-sh64.c: Likewise. * elfnn-ia64.c: Likewise. * elfxx-sparc.c: Likewise. * elfxx-target.h: Likewise. * elfxx-tilegx.c: Likewise. * elfxx-x86.h: Likewise. * hp300hpux.c: Likewise. * hppabsd-core.c: Likewise. * hpux-core.c: Likewise. * i386msdos.c: Likewise. * i386os9k.c: Likewise. * ieee.c: Likewise. * ihex.c: Likewise. * irix-core.c: Likewise. * libaout.h: Likewise. * libecoff.h: Likewise. * mach-o-target.c: Likewise. * mach-o.c: Likewise. * mipsbsd.c: Likewise. * mmo.c: Likewise. * netbsd-core.c: Likewise. * nlm-target.h: Likewise. * oasys.c: Likewise. * osf-core.c: Likewise. * pdp11.c: Likewise. * pe-mips.c: Likewise. * pe-x86_64.c: Likewise. * pef.c: Likewise. * plugin.c: Likewise. * ppcboot.c: Likewise. * ptrace-core.c: Likewise. * sco5-core.c: Likewise. * som.c: Likewise. * sparclynx.c: Likewise. * srec.c: Likewise. * tekhex.c: Likewise. * trad-core.c: Likewise. * verilog.c: Likewise. * versados.c: Likewise. * vms-alpha.c: Likewise. * vms-lib.c: Likewise. * wasm-module.c: Likewise. * xsym.c: Likewise. * libbfd.h: Regenerate.
2018-02-15 01:28:06 +01:00
_bfd_bool_bfd_false_error,
_bfd_bool_bfd_false_error,
_bfd_write_archive_contents,
Remove bfd stub function casts. This patch defines a bunch of new functions to use in the BFD target structs rather than casting bfd_false or bfd_true and similar stub functions. I've also renamed the stub functions to reflect their parameters and put "error" in the name if they set bfd_error. The latter change is important since there were quite a few uses of bfd_false where setting bfd_error was inappropriate, for example in elf_backend_allow_non_load_phdr and is_target_special_symbol. * libbfd.c (_bfd_bool_bfd_false_error): Rename from bfd_false. (_bfd_bool_bfd_true): Rename from bfd_true. (_bfd_ptr_bfd_null_error): Rename from bfd_nullvoidptr. (_bfd_int_bfd_0): Rename from bfd_0. (_bfd_uint_bfd_0): Rename from bfd_0u. (_bfd_long_bfd_0): Rename from bfd_0l. (_bfd_long_bfd_n1_error): Rename from _bfd_n1. (_bfd_void_bfd): Rename from bfd_void. (_bfd_bool_bfd_false, _bfd_bool_bfd_asymbol_false), (_bfd_bool_bfd_link_false_error), (_bfd_bool_bfd_link_true, _bfd_bool_bfd_bfd_true), (_bfd_bool_bfd_uint_true, _bfd_bool_bfd_ptr_true), (_bfd_bool_bfd_asection_bfd_asection_true), (_bfd_bool_bfd_asymbol_bfd_asymbol_true), (_bfd_void_bfd_link, _bfd_void_bfd_asection): New functions. * archive.c (_bfd_noarchive_get_elt_at_index), (_bfd_noarchive_openr_next_archived_file), (_bfd_noarchive_construct_extended_name_table), (_bfd_noarchive_write_ar_hdr, _bfd_noarchive_truncate_arname), (_bfd_noarchive_write_armap): New functions. * archures.c (_bfd_nowrite_set_arch_mach): New function. * coff-alpha.c (alpha_ecoff_swap_coff_aux_in), (alpha_ecoff_swap_coff_sym_in, alpha_ecoff_swap_coff_lineno_in), (alpha_ecoff_swap_coff_aux_out, alpha_ecoff_swap_coff_sym_out), (alpha_ecoff_swap_coff_lineno_out), (alpha_ecoff_swap_coff_reloc_out): New functions. * coff-mips.c (mips_ecoff_swap_coff_aux_in), (mips_ecoff_swap_coff_sym_in, mips_ecoff_swap_coff_lineno_in), (mips_ecoff_swap_coff_aux_out, mips_ecoff_swap_coff_sym_out), (mips_ecoff_swap_coff_lineno_out), (mips_ecoff_swap_coff_reloc_out): New functions. * coffcode.h (coff_set_alignment_hook): Replace define with new function. (symname_in_debug_hook): Likewise. * ecoff.c (_bfd_ecoff_set_alignment_hook): New function. * elfxx-target.h (elf_backend_allow_non_load_phdr): Default to 0. * elf.c (assign_file_positions_except_relocs): Test elf_backend_allow_non_load_phdr for NULL. * elflink.c (_bfd_elf_omit_section_dynsym_default): Rename from _bfd_elf_link_omit_section_dynsym. Update uses. (_bfd_elf_omit_section_dynsym_all): New function. * elf-bfd.h (_bfd_elf_link_omit_section_dynsym): Delete. (_bfd_elf_omit_section_dynsym_default): Declare. (_bfd_elf_omit_section_dynsym_all): Declare. * linker.c (_bfd_nolink_sizeof_headers, _bfd_nolink_bfd_relax_section), (_bfd_nolink_bfd_get_relocated_section_contents), (_bfd_nolink_bfd_lookup_section_flags), (_bfd_nolink_bfd_is_group_section, _bfd_nolink_bfd_discard_group), (_bfd_nolink_bfd_link_hash_table_create), (_bfd_nolink_bfd_link_just_syms), (_bfd_nolink_bfd_copy_link_hash_symbol_type), (_bfd_nolink_bfd_link_split_section), (_bfd_nolink_section_already_linked), (_bfd_nolink_bfd_define_common_symbol), (_bfd_nolink_bfd_define_start_stop): New functions. * reloc.c (_bfd_norelocs_bfd_reloc_type_lookup), (_bfd_norelocs_bfd_reloc_name_lookup), (_bfd_nodynamic_canonicalize_dynamic_reloc): New functions. * section.c (_bfd_nowrite_set_section_contents): New function. * syms.c (_bfd_nosymbols_canonicalize_symtab), (_bfd_nosymbols_print_symbol, _bfd_nosymbols_get_symbol_info), (_bfd_nosymbols_get_symbol_version_string), (_bfd_nosymbols_bfd_is_local_label_name), (_bfd_nosymbols_get_lineno, _bfd_nosymbols_find_nearest_line), (_bfd_nosymbols_find_line, _bfd_nosymbols_find_inliner_info), (_bfd_nosymbols_bfd_make_debug_symbol), ( _bfd_nosymbols_read_minisymbols), ( _bfd_nosymbols_minisymbol_to_symbol), (_bfd_nodynamic_get_synthetic_symtab): New functions. * libbfd-in.h: Declare new functions. Update existing defines, removing casts. * aix386-core.c: Update to use new hooks. Formatting. * aout-adobe.c: Likewise. * aout-arm.c: Likewise. * aout-target.h: Likewise. * aout-tic30.c: Likewise. * aoutf1.h: Likewise. * binary.c: Likewise. * bout.c: Likewise. * cisco-core.c: Likewise. * coff-alpha.c: Likewise. * coff-i386.c: Likewise. * coff-i860.c: Likewise. * coff-i960.c: Likewise. * coff-ia64.c: Likewise. * coff-mips.c: Likewise. * coff-ppc.c: Likewise. * coff-rs6000.c: Likewise. * coff-sh.c: Likewise. * coff-tic30.c: Likewise. * coff-tic54x.c: Likewise. * coff-x86_64.c: Likewise. * coff64-rs6000.c: Likewise. * coffcode.h: Likewise. * elf-m10300.c: Likewise. * elf32-cr16.c: Likewise. * elf32-lm32.c: Likewise. * elf32-m32r.c: Likewise. * elf32-metag.c: Likewise. * elf32-score.c: Likewise. * elf32-score7.c: Likewise. * elf32-tilepro.c: Likewise. * elf32-xstormy16.c: Likewise. * elf32-xtensa.c: Likewise. * elf64-alpha.c: Likewise. * elf64-hppa.c: Likewise. * elf64-ia64-vms.c: Likewise. * elf64-mmix.c: Likewise. * elf64-sh64.c: Likewise. * elfnn-ia64.c: Likewise. * elfxx-sparc.c: Likewise. * elfxx-target.h: Likewise. * elfxx-tilegx.c: Likewise. * elfxx-x86.h: Likewise. * hp300hpux.c: Likewise. * hppabsd-core.c: Likewise. * hpux-core.c: Likewise. * i386msdos.c: Likewise. * i386os9k.c: Likewise. * ieee.c: Likewise. * ihex.c: Likewise. * irix-core.c: Likewise. * libaout.h: Likewise. * libecoff.h: Likewise. * mach-o-target.c: Likewise. * mach-o.c: Likewise. * mipsbsd.c: Likewise. * mmo.c: Likewise. * netbsd-core.c: Likewise. * nlm-target.h: Likewise. * oasys.c: Likewise. * osf-core.c: Likewise. * pdp11.c: Likewise. * pe-mips.c: Likewise. * pe-x86_64.c: Likewise. * pef.c: Likewise. * plugin.c: Likewise. * ppcboot.c: Likewise. * ptrace-core.c: Likewise. * sco5-core.c: Likewise. * som.c: Likewise. * sparclynx.c: Likewise. * srec.c: Likewise. * tekhex.c: Likewise. * trad-core.c: Likewise. * verilog.c: Likewise. * versados.c: Likewise. * vms-alpha.c: Likewise. * vms-lib.c: Likewise. * wasm-module.c: Likewise. * xsym.c: Likewise. * libbfd.h: Regenerate.
2018-02-15 01:28:06 +01:00
_bfd_bool_bfd_false_error,
},
BFD_JUMP_TABLE_GENERIC (bfd_plugin),
BFD_JUMP_TABLE_COPY (bfd_plugin),
BFD_JUMP_TABLE_CORE (bfd_plugin),
Enable 64-bit archives in ar and ranlib Since existing ld and gold support the 64-bit (MIPS) ELF archives, we can use the 64-bit (MIPS) ELF archives as 64-bit archives. Since the plugin target is used to create archive in plugin-enabled ar, we need a way to enable 64-bit archives in the plugin target. This patch adds --enable-64-bit-archive to bfd to force 64-bit archives in ar and ranlib. Since both 64-bit MIPS and s390 ELF targets currently use 64-bit archives, 64-bit archives are enabled by default for them. 64-bit archive is generated automatically if the archive is too big. Tested on Linux/x86 and Linux/x86-64 with existing ld and gold. bfd/ PR binutils/14625 * archive.c (bfd_slurp_armap): Replace bfd_elf64_archive_slurp_armap with _bfd_archive_64_bit_slurp_armap. (bsd_write_armap): Call _bfd_archive_64_bit_write_armap if BFD64 is defined and the archive is too big. (coff_write_armap): Likewise. * archive64.c (bfd_elf64_archive_slurp_armap): Renamed to ... (_bfd_archive_64_bit_slurp_armap): This. (bfd_elf64_archive_write_armap): Renamed to ... (_bfd_archive_64_bit_write_armap): This. * configure.ac: Add --enable-64-bit-archive. (want_64_bit_archive): New. Set to true by default for 64-bit MIPS and s390 ELF targets. (USE_64_BIT_ARCHIVE): New AC_DEFINE. * config.in: Regenerated. * configure: Likewise. * elf64-mips.c (bfd_elf64_archive_functions): Removed. (bfd_elf64_archive_slurp_armap): Likewise. (bfd_elf64_archive_write_armap): Likewise. (bfd_elf64_archive_slurp_extended_name_table): Likewise. (bfd_elf64_archive_construct_extended_name_table): Likewise. (bfd_elf64_archive_truncate_arname): Likewise. (bfd_elf64_archive_read_ar_hdr): Likewise. (bfd_elf64_archive_write_ar_hdr): Likewise. (bfd_elf64_archive_openr_next_archived_file): Likewise. (bfd_elf64_archive_get_elt_at_index): Likewise. (bfd_elf64_archive_generic_stat_arch_elt): Likewise. (bfd_elf64_archive_update_armap_timestamp): Likewise. * elf64-s390.c (bfd_elf64_archive_functions): Removed. (bfd_elf64_archive_slurp_armap): Likewise. (bfd_elf64_archive_write_armap): Likewise. (bfd_elf64_archive_slurp_extended_name_table): Likewise. (bfd_elf64_archive_construct_extended_name_table): Likewise. (bfd_elf64_archive_truncate_arname): Likewise. (bfd_elf64_archive_read_ar_hdr): Likewise. (bfd_elf64_archive_write_ar_hdr): Likewise. (bfd_elf64_archive_openr_next_archived_file): Likewise. (bfd_elf64_archive_get_elt_at_index): Likewise. (bfd_elf64_archive_generic_stat_arch_elt): Likewise. (bfd_elf64_archive_update_armap_timestamp): Likewise. * elfxx-target.h (TARGET_BIG_SYM): Use _bfd_archive_64_bit on BFD_JUMP_TABLE_ARCHIVE if USE_64_BIT_ARCHIVE is defined and bfd_elfNN_archive_functions isn't defined. (TARGET_LITTLE_SYM): Likewise. * libbfd-in.h (_bfd_archive_64_bit_slurp_armap): New prototype. (_bfd_archive_64_bit_write_armap): Likewise. (_bfd_archive_64_bit_slurp_extended_name_table): New macro. (_bfd_archive_64_bit_construct_extended_name_table): Likewise. (_bfd_archive_64_bit_truncate_arname): Likewise. (_bfd_archive_64_bit_read_ar_hdr): Likewise. (_bfd_archive_64_bit_write_ar_hdr): Likewise. (_bfd_archive_64_bit_openr_next_archived_file): Likewise. (_bfd_archive_64_bit_get_elt_at_index): Likewise. (_bfd_archive_64_bit_generic_stat_arch_elt): Likewise. (_bfd_archive_64_bit_update_armap_timestamp): Likewise. * libbfd.h: Regenerated. * plugin.c (plugin_vec): Use _bfd_archive_64_bit on BFD_JUMP_TABLE_ARCHIVE if USE_64_BIT_ARCHIVE is defined. binutils/ PR binutils/14625 * NEWS: Mention --enable-64-bit-archive.
2016-05-25 18:46:47 +02:00
#ifdef USE_64_BIT_ARCHIVE
BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_64_bit),
#else
BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff),
Enable 64-bit archives in ar and ranlib Since existing ld and gold support the 64-bit (MIPS) ELF archives, we can use the 64-bit (MIPS) ELF archives as 64-bit archives. Since the plugin target is used to create archive in plugin-enabled ar, we need a way to enable 64-bit archives in the plugin target. This patch adds --enable-64-bit-archive to bfd to force 64-bit archives in ar and ranlib. Since both 64-bit MIPS and s390 ELF targets currently use 64-bit archives, 64-bit archives are enabled by default for them. 64-bit archive is generated automatically if the archive is too big. Tested on Linux/x86 and Linux/x86-64 with existing ld and gold. bfd/ PR binutils/14625 * archive.c (bfd_slurp_armap): Replace bfd_elf64_archive_slurp_armap with _bfd_archive_64_bit_slurp_armap. (bsd_write_armap): Call _bfd_archive_64_bit_write_armap if BFD64 is defined and the archive is too big. (coff_write_armap): Likewise. * archive64.c (bfd_elf64_archive_slurp_armap): Renamed to ... (_bfd_archive_64_bit_slurp_armap): This. (bfd_elf64_archive_write_armap): Renamed to ... (_bfd_archive_64_bit_write_armap): This. * configure.ac: Add --enable-64-bit-archive. (want_64_bit_archive): New. Set to true by default for 64-bit MIPS and s390 ELF targets. (USE_64_BIT_ARCHIVE): New AC_DEFINE. * config.in: Regenerated. * configure: Likewise. * elf64-mips.c (bfd_elf64_archive_functions): Removed. (bfd_elf64_archive_slurp_armap): Likewise. (bfd_elf64_archive_write_armap): Likewise. (bfd_elf64_archive_slurp_extended_name_table): Likewise. (bfd_elf64_archive_construct_extended_name_table): Likewise. (bfd_elf64_archive_truncate_arname): Likewise. (bfd_elf64_archive_read_ar_hdr): Likewise. (bfd_elf64_archive_write_ar_hdr): Likewise. (bfd_elf64_archive_openr_next_archived_file): Likewise. (bfd_elf64_archive_get_elt_at_index): Likewise. (bfd_elf64_archive_generic_stat_arch_elt): Likewise. (bfd_elf64_archive_update_armap_timestamp): Likewise. * elf64-s390.c (bfd_elf64_archive_functions): Removed. (bfd_elf64_archive_slurp_armap): Likewise. (bfd_elf64_archive_write_armap): Likewise. (bfd_elf64_archive_slurp_extended_name_table): Likewise. (bfd_elf64_archive_construct_extended_name_table): Likewise. (bfd_elf64_archive_truncate_arname): Likewise. (bfd_elf64_archive_read_ar_hdr): Likewise. (bfd_elf64_archive_write_ar_hdr): Likewise. (bfd_elf64_archive_openr_next_archived_file): Likewise. (bfd_elf64_archive_get_elt_at_index): Likewise. (bfd_elf64_archive_generic_stat_arch_elt): Likewise. (bfd_elf64_archive_update_armap_timestamp): Likewise. * elfxx-target.h (TARGET_BIG_SYM): Use _bfd_archive_64_bit on BFD_JUMP_TABLE_ARCHIVE if USE_64_BIT_ARCHIVE is defined and bfd_elfNN_archive_functions isn't defined. (TARGET_LITTLE_SYM): Likewise. * libbfd-in.h (_bfd_archive_64_bit_slurp_armap): New prototype. (_bfd_archive_64_bit_write_armap): Likewise. (_bfd_archive_64_bit_slurp_extended_name_table): New macro. (_bfd_archive_64_bit_construct_extended_name_table): Likewise. (_bfd_archive_64_bit_truncate_arname): Likewise. (_bfd_archive_64_bit_read_ar_hdr): Likewise. (_bfd_archive_64_bit_write_ar_hdr): Likewise. (_bfd_archive_64_bit_openr_next_archived_file): Likewise. (_bfd_archive_64_bit_get_elt_at_index): Likewise. (_bfd_archive_64_bit_generic_stat_arch_elt): Likewise. (_bfd_archive_64_bit_update_armap_timestamp): Likewise. * libbfd.h: Regenerated. * plugin.c (plugin_vec): Use _bfd_archive_64_bit on BFD_JUMP_TABLE_ARCHIVE if USE_64_BIT_ARCHIVE is defined. binutils/ PR binutils/14625 * NEWS: Mention --enable-64-bit-archive.
2016-05-25 18:46:47 +02:00
#endif
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,
BFD whitespace fixes Binutils is supposed to use tabs. In my git config I have whitespace = indent-with-non-tab,space-before-tab,trailing-space and I got annoyed enough seeing red in "git diff" output to fix the problems. * doc/header.sed: Trim trailing space when splitting lines. * aix386-core.c, * aout-adobe.c, * aout-arm.c, * aout-cris.c, * aout-ns32k.c, * aout-target.h, * aout-tic30.c, * aoutf1.h, * aoutx.h, * arc-got.h, * arc-plt.def, * arc-plt.h, * archive.c, * archive64.c, * archures.c, * armnetbsd.c, * bfd-in.h, * bfd.c, * bfdio.c, * binary.c, * bout.c, * cache.c, * cisco-core.c, * coff-alpha.c, * coff-apollo.c, * coff-arm.c, * coff-h8300.c, * coff-i386.c, * coff-i860.c, * coff-i960.c, * coff-m68k.c, * coff-m88k.c, * coff-mcore.c, * coff-mips.c, * coff-ppc.c, * coff-rs6000.c, * coff-sh.c, * coff-stgo32.c, * coff-tic4x.c, * coff-tic54x.c, * coff-tic80.c, * coff-we32k.c, * coff-x86_64.c, * coff-z80.c, * coff-z8k.c, * coff64-rs6000.c, * coffcode.h, * coffgen.c, * cofflink.c, * coffswap.h, * compress.c, * corefile.c, * cpu-alpha.c, * cpu-arm.c, * cpu-avr.c, * cpu-bfin.c, * cpu-cr16.c, * cpu-cr16c.c, * cpu-crx.c, * cpu-d10v.c, * cpu-frv.c, * cpu-ft32.c, * cpu-i370.c, * cpu-i960.c, * cpu-ia64-opc.c, * cpu-ip2k.c, * cpu-lm32.c, * cpu-m32r.c, * cpu-mcore.c, * cpu-microblaze.c, * cpu-mips.c, * cpu-moxie.c, * cpu-mt.c, * cpu-nios2.c, * cpu-ns32k.c, * cpu-or1k.c, * cpu-powerpc.c, * cpu-pru.c, * cpu-sh.c, * cpu-spu.c, * cpu-v850.c, * cpu-v850_rh850.c, * cpu-xgate.c, * cpu-z80.c, * dwarf1.c, * dwarf2.c, * ecoff.c, * ecofflink.c, * ecoffswap.h, * elf-bfd.h, * elf-eh-frame.c, * elf-hppa.h, * elf-m10200.c, * elf-m10300.c, * elf-s390-common.c, * elf-strtab.c, * elf-vxworks.c, * elf.c, * elf32-am33lin.c, * elf32-arc.c, * elf32-arm.c, * elf32-avr.c, * elf32-avr.h, * elf32-bfin.c, * elf32-cr16.c, * elf32-cr16c.c, * elf32-cris.c, * elf32-crx.c, * elf32-d10v.c, * elf32-d30v.c, * elf32-dlx.c, * elf32-epiphany.c, * elf32-fr30.c, * elf32-frv.c, * elf32-ft32.c, * elf32-h8300.c, * elf32-hppa.c, * elf32-i386.c, * elf32-i860.c, * elf32-i960.c, * elf32-ip2k.c, * elf32-lm32.c, * elf32-m32c.c, * elf32-m32r.c, * elf32-m68hc11.c, * elf32-m68hc12.c, * elf32-m68hc1x.c, * elf32-m68hc1x.h, * elf32-m68k.c, * elf32-m88k.c, * elf32-mcore.c, * elf32-mep.c, * elf32-metag.c, * elf32-microblaze.c, * elf32-mips.c, * elf32-moxie.c, * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c, * elf32-nds32.h, * elf32-nios2.c, * elf32-or1k.c, * elf32-pj.c, * elf32-ppc.c, * elf32-ppc.h, * elf32-pru.c, * elf32-rl78.c, * elf32-rx.c, * elf32-s390.c, * elf32-score.c, * elf32-score.h, * elf32-score7.c, * elf32-sh-symbian.c, * elf32-sh.c, * elf32-sh64.c, * elf32-sparc.c, * elf32-spu.c, * elf32-tic6x.c, * elf32-tilegx.c, * elf32-tilegx.h, * elf32-tilepro.c, * elf32-tilepro.h, * elf32-v850.c, * elf32-vax.c, * elf32-wasm32.c, * elf32-xc16x.c, * elf32-xgate.c, * elf32-xgate.h, * elf32-xstormy16.c, * elf32-xtensa.c, * elf64-alpha.c, * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mips.c, * elf64-mmix.c, * elf64-ppc.c, * elf64-s390.c, * elf64-sh64.c, * elf64-sparc.c, * elf64-tilegx.c, * elf64-tilegx.h, * elf64-x86-64.c, * elfcore.h, * elflink.c, * elfn32-mips.c, * elfnn-aarch64.c, * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-aarch64.c, * elfxx-aarch64.h, * elfxx-ia64.c, * elfxx-ia64.h, * elfxx-mips.c, * elfxx-riscv.c, * elfxx-sparc.c, * elfxx-tilegx.c, * elfxx-x86.c, * elfxx-x86.h, * freebsd.h, * hash.c, * host-aout.c, * hp300hpux.c, * hppabsd-core.c, * hpux-core.c, * i386aout.c, * i386linux.c, * i386lynx.c, * i386mach3.c, * i386msdos.c, * i386netbsd.c, * ieee.c, * ihex.c, * irix-core.c, * libaout.h, * libbfd-in.h, * libbfd.c, * libcoff-in.h, * libnlm.h, * libpei.h, * libxcoff.h, * linker.c, * lynx-core.c, * m68k4knetbsd.c, * m68klinux.c, * m68knetbsd.c, * m88kmach3.c, * mach-o-aarch64.c, * mach-o-arm.c, * mach-o-i386.c, * mach-o-target.c, * mach-o-x86-64.c, * mach-o.c, * mach-o.h, * merge.c, * mipsbsd.c, * mmo.c, * netbsd.h, * netbsd-core.c, * newsos3.c, * nlm-target.h, * nlm32-ppc.c, * nlm32-sparc.c, * nlmcode.h, * ns32k.h, * ns32knetbsd.c, * oasys.c, * opncls.c, * pc532-mach.c, * pdp11.c, * pe-arm.c, * pe-i386.c, * pe-mcore.c, * pe-mips.c, * pe-x86_64.c, * peXXigen.c, * pef.c, * pef.h, * pei-arm.c, * pei-i386.c, * pei-mcore.c, * pei-x86_64.c, * peicode.h, * plugin.c, * ppcboot.c, * ptrace-core.c, * reloc.c, * riscix.c, * rs6000-core.c, * section.c, * som.c, * som.h, * sparclinux.c, * sparcnetbsd.c, * srec.c, * stabs.c, * sunos.c, * syms.c, * targets.c, * tekhex.c, * trad-core.c, * vax1knetbsd.c, * vaxnetbsd.c, * verilog.c, * versados.c, * vms-alpha.c, * vms-lib.c, * vms-misc.c, * wasm-module.c, * wasm-module.h, * xcofflink.c, * xsym.c, * xsym.h: Whitespace fixes. * bfd-in2.h, * libbfd.h, * libcoff.h: Regenerate.
2017-12-05 23:56:00 +01:00
NULL /* backend_data. */
};
#endif /* BFD_SUPPORTS_PLUGIN */