2002-11-06 21:26:29 +08:00
|
|
|
/* xSYM symbol-file support for BFD.
|
2022-01-02 06:30:17 +08:00
|
|
|
Copyright (C) 1999-2022 Free Software Foundation, Inc.
|
2002-11-06 21:26:29 +08:00
|
|
|
|
|
|
|
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
|
2007-07-03 22:26:43 +08:00
|
|
|
the Free Software Foundation; either version 3 of the License, or
|
2002-11-06 21:26:29 +08:00
|
|
|
(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
|
2002-11-12 23:44:24 +08:00
|
|
|
along with this program; if not, write to the Free Software
|
2007-07-03 22:26:43 +08:00
|
|
|
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
|
|
|
|
MA 02110-1301, USA. */
|
2002-11-06 21:26:29 +08:00
|
|
|
|
2012-01-19 19:45:36 +08:00
|
|
|
/* xSYM is the debugging format used by CodeWarrior on Mac OS classic. */
|
|
|
|
|
2007-04-26 22:47:00 +08:00
|
|
|
#include "sysdep.h"
|
2002-11-06 21:26:29 +08:00
|
|
|
#include "xsym.h"
|
|
|
|
#include "bfd.h"
|
|
|
|
#include "libbfd.h"
|
|
|
|
|
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-06 06:56:00 +08:00
|
|
|
#define bfd_sym_close_and_cleanup _bfd_generic_close_and_cleanup
|
|
|
|
#define bfd_sym_bfd_free_cached_info _bfd_generic_bfd_free_cached_info
|
|
|
|
#define bfd_sym_new_section_hook _bfd_generic_new_section_hook
|
|
|
|
#define bfd_sym_bfd_is_local_label_name bfd_generic_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 08:28:06 +08:00
|
|
|
#define bfd_sym_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-06 06:56:00 +08:00
|
|
|
#define bfd_sym_get_lineno _bfd_nosymbols_get_lineno
|
|
|
|
#define bfd_sym_find_nearest_line _bfd_nosymbols_find_nearest_line
|
2022-09-03 02:16:30 +08:00
|
|
|
#define bfd_sym_find_nearest_line_with_alt _bfd_nosymbols_find_nearest_line_with_alt
|
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-06 06:56:00 +08:00
|
|
|
#define bfd_sym_find_line _bfd_nosymbols_find_line
|
|
|
|
#define bfd_sym_find_inliner_info _bfd_nosymbols_find_inliner_info
|
2014-11-26 01:28:32 +08:00
|
|
|
#define bfd_sym_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-06 06:56:00 +08:00
|
|
|
#define bfd_sym_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
|
|
|
|
#define bfd_sym_read_minisymbols _bfd_generic_read_minisymbols
|
|
|
|
#define bfd_sym_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol
|
|
|
|
#define bfd_sym_set_arch_mach _bfd_generic_set_arch_mach
|
|
|
|
#define bfd_sym_get_section_contents _bfd_generic_get_section_contents
|
|
|
|
#define bfd_sym_set_section_contents _bfd_generic_set_section_contents
|
2005-04-11 16:23:05 +08:00
|
|
|
#define bfd_sym_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-06 06:56:00 +08:00
|
|
|
#define bfd_sym_bfd_relax_section bfd_generic_relax_section
|
|
|
|
#define bfd_sym_bfd_gc_sections bfd_generic_gc_sections
|
|
|
|
#define bfd_sym_bfd_lookup_section_flags bfd_generic_lookup_section_flags
|
|
|
|
#define bfd_sym_bfd_merge_sections bfd_generic_merge_sections
|
|
|
|
#define bfd_sym_bfd_is_group_section bfd_generic_is_group_section
|
2019-09-09 13:53:27 +08:00
|
|
|
#define bfd_sym_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-06 06:56:00 +08:00
|
|
|
#define bfd_sym_bfd_discard_group bfd_generic_discard_group
|
|
|
|
#define bfd_sym_section_already_linked _bfd_generic_section_already_linked
|
|
|
|
#define bfd_sym_bfd_define_common_symbol bfd_generic_define_common_symbol
|
2018-05-22 11:39:09 +08:00
|
|
|
#define bfd_sym_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-06 06:56:00 +08:00
|
|
|
#define bfd_sym_bfd_define_start_stop bfd_generic_define_start_stop
|
|
|
|
#define bfd_sym_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
|
|
|
|
#define bfd_sym_bfd_link_add_symbols _bfd_generic_link_add_symbols
|
|
|
|
#define bfd_sym_bfd_link_just_syms _bfd_generic_link_just_syms
|
2009-11-23 22:41:33 +08:00
|
|
|
#define bfd_sym_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-06 06:56:00 +08:00
|
|
|
#define bfd_sym_bfd_final_link _bfd_generic_final_link
|
|
|
|
#define bfd_sym_bfd_link_split_section _bfd_generic_link_split_section
|
|
|
|
#define bfd_sym_get_section_contents_in_window _bfd_generic_get_section_contents_in_window
|
|
|
|
#define bfd_sym_bfd_link_check_relocs _bfd_generic_link_check_relocs
|
2002-11-06 21:26:29 +08:00
|
|
|
|
|
|
|
extern const bfd_target sym_vec;
|
|
|
|
|
|
|
|
static int
|
2005-02-20 22:59:07 +08:00
|
|
|
pstrcmp (const char *as, const char *bs)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
2005-02-20 22:59:07 +08:00
|
|
|
const unsigned char *a = (const unsigned char *) as;
|
|
|
|
const unsigned char *b = (const unsigned char *) bs;
|
2002-11-06 21:26:29 +08:00
|
|
|
unsigned char clen;
|
|
|
|
int ret;
|
|
|
|
|
2005-02-20 22:59:07 +08:00
|
|
|
clen = (a[0] > b[0]) ? b[0] : a[0];
|
2002-11-06 21:26:29 +08:00
|
|
|
ret = memcmp (a + 1, b + 1, clen);
|
|
|
|
if (ret != 0)
|
|
|
|
return ret;
|
|
|
|
|
|
|
|
if (a[0] == b[0])
|
|
|
|
return 0;
|
|
|
|
else if (a[0] < b[0])
|
|
|
|
return -1;
|
|
|
|
else
|
2005-02-20 22:59:07 +08:00
|
|
|
return 1;
|
2002-11-06 21:26:29 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static unsigned long
|
2005-04-11 16:23:05 +08:00
|
|
|
compute_offset (unsigned long first_page,
|
|
|
|
unsigned long page_size,
|
|
|
|
unsigned long entry_size,
|
2009-12-11 21:42:17 +08:00
|
|
|
unsigned long sym_index)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
|
|
|
unsigned long entries_per_page = page_size / entry_size;
|
2009-12-11 21:42:17 +08:00
|
|
|
unsigned long page_number = first_page + (sym_index / entries_per_page);
|
|
|
|
unsigned long page_offset = (sym_index % entries_per_page) * entry_size;
|
2002-11-06 21:26:29 +08:00
|
|
|
|
|
|
|
return (page_number * page_size) + page_offset;
|
|
|
|
}
|
|
|
|
|
Use bool in bfd
* sysdep.h: POISON_BFD_BOOLEAN: Define.
* aix5ppc-core.c, * aout-cris.c, * aout-ns32k.c, * aout-target.h,
* aoutx.h, * arc-got.h, * archive.c, * archive64.c, * archures.c,
* bfd-in.h, * bfd.c, * bfdwin.c, * binary.c, * cache.c,
* coff-alpha.c, * coff-arm.c, * coff-arm.h, * coff-bfd.c,
* coff-bfd.h, * coff-go32.c, * coff-i386.c, * coff-ia64.c,
* coff-mcore.c, * coff-mips.c, * coff-rs6000.c, * coff-sh.c,
* coff-stgo32.c, * coff-tic30.c, * coff-tic4x.c, * coff-tic54x.c,
* coff-x86_64.c, * coff-z80.c, * coff-z8k.c, * coff64-rs6000.c,
* coffcode.h, * coffgen.c, * cofflink.c, * compress.c,
* corefile.c, * cpu-aarch64.c, * cpu-aarch64.h, * cpu-alpha.c,
* cpu-arc.c, * cpu-arm.c, * cpu-arm.h, * cpu-avr.c, * cpu-bfin.c,
* cpu-bpf.c, * cpu-cr16.c, * cpu-cris.c, * cpu-crx.c,
* cpu-csky.c, * cpu-d10v.c, * cpu-d30v.c, * cpu-dlx.c,
* cpu-epiphany.c, * cpu-fr30.c, * cpu-frv.c, * cpu-ft32.c,
* cpu-h8300.c, * cpu-hppa.c, * cpu-i386.c, * cpu-ia64.c,
* cpu-iamcu.c, * cpu-ip2k.c, * cpu-iq2000.c, * cpu-k1om.c,
* cpu-l1om.c, * cpu-lm32.c, * cpu-m10200.c, * cpu-m10300.c,
* cpu-m32c.c, * cpu-m32r.c, * cpu-m68hc11.c, * cpu-m68hc12.c,
* cpu-m68k.c, * cpu-m9s12x.c, * cpu-m9s12xg.c, * cpu-mcore.c,
* cpu-mep.c, * cpu-metag.c, * cpu-microblaze.c, * cpu-mips.c,
* cpu-mmix.c, * cpu-moxie.c, * cpu-msp430.c, * cpu-mt.c,
* cpu-nds32.c, * cpu-nfp.c, * cpu-nios2.c, * cpu-ns32k.c,
* cpu-or1k.c, * cpu-pdp11.c, * cpu-pj.c, * cpu-powerpc.c,
* cpu-pru.c, * cpu-riscv.c, * cpu-rl78.c, * cpu-rs6000.c,
* cpu-rx.c, * cpu-s12z.c, * cpu-s390.c, * cpu-score.c,
* cpu-sh.c, * cpu-sparc.c, * cpu-spu.c, * cpu-tic30.c,
* cpu-tic4x.c, * cpu-tic54x.c, * cpu-tic6x.c, * cpu-tilegx.c,
* cpu-tilepro.c, * cpu-v850.c, * cpu-v850_rh850.c, * cpu-vax.c,
* cpu-visium.c, * cpu-wasm32.c, * cpu-xc16x.c, * cpu-xgate.c,
* cpu-xstormy16.c, * cpu-xtensa.c, * cpu-z80.c, * cpu-z8k.c,
* dwarf1.c, * dwarf2.c, * ecoff-bfd.h, * ecoff.c, * ecofflink.c,
* elf-attrs.c, * elf-bfd.h, * elf-eh-frame.c, * elf-hppa.h,
* elf-ifunc.c, * elf-m10200.c, * elf-m10300.c, * elf-nacl.c,
* elf-nacl.h, * elf-properties.c, * elf-s390-common.c,
* elf-s390.h, * elf-strtab.c, * elf-vxworks.c, * elf-vxworks.h,
* elf.c, * elf32-am33lin.c, * elf32-arc.c, * elf32-arm.c,
* elf32-arm.h, * elf32-avr.c, * elf32-avr.h, * elf32-bfin.c,
* elf32-bfin.h, * elf32-cr16.c, * elf32-cr16.h, * elf32-cris.c,
* elf32-crx.c, * elf32-csky.c, * elf32-csky.h, * elf32-d10v.c,
* elf32-d30v.c, * elf32-dlx.c, * elf32-epiphany.c,
* elf32-fr30.c, * elf32-frv.c, * elf32-ft32.c, * elf32-gen.c,
* elf32-h8300.c, * elf32-hppa.c, * elf32-hppa.h, * elf32-i386.c,
* elf32-ip2k.c, * elf32-iq2000.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-m68k.h, * elf32-mcore.c, * elf32-mep.c, * elf32-metag.c,
* elf32-metag.h, * elf32-microblaze.c, * elf32-mips.c,
* elf32-moxie.c, * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c,
* elf32-nios2.c, * elf32-nios2.h, * elf32-or1k.c, * elf32-pj.c,
* elf32-ppc.c, * elf32-ppc.h, * elf32-pru.c, * elf32-rl78.c,
* elf32-rx.c, * elf32-s12z.c, * elf32-s390.c, * elf32-score.c,
* elf32-score.h, * elf32-score7.c, * elf32-sh-relocs.h,
* elf32-sh.c, * elf32-sparc.c, * elf32-spu.c, * elf32-spu.h,
* elf32-tic6x.c, * elf32-tic6x.h, * elf32-tilegx.c,
* elf32-tilepro.c, * elf32-v850.c, * elf32-v850.h,
* elf32-vax.c, * elf32-visium.c, * elf32-wasm32.c,
* elf32-xc16x.c, * elf32-xgate.c, * elf32-xstormy16.c,
* elf32-xtensa.c, * elf32-z80.c, * elf64-alpha.c, * elf64-bpf.c,
* elf64-gen.c, * elf64-hppa.c, * elf64-ia64-vms.c,
* elf64-mips.c, * elf64-mmix.c, * elf64-nfp.c, * elf64-ppc.c,
* elf64-ppc.h, * elf64-s390.c, * elf64-sparc.c,
* elf64-tilegx.c, * elf64-x86-64.c, * elfcode.h,
* 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-mips.h, * elfxx-riscv.c, * elfxx-riscv.h,
* elfxx-sparc.c, * elfxx-sparc.h, * elfxx-target.h,
* elfxx-tilegx.c, * elfxx-tilegx.h, * elfxx-x86.c, * elfxx-x86.h,
* format.c, * genlink.h, * hash.c, * i386aout.c, * i386lynx.c,
* i386msdos.c, * ihex.c, * libaout.h, * libbfd-in.h,
* libbfd.c, * libcoff-in.h, * libecoff.h, * libpei.h,
* libxcoff.h, * linker.c, * mach-o-aarch64.c, * mach-o-arm.c,
* mach-o-i386.c, * mach-o-x86-64.c, * mach-o.c, * mach-o.h,
* merge.c, * mmo.c, * netbsd.h, * opncls.c, * pc532-mach.c,
* pdp11.c, * pe-arm.c, * pe-i386.c, * pe-mcore.c, * pe-sh.c,
* pe-x86_64.c, * peXXigen.c, * pef.c, * pei-arm.c, * pei-i386.c,
* pei-ia64.c, * pei-mcore.c, * pei-sh.c, * pei-x86_64.c,
* peicode.h, * plugin.c, * plugin.h, * ppcboot.c, * reloc.c,
* reloc16.c, * rs6000-core.c, * section.c, * simple.c, * som.c,
* som.h, * srec.c, * stabs.c, * syms.c, * targets.c, * tekhex.c,
* verilog.c, * vms-alpha.c, * vms-lib.c, * vms-misc.c, * vms.h,
* wasm-module.c, * xcofflink.c, * xcofflink.h, * xsym.c,
* xsym.h: Replace bfd_boolean with bool, FALSE with false, and
TRUE with true throughout.
* bfd-in2.h: Regenerate.
* libbfd.h: Regenerate.
* libcoff.h: Regenerate.
2021-03-31 08:00:54 +08:00
|
|
|
bool
|
2005-04-11 16:23:05 +08:00
|
|
|
bfd_sym_mkobject (bfd *abfd ATTRIBUTE_UNUSED)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
2002-11-30 16:39:46 +08:00
|
|
|
return 1;
|
2002-11-06 21:26:29 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2005-04-11 16:23:05 +08:00
|
|
|
bfd_sym_print_symbol (bfd *abfd ATTRIBUTE_UNUSED,
|
|
|
|
void * afile ATTRIBUTE_UNUSED,
|
|
|
|
asymbol *symbol ATTRIBUTE_UNUSED,
|
|
|
|
bfd_print_symbol_type how ATTRIBUTE_UNUSED)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
Use bool in bfd
* sysdep.h: POISON_BFD_BOOLEAN: Define.
* aix5ppc-core.c, * aout-cris.c, * aout-ns32k.c, * aout-target.h,
* aoutx.h, * arc-got.h, * archive.c, * archive64.c, * archures.c,
* bfd-in.h, * bfd.c, * bfdwin.c, * binary.c, * cache.c,
* coff-alpha.c, * coff-arm.c, * coff-arm.h, * coff-bfd.c,
* coff-bfd.h, * coff-go32.c, * coff-i386.c, * coff-ia64.c,
* coff-mcore.c, * coff-mips.c, * coff-rs6000.c, * coff-sh.c,
* coff-stgo32.c, * coff-tic30.c, * coff-tic4x.c, * coff-tic54x.c,
* coff-x86_64.c, * coff-z80.c, * coff-z8k.c, * coff64-rs6000.c,
* coffcode.h, * coffgen.c, * cofflink.c, * compress.c,
* corefile.c, * cpu-aarch64.c, * cpu-aarch64.h, * cpu-alpha.c,
* cpu-arc.c, * cpu-arm.c, * cpu-arm.h, * cpu-avr.c, * cpu-bfin.c,
* cpu-bpf.c, * cpu-cr16.c, * cpu-cris.c, * cpu-crx.c,
* cpu-csky.c, * cpu-d10v.c, * cpu-d30v.c, * cpu-dlx.c,
* cpu-epiphany.c, * cpu-fr30.c, * cpu-frv.c, * cpu-ft32.c,
* cpu-h8300.c, * cpu-hppa.c, * cpu-i386.c, * cpu-ia64.c,
* cpu-iamcu.c, * cpu-ip2k.c, * cpu-iq2000.c, * cpu-k1om.c,
* cpu-l1om.c, * cpu-lm32.c, * cpu-m10200.c, * cpu-m10300.c,
* cpu-m32c.c, * cpu-m32r.c, * cpu-m68hc11.c, * cpu-m68hc12.c,
* cpu-m68k.c, * cpu-m9s12x.c, * cpu-m9s12xg.c, * cpu-mcore.c,
* cpu-mep.c, * cpu-metag.c, * cpu-microblaze.c, * cpu-mips.c,
* cpu-mmix.c, * cpu-moxie.c, * cpu-msp430.c, * cpu-mt.c,
* cpu-nds32.c, * cpu-nfp.c, * cpu-nios2.c, * cpu-ns32k.c,
* cpu-or1k.c, * cpu-pdp11.c, * cpu-pj.c, * cpu-powerpc.c,
* cpu-pru.c, * cpu-riscv.c, * cpu-rl78.c, * cpu-rs6000.c,
* cpu-rx.c, * cpu-s12z.c, * cpu-s390.c, * cpu-score.c,
* cpu-sh.c, * cpu-sparc.c, * cpu-spu.c, * cpu-tic30.c,
* cpu-tic4x.c, * cpu-tic54x.c, * cpu-tic6x.c, * cpu-tilegx.c,
* cpu-tilepro.c, * cpu-v850.c, * cpu-v850_rh850.c, * cpu-vax.c,
* cpu-visium.c, * cpu-wasm32.c, * cpu-xc16x.c, * cpu-xgate.c,
* cpu-xstormy16.c, * cpu-xtensa.c, * cpu-z80.c, * cpu-z8k.c,
* dwarf1.c, * dwarf2.c, * ecoff-bfd.h, * ecoff.c, * ecofflink.c,
* elf-attrs.c, * elf-bfd.h, * elf-eh-frame.c, * elf-hppa.h,
* elf-ifunc.c, * elf-m10200.c, * elf-m10300.c, * elf-nacl.c,
* elf-nacl.h, * elf-properties.c, * elf-s390-common.c,
* elf-s390.h, * elf-strtab.c, * elf-vxworks.c, * elf-vxworks.h,
* elf.c, * elf32-am33lin.c, * elf32-arc.c, * elf32-arm.c,
* elf32-arm.h, * elf32-avr.c, * elf32-avr.h, * elf32-bfin.c,
* elf32-bfin.h, * elf32-cr16.c, * elf32-cr16.h, * elf32-cris.c,
* elf32-crx.c, * elf32-csky.c, * elf32-csky.h, * elf32-d10v.c,
* elf32-d30v.c, * elf32-dlx.c, * elf32-epiphany.c,
* elf32-fr30.c, * elf32-frv.c, * elf32-ft32.c, * elf32-gen.c,
* elf32-h8300.c, * elf32-hppa.c, * elf32-hppa.h, * elf32-i386.c,
* elf32-ip2k.c, * elf32-iq2000.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-m68k.h, * elf32-mcore.c, * elf32-mep.c, * elf32-metag.c,
* elf32-metag.h, * elf32-microblaze.c, * elf32-mips.c,
* elf32-moxie.c, * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c,
* elf32-nios2.c, * elf32-nios2.h, * elf32-or1k.c, * elf32-pj.c,
* elf32-ppc.c, * elf32-ppc.h, * elf32-pru.c, * elf32-rl78.c,
* elf32-rx.c, * elf32-s12z.c, * elf32-s390.c, * elf32-score.c,
* elf32-score.h, * elf32-score7.c, * elf32-sh-relocs.h,
* elf32-sh.c, * elf32-sparc.c, * elf32-spu.c, * elf32-spu.h,
* elf32-tic6x.c, * elf32-tic6x.h, * elf32-tilegx.c,
* elf32-tilepro.c, * elf32-v850.c, * elf32-v850.h,
* elf32-vax.c, * elf32-visium.c, * elf32-wasm32.c,
* elf32-xc16x.c, * elf32-xgate.c, * elf32-xstormy16.c,
* elf32-xtensa.c, * elf32-z80.c, * elf64-alpha.c, * elf64-bpf.c,
* elf64-gen.c, * elf64-hppa.c, * elf64-ia64-vms.c,
* elf64-mips.c, * elf64-mmix.c, * elf64-nfp.c, * elf64-ppc.c,
* elf64-ppc.h, * elf64-s390.c, * elf64-sparc.c,
* elf64-tilegx.c, * elf64-x86-64.c, * elfcode.h,
* 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-mips.h, * elfxx-riscv.c, * elfxx-riscv.h,
* elfxx-sparc.c, * elfxx-sparc.h, * elfxx-target.h,
* elfxx-tilegx.c, * elfxx-tilegx.h, * elfxx-x86.c, * elfxx-x86.h,
* format.c, * genlink.h, * hash.c, * i386aout.c, * i386lynx.c,
* i386msdos.c, * ihex.c, * libaout.h, * libbfd-in.h,
* libbfd.c, * libcoff-in.h, * libecoff.h, * libpei.h,
* libxcoff.h, * linker.c, * mach-o-aarch64.c, * mach-o-arm.c,
* mach-o-i386.c, * mach-o-x86-64.c, * mach-o.c, * mach-o.h,
* merge.c, * mmo.c, * netbsd.h, * opncls.c, * pc532-mach.c,
* pdp11.c, * pe-arm.c, * pe-i386.c, * pe-mcore.c, * pe-sh.c,
* pe-x86_64.c, * peXXigen.c, * pef.c, * pei-arm.c, * pei-i386.c,
* pei-ia64.c, * pei-mcore.c, * pei-sh.c, * pei-x86_64.c,
* peicode.h, * plugin.c, * plugin.h, * ppcboot.c, * reloc.c,
* reloc16.c, * rs6000-core.c, * section.c, * simple.c, * som.c,
* som.h, * srec.c, * stabs.c, * syms.c, * targets.c, * tekhex.c,
* verilog.c, * vms-alpha.c, * vms-lib.c, * vms-misc.c, * vms.h,
* wasm-module.c, * xcofflink.c, * xcofflink.h, * xsym.c,
* xsym.h: Replace bfd_boolean with bool, FALSE with false, and
TRUE with true throughout.
* bfd-in2.h: Regenerate.
* libbfd.h: Regenerate.
* libcoff.h: Regenerate.
2021-03-31 08:00:54 +08:00
|
|
|
bool
|
2005-04-11 16:23:05 +08:00
|
|
|
bfd_sym_valid (bfd *abfd)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
|
|
|
if (abfd == NULL || abfd->xvec == NULL)
|
|
|
|
return 0;
|
|
|
|
|
2002-11-12 23:44:24 +08:00
|
|
|
return abfd->xvec == &sym_vec;
|
2002-11-06 21:26:29 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
unsigned char *
|
2005-04-11 16:23:05 +08:00
|
|
|
bfd_sym_read_name_table (bfd *abfd, bfd_sym_header_block *dshb)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
|
|
|
size_t table_size = dshb->dshb_nte.dti_page_count * dshb->dshb_page_size;
|
|
|
|
size_t table_offset = dshb->dshb_nte.dti_first_page * dshb->dshb_page_size;
|
2002-11-12 23:44:24 +08:00
|
|
|
|
_bfd_alloc_and_read
This patch provides two new inline functions that are then used in
places that allocate memory, read from file, and then deallocate on a
read failure.
* libbfd-in.h (_bfd_alloc_and_read, _bfd_malloc_and_read): New.
* aoutx.h (aout_get_external_symbols): Replace calls to
bfd_[m]alloc and bfd_bread with call to _bfd_[m]alloc_and_read.
(slurp_reloc_table): Likewise.
* archive.c (do_slurp_bsd_armap): Likewise.
(do_slurp_coff_armap): Likewise.
* archive64.c (_bfd_archive_64_bit_slurp_armap): Likewise.
* coff-rs6000.c (_bfd_xcoff_slurp_armap): Likewise.
* coff64-rs6000.c (xcoff64_slurp_armap): Likewise.
* coffcode.h (coff_set_arch_mach_hook, buy_and_read): Likewise.
* coffgen.c (coff_real_object_p, coff_object_p, build_debug_section),
(_bfd_coff_get_external_symbols): Likewise.
* ecoff.c (ecoff_slurp_symbolic_header),
(_bfd_ecoff_slurp_symbolic_info, ecoff_slurp_reloc_table),
(_bfd_ecoff_slurp_armap, ecoff_link_add_object_symbols, READ),
(ecoff_indirect_link_order): Likewise.
* elf.c (bfd_elf_get_str_section, setup_group, elf_read_notes),
(_bfd_elf_slurp_version_tables): Likewise.
* elf32-m32c.c (m32c_elf_relax_section): Likewise.
* elf32-rl78.c (rl78_elf_relax_section): Likewise.
* elf32-rx.c (elf32_rx_relax_section): Likewise.
* elf64-alpha.c (READ): Likewise.
* elf64-mips.c (mips_elf64_slurp_one_reloc_table): Likewise.
* elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Likewise.
* elfcode.h (elf_slurp_symbol_table),
(elf_slurp_reloc_table_from_section): Likewise.
* elflink.c (elf_link_add_object_symbols),
(elf_link_check_versioned_symbol): Likewise.
* elfxx-mips.c (READ): Likewise.
* i386lynx.c (slurp_reloc_table): Likewise.
* lynx-core.c (lynx_core_file_p): Likewise.
* mach-o.c (bfd_mach_o_canonicalize_relocs),
(bfd_mach_o_read_symtab_strtab, bfd_mach_o_alloc_and_read),
(bfd_mach_o_read_prebound_dylib, bfd_mach_o_read_dyld_content
* pdp11.c (aout_get_external_symbols, slurp_reloc_table
* pef.c (bfd_pef_print_loader_section, bfd_pef_scan_start_address),
(bfd_pef_parse_symbols): Likewise.
* peicode.h (pe_ILF_object_p, pe_bfd_object_p
* som.c (setup_sections, som_slurp_string_table),
(som_slurp_reloc_table, som_bfd_count_ar_symbols),
(som_bfd_fill_in_ar_symbols): Likewise.
* vms-alpha.c (module_find_nearest_line, evax_bfd_print_dst),
(evax_bfd_print_image): Likewise.
* vms-lib.c (_bfd_vms_lib_archive_p): Likewise.
* wasm-module.c (wasm_scan): Likewise.
* xcofflink.c (xcoff_link_add_symbols): Likewise.
* xsym.c (bfd_sym_read_name_table),
(bfd_sym_print_type_information_table_entry): Likewise.
* libbfd.h: Regenerate.
2020-02-19 10:46:01 +08:00
|
|
|
if (bfd_seek (abfd, table_offset, SEEK_SET) != 0)
|
Use bool in bfd
* sysdep.h: POISON_BFD_BOOLEAN: Define.
* aix5ppc-core.c, * aout-cris.c, * aout-ns32k.c, * aout-target.h,
* aoutx.h, * arc-got.h, * archive.c, * archive64.c, * archures.c,
* bfd-in.h, * bfd.c, * bfdwin.c, * binary.c, * cache.c,
* coff-alpha.c, * coff-arm.c, * coff-arm.h, * coff-bfd.c,
* coff-bfd.h, * coff-go32.c, * coff-i386.c, * coff-ia64.c,
* coff-mcore.c, * coff-mips.c, * coff-rs6000.c, * coff-sh.c,
* coff-stgo32.c, * coff-tic30.c, * coff-tic4x.c, * coff-tic54x.c,
* coff-x86_64.c, * coff-z80.c, * coff-z8k.c, * coff64-rs6000.c,
* coffcode.h, * coffgen.c, * cofflink.c, * compress.c,
* corefile.c, * cpu-aarch64.c, * cpu-aarch64.h, * cpu-alpha.c,
* cpu-arc.c, * cpu-arm.c, * cpu-arm.h, * cpu-avr.c, * cpu-bfin.c,
* cpu-bpf.c, * cpu-cr16.c, * cpu-cris.c, * cpu-crx.c,
* cpu-csky.c, * cpu-d10v.c, * cpu-d30v.c, * cpu-dlx.c,
* cpu-epiphany.c, * cpu-fr30.c, * cpu-frv.c, * cpu-ft32.c,
* cpu-h8300.c, * cpu-hppa.c, * cpu-i386.c, * cpu-ia64.c,
* cpu-iamcu.c, * cpu-ip2k.c, * cpu-iq2000.c, * cpu-k1om.c,
* cpu-l1om.c, * cpu-lm32.c, * cpu-m10200.c, * cpu-m10300.c,
* cpu-m32c.c, * cpu-m32r.c, * cpu-m68hc11.c, * cpu-m68hc12.c,
* cpu-m68k.c, * cpu-m9s12x.c, * cpu-m9s12xg.c, * cpu-mcore.c,
* cpu-mep.c, * cpu-metag.c, * cpu-microblaze.c, * cpu-mips.c,
* cpu-mmix.c, * cpu-moxie.c, * cpu-msp430.c, * cpu-mt.c,
* cpu-nds32.c, * cpu-nfp.c, * cpu-nios2.c, * cpu-ns32k.c,
* cpu-or1k.c, * cpu-pdp11.c, * cpu-pj.c, * cpu-powerpc.c,
* cpu-pru.c, * cpu-riscv.c, * cpu-rl78.c, * cpu-rs6000.c,
* cpu-rx.c, * cpu-s12z.c, * cpu-s390.c, * cpu-score.c,
* cpu-sh.c, * cpu-sparc.c, * cpu-spu.c, * cpu-tic30.c,
* cpu-tic4x.c, * cpu-tic54x.c, * cpu-tic6x.c, * cpu-tilegx.c,
* cpu-tilepro.c, * cpu-v850.c, * cpu-v850_rh850.c, * cpu-vax.c,
* cpu-visium.c, * cpu-wasm32.c, * cpu-xc16x.c, * cpu-xgate.c,
* cpu-xstormy16.c, * cpu-xtensa.c, * cpu-z80.c, * cpu-z8k.c,
* dwarf1.c, * dwarf2.c, * ecoff-bfd.h, * ecoff.c, * ecofflink.c,
* elf-attrs.c, * elf-bfd.h, * elf-eh-frame.c, * elf-hppa.h,
* elf-ifunc.c, * elf-m10200.c, * elf-m10300.c, * elf-nacl.c,
* elf-nacl.h, * elf-properties.c, * elf-s390-common.c,
* elf-s390.h, * elf-strtab.c, * elf-vxworks.c, * elf-vxworks.h,
* elf.c, * elf32-am33lin.c, * elf32-arc.c, * elf32-arm.c,
* elf32-arm.h, * elf32-avr.c, * elf32-avr.h, * elf32-bfin.c,
* elf32-bfin.h, * elf32-cr16.c, * elf32-cr16.h, * elf32-cris.c,
* elf32-crx.c, * elf32-csky.c, * elf32-csky.h, * elf32-d10v.c,
* elf32-d30v.c, * elf32-dlx.c, * elf32-epiphany.c,
* elf32-fr30.c, * elf32-frv.c, * elf32-ft32.c, * elf32-gen.c,
* elf32-h8300.c, * elf32-hppa.c, * elf32-hppa.h, * elf32-i386.c,
* elf32-ip2k.c, * elf32-iq2000.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-m68k.h, * elf32-mcore.c, * elf32-mep.c, * elf32-metag.c,
* elf32-metag.h, * elf32-microblaze.c, * elf32-mips.c,
* elf32-moxie.c, * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c,
* elf32-nios2.c, * elf32-nios2.h, * elf32-or1k.c, * elf32-pj.c,
* elf32-ppc.c, * elf32-ppc.h, * elf32-pru.c, * elf32-rl78.c,
* elf32-rx.c, * elf32-s12z.c, * elf32-s390.c, * elf32-score.c,
* elf32-score.h, * elf32-score7.c, * elf32-sh-relocs.h,
* elf32-sh.c, * elf32-sparc.c, * elf32-spu.c, * elf32-spu.h,
* elf32-tic6x.c, * elf32-tic6x.h, * elf32-tilegx.c,
* elf32-tilepro.c, * elf32-v850.c, * elf32-v850.h,
* elf32-vax.c, * elf32-visium.c, * elf32-wasm32.c,
* elf32-xc16x.c, * elf32-xgate.c, * elf32-xstormy16.c,
* elf32-xtensa.c, * elf32-z80.c, * elf64-alpha.c, * elf64-bpf.c,
* elf64-gen.c, * elf64-hppa.c, * elf64-ia64-vms.c,
* elf64-mips.c, * elf64-mmix.c, * elf64-nfp.c, * elf64-ppc.c,
* elf64-ppc.h, * elf64-s390.c, * elf64-sparc.c,
* elf64-tilegx.c, * elf64-x86-64.c, * elfcode.h,
* 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-mips.h, * elfxx-riscv.c, * elfxx-riscv.h,
* elfxx-sparc.c, * elfxx-sparc.h, * elfxx-target.h,
* elfxx-tilegx.c, * elfxx-tilegx.h, * elfxx-x86.c, * elfxx-x86.h,
* format.c, * genlink.h, * hash.c, * i386aout.c, * i386lynx.c,
* i386msdos.c, * ihex.c, * libaout.h, * libbfd-in.h,
* libbfd.c, * libcoff-in.h, * libecoff.h, * libpei.h,
* libxcoff.h, * linker.c, * mach-o-aarch64.c, * mach-o-arm.c,
* mach-o-i386.c, * mach-o-x86-64.c, * mach-o.c, * mach-o.h,
* merge.c, * mmo.c, * netbsd.h, * opncls.c, * pc532-mach.c,
* pdp11.c, * pe-arm.c, * pe-i386.c, * pe-mcore.c, * pe-sh.c,
* pe-x86_64.c, * peXXigen.c, * pef.c, * pei-arm.c, * pei-i386.c,
* pei-ia64.c, * pei-mcore.c, * pei-sh.c, * pei-x86_64.c,
* peicode.h, * plugin.c, * plugin.h, * ppcboot.c, * reloc.c,
* reloc16.c, * rs6000-core.c, * section.c, * simple.c, * som.c,
* som.h, * srec.c, * stabs.c, * syms.c, * targets.c, * tekhex.c,
* verilog.c, * vms-alpha.c, * vms-lib.c, * vms-misc.c, * vms.h,
* wasm-module.c, * xcofflink.c, * xcofflink.h, * xsym.c,
* xsym.h: Replace bfd_boolean with bool, FALSE with false, and
TRUE with true throughout.
* bfd-in2.h: Regenerate.
* libbfd.h: Regenerate.
* libcoff.h: Regenerate.
2021-03-31 08:00:54 +08:00
|
|
|
return false;
|
_bfd_alloc_and_read
This patch provides two new inline functions that are then used in
places that allocate memory, read from file, and then deallocate on a
read failure.
* libbfd-in.h (_bfd_alloc_and_read, _bfd_malloc_and_read): New.
* aoutx.h (aout_get_external_symbols): Replace calls to
bfd_[m]alloc and bfd_bread with call to _bfd_[m]alloc_and_read.
(slurp_reloc_table): Likewise.
* archive.c (do_slurp_bsd_armap): Likewise.
(do_slurp_coff_armap): Likewise.
* archive64.c (_bfd_archive_64_bit_slurp_armap): Likewise.
* coff-rs6000.c (_bfd_xcoff_slurp_armap): Likewise.
* coff64-rs6000.c (xcoff64_slurp_armap): Likewise.
* coffcode.h (coff_set_arch_mach_hook, buy_and_read): Likewise.
* coffgen.c (coff_real_object_p, coff_object_p, build_debug_section),
(_bfd_coff_get_external_symbols): Likewise.
* ecoff.c (ecoff_slurp_symbolic_header),
(_bfd_ecoff_slurp_symbolic_info, ecoff_slurp_reloc_table),
(_bfd_ecoff_slurp_armap, ecoff_link_add_object_symbols, READ),
(ecoff_indirect_link_order): Likewise.
* elf.c (bfd_elf_get_str_section, setup_group, elf_read_notes),
(_bfd_elf_slurp_version_tables): Likewise.
* elf32-m32c.c (m32c_elf_relax_section): Likewise.
* elf32-rl78.c (rl78_elf_relax_section): Likewise.
* elf32-rx.c (elf32_rx_relax_section): Likewise.
* elf64-alpha.c (READ): Likewise.
* elf64-mips.c (mips_elf64_slurp_one_reloc_table): Likewise.
* elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Likewise.
* elfcode.h (elf_slurp_symbol_table),
(elf_slurp_reloc_table_from_section): Likewise.
* elflink.c (elf_link_add_object_symbols),
(elf_link_check_versioned_symbol): Likewise.
* elfxx-mips.c (READ): Likewise.
* i386lynx.c (slurp_reloc_table): Likewise.
* lynx-core.c (lynx_core_file_p): Likewise.
* mach-o.c (bfd_mach_o_canonicalize_relocs),
(bfd_mach_o_read_symtab_strtab, bfd_mach_o_alloc_and_read),
(bfd_mach_o_read_prebound_dylib, bfd_mach_o_read_dyld_content
* pdp11.c (aout_get_external_symbols, slurp_reloc_table
* pef.c (bfd_pef_print_loader_section, bfd_pef_scan_start_address),
(bfd_pef_parse_symbols): Likewise.
* peicode.h (pe_ILF_object_p, pe_bfd_object_p
* som.c (setup_sections, som_slurp_string_table),
(som_slurp_reloc_table, som_bfd_count_ar_symbols),
(som_bfd_fill_in_ar_symbols): Likewise.
* vms-alpha.c (module_find_nearest_line, evax_bfd_print_dst),
(evax_bfd_print_image): Likewise.
* vms-lib.c (_bfd_vms_lib_archive_p): Likewise.
* wasm-module.c (wasm_scan): Likewise.
* xcofflink.c (xcoff_link_add_symbols): Likewise.
* xsym.c (bfd_sym_read_name_table),
(bfd_sym_print_type_information_table_entry): Likewise.
* libbfd.h: Regenerate.
2020-02-19 10:46:01 +08:00
|
|
|
return _bfd_alloc_and_read (abfd, table_size, table_size);
|
2002-11-06 21:26:29 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2005-04-11 16:23:05 +08:00
|
|
|
bfd_sym_parse_file_reference_v32 (unsigned char *buf,
|
|
|
|
size_t len,
|
|
|
|
bfd_sym_file_reference *entry)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
|
|
|
BFD_ASSERT (len == 6);
|
|
|
|
|
|
|
|
entry->fref_frte_index = bfd_getb16 (buf);
|
|
|
|
entry->fref_offset = bfd_getb32 (buf + 2);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2005-04-11 16:23:05 +08:00
|
|
|
bfd_sym_parse_disk_table_v32 (unsigned char *buf,
|
|
|
|
size_t len,
|
|
|
|
bfd_sym_table_info *table)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
|
|
|
BFD_ASSERT (len == 8);
|
2002-11-12 23:44:24 +08:00
|
|
|
|
2002-11-06 21:26:29 +08:00
|
|
|
table->dti_first_page = bfd_getb16 (buf);
|
|
|
|
table->dti_page_count = bfd_getb16 (buf + 2);
|
|
|
|
table->dti_object_count = bfd_getb32 (buf + 4);
|
2002-11-12 23:44:24 +08:00
|
|
|
}
|
2002-11-06 21:26:29 +08:00
|
|
|
|
|
|
|
void
|
2005-04-11 16:23:05 +08:00
|
|
|
bfd_sym_parse_header_v32 (unsigned char *buf,
|
|
|
|
size_t len,
|
|
|
|
bfd_sym_header_block *header)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
|
|
|
BFD_ASSERT (len == 154);
|
2002-11-12 23:44:24 +08:00
|
|
|
|
2002-11-06 21:26:29 +08:00
|
|
|
memcpy (header->dshb_id, buf, 32);
|
|
|
|
header->dshb_page_size = bfd_getb16 (buf + 32);
|
|
|
|
header->dshb_hash_page = bfd_getb16 (buf + 34);
|
|
|
|
header->dshb_root_mte = bfd_getb16 (buf + 36);
|
|
|
|
header->dshb_mod_date = bfd_getb32 (buf + 38);
|
2002-11-12 23:44:24 +08:00
|
|
|
|
2002-11-06 21:26:29 +08:00
|
|
|
bfd_sym_parse_disk_table_v32 (buf + 42, 8, &header->dshb_frte);
|
|
|
|
bfd_sym_parse_disk_table_v32 (buf + 50, 8, &header->dshb_rte);
|
|
|
|
bfd_sym_parse_disk_table_v32 (buf + 58, 8, &header->dshb_mte);
|
|
|
|
bfd_sym_parse_disk_table_v32 (buf + 66, 8, &header->dshb_cmte);
|
|
|
|
bfd_sym_parse_disk_table_v32 (buf + 74, 8, &header->dshb_cvte);
|
|
|
|
bfd_sym_parse_disk_table_v32 (buf + 82, 8, &header->dshb_csnte);
|
|
|
|
bfd_sym_parse_disk_table_v32 (buf + 90, 8, &header->dshb_clte);
|
|
|
|
bfd_sym_parse_disk_table_v32 (buf + 98, 8, &header->dshb_ctte);
|
|
|
|
bfd_sym_parse_disk_table_v32 (buf + 106, 8, &header->dshb_tte);
|
|
|
|
bfd_sym_parse_disk_table_v32 (buf + 114, 8, &header->dshb_nte);
|
|
|
|
bfd_sym_parse_disk_table_v32 (buf + 122, 8, &header->dshb_tinfo);
|
|
|
|
bfd_sym_parse_disk_table_v32 (buf + 130, 8, &header->dshb_fite);
|
|
|
|
bfd_sym_parse_disk_table_v32 (buf + 138, 8, &header->dshb_const);
|
2002-11-12 23:44:24 +08:00
|
|
|
|
2002-11-06 21:26:29 +08:00
|
|
|
memcpy (&header->dshb_file_creator, buf + 146, 4);
|
|
|
|
memcpy (&header->dshb_file_type, buf + 150, 4);
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2005-04-11 16:23:05 +08:00
|
|
|
bfd_sym_read_header_v32 (bfd *abfd, bfd_sym_header_block *header)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
|
|
|
unsigned char buf[154];
|
|
|
|
long ret;
|
2002-11-12 23:44:24 +08:00
|
|
|
|
2002-11-06 21:26:29 +08:00
|
|
|
ret = bfd_bread (buf, 154, abfd);
|
|
|
|
if (ret != 154)
|
|
|
|
return -1;
|
2002-11-12 23:44:24 +08:00
|
|
|
|
2002-11-06 21:26:29 +08:00
|
|
|
bfd_sym_parse_header_v32 (buf, 154, header);
|
2002-11-12 23:44:24 +08:00
|
|
|
|
2002-11-06 21:26:29 +08:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2005-04-11 16:23:05 +08:00
|
|
|
bfd_sym_read_header_v34 (bfd *abfd ATTRIBUTE_UNUSED,
|
|
|
|
bfd_sym_header_block *header ATTRIBUTE_UNUSED)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
|
|
|
abort ();
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2005-04-11 16:23:05 +08:00
|
|
|
bfd_sym_read_header (bfd *abfd,
|
|
|
|
bfd_sym_header_block *header,
|
|
|
|
bfd_sym_version version)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
|
|
|
switch (version)
|
|
|
|
{
|
|
|
|
case BFD_SYM_VERSION_3_5:
|
|
|
|
case BFD_SYM_VERSION_3_4:
|
|
|
|
return bfd_sym_read_header_v34 (abfd, header);
|
|
|
|
case BFD_SYM_VERSION_3_3:
|
|
|
|
case BFD_SYM_VERSION_3_2:
|
|
|
|
return bfd_sym_read_header_v32 (abfd, header);
|
|
|
|
case BFD_SYM_VERSION_3_1:
|
|
|
|
default:
|
2005-04-11 16:23:05 +08:00
|
|
|
return 0;
|
2002-11-06 21:26:29 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2005-04-11 16:23:05 +08:00
|
|
|
bfd_sym_read_version (bfd *abfd, bfd_sym_version *version)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
2005-02-20 22:59:07 +08:00
|
|
|
char version_string[32];
|
2002-11-06 21:26:29 +08:00
|
|
|
long ret;
|
2002-11-12 23:44:24 +08:00
|
|
|
|
2002-11-06 21:26:29 +08:00
|
|
|
ret = bfd_bread (version_string, sizeof (version_string), abfd);
|
|
|
|
if (ret != sizeof (version_string))
|
|
|
|
return -1;
|
2002-11-12 23:44:24 +08:00
|
|
|
|
2002-11-06 21:26:29 +08:00
|
|
|
if (pstrcmp (version_string, BFD_SYM_VERSION_STR_3_1) == 0)
|
|
|
|
*version = BFD_SYM_VERSION_3_1;
|
|
|
|
else if (pstrcmp (version_string, BFD_SYM_VERSION_STR_3_2) == 0)
|
|
|
|
*version = BFD_SYM_VERSION_3_2;
|
|
|
|
else if (pstrcmp (version_string, BFD_SYM_VERSION_STR_3_3) == 0)
|
|
|
|
*version = BFD_SYM_VERSION_3_3;
|
|
|
|
else if (pstrcmp (version_string, BFD_SYM_VERSION_STR_3_4) == 0)
|
|
|
|
*version = BFD_SYM_VERSION_3_4;
|
|
|
|
else if (pstrcmp (version_string, BFD_SYM_VERSION_STR_3_5) == 0)
|
|
|
|
*version = BFD_SYM_VERSION_3_5;
|
|
|
|
else
|
|
|
|
return -1;
|
2002-11-12 23:44:24 +08:00
|
|
|
|
2002-11-06 21:26:29 +08:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2005-04-11 16:23:05 +08:00
|
|
|
bfd_sym_display_table_summary (FILE *f,
|
|
|
|
bfd_sym_table_info *dti,
|
|
|
|
const char *name)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
|
|
|
fprintf (f, "%-6s %13ld %13ld %13ld\n",
|
|
|
|
name,
|
|
|
|
dti->dti_first_page,
|
|
|
|
dti->dti_page_count,
|
|
|
|
dti->dti_object_count);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2005-04-11 16:23:05 +08:00
|
|
|
bfd_sym_display_header (FILE *f, bfd_sym_header_block *dshb)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
|
|
|
fprintf (f, " Version: %.*s\n", dshb->dshb_id[0], dshb->dshb_id + 1);
|
|
|
|
fprintf (f, " Page Size: 0x%x\n", dshb->dshb_page_size);
|
|
|
|
fprintf (f, " Hash Page: %lu\n", dshb->dshb_hash_page);
|
|
|
|
fprintf (f, " Root MTE: %lu\n", dshb->dshb_root_mte);
|
|
|
|
fprintf (f, " Modification Date: ");
|
|
|
|
fprintf (f, "[unimplemented]");
|
|
|
|
fprintf (f, " (0x%lx)\n", dshb->dshb_mod_date);
|
|
|
|
|
|
|
|
fprintf (f, " File Creator: %.4s Type: %.4s\n\n",
|
|
|
|
dshb->dshb_file_creator, dshb->dshb_file_type);
|
2002-11-12 23:44:24 +08:00
|
|
|
|
2002-11-06 21:26:29 +08:00
|
|
|
fprintf (f, "Table Name First Page Page Count Object Count\n");
|
|
|
|
fprintf (f, "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n");
|
2002-11-12 23:44:24 +08:00
|
|
|
|
2002-11-06 21:26:29 +08:00
|
|
|
bfd_sym_display_table_summary (f, &dshb->dshb_nte, "NTE");
|
|
|
|
bfd_sym_display_table_summary (f, &dshb->dshb_rte, "RTE");
|
|
|
|
bfd_sym_display_table_summary (f, &dshb->dshb_mte, "MTE");
|
|
|
|
bfd_sym_display_table_summary (f, &dshb->dshb_frte, "FRTE");
|
|
|
|
bfd_sym_display_table_summary (f, &dshb->dshb_cmte, "CMTE");
|
|
|
|
bfd_sym_display_table_summary (f, &dshb->dshb_cvte, "CVTE");
|
|
|
|
bfd_sym_display_table_summary (f, &dshb->dshb_csnte, "CSNTE");
|
|
|
|
bfd_sym_display_table_summary (f, &dshb->dshb_clte, "CLTE");
|
|
|
|
bfd_sym_display_table_summary (f, &dshb->dshb_ctte, "CTTE");
|
|
|
|
bfd_sym_display_table_summary (f, &dshb->dshb_tte, "TTE");
|
|
|
|
bfd_sym_display_table_summary (f, &dshb->dshb_tinfo, "TINFO");
|
|
|
|
bfd_sym_display_table_summary (f, &dshb->dshb_fite, "FITE");
|
|
|
|
bfd_sym_display_table_summary (f, &dshb->dshb_const, "CONST");
|
2002-11-12 23:44:24 +08:00
|
|
|
|
2002-11-06 21:26:29 +08:00
|
|
|
fprintf (f, "\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2005-04-11 16:23:05 +08:00
|
|
|
bfd_sym_parse_resources_table_entry_v32 (unsigned char *buf,
|
|
|
|
size_t len,
|
|
|
|
bfd_sym_resources_table_entry *entry)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
|
|
|
BFD_ASSERT (len == 18);
|
|
|
|
|
|
|
|
memcpy (&entry->rte_res_type, buf, 4);
|
|
|
|
entry->rte_res_number = bfd_getb16 (buf + 4);
|
|
|
|
entry->rte_nte_index = bfd_getb32 (buf + 6);
|
|
|
|
entry->rte_mte_first = bfd_getb16 (buf + 10);
|
|
|
|
entry->rte_mte_last = bfd_getb16 (buf + 12);
|
|
|
|
entry->rte_res_size = bfd_getb32 (buf + 14);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2005-04-11 16:23:05 +08:00
|
|
|
bfd_sym_parse_modules_table_entry_v33 (unsigned char *buf,
|
|
|
|
size_t len,
|
|
|
|
bfd_sym_modules_table_entry *entry)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
|
|
|
BFD_ASSERT (len == 46);
|
|
|
|
|
|
|
|
entry->mte_rte_index = bfd_getb16 (buf);
|
|
|
|
entry->mte_res_offset = bfd_getb32 (buf + 2);
|
|
|
|
entry->mte_size = bfd_getb32 (buf + 6);
|
|
|
|
entry->mte_kind = buf[10];
|
|
|
|
entry->mte_scope = buf[11];
|
|
|
|
entry->mte_parent = bfd_getb16 (buf + 12);
|
|
|
|
bfd_sym_parse_file_reference_v32 (buf + 14, 6, &entry->mte_imp_fref);
|
|
|
|
entry->mte_imp_end = bfd_getb32 (buf + 20);
|
|
|
|
entry->mte_nte_index = bfd_getb32 (buf + 24);
|
|
|
|
entry->mte_cmte_index = bfd_getb16 (buf + 28);
|
|
|
|
entry->mte_cvte_index = bfd_getb32 (buf + 30);
|
|
|
|
entry->mte_clte_index = bfd_getb16 (buf + 34);
|
|
|
|
entry->mte_ctte_index = bfd_getb16 (buf + 36);
|
|
|
|
entry->mte_csnte_idx_1 = bfd_getb32 (buf + 38);
|
|
|
|
entry->mte_csnte_idx_2 = bfd_getb32 (buf + 42);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2005-04-11 16:23:05 +08:00
|
|
|
bfd_sym_parse_file_references_table_entry_v32 (unsigned char *buf,
|
|
|
|
size_t len,
|
|
|
|
bfd_sym_file_references_table_entry *entry)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
|
|
|
unsigned int type;
|
2002-11-12 23:44:24 +08:00
|
|
|
|
2002-11-06 21:26:29 +08:00
|
|
|
BFD_ASSERT (len == 10);
|
|
|
|
|
|
|
|
memset (entry, 0, sizeof (bfd_sym_file_references_table_entry));
|
|
|
|
type = bfd_getb16 (buf);
|
|
|
|
|
|
|
|
switch (type)
|
|
|
|
{
|
|
|
|
case BFD_SYM_END_OF_LIST_3_2:
|
|
|
|
entry->generic.type = BFD_SYM_END_OF_LIST;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case BFD_SYM_FILE_NAME_INDEX_3_2:
|
|
|
|
entry->filename.type = BFD_SYM_FILE_NAME_INDEX;
|
|
|
|
entry->filename.nte_index = bfd_getb32 (buf + 2);
|
|
|
|
entry->filename.mod_date = bfd_getb32 (buf + 6);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
entry->entry.mte_index = type;
|
|
|
|
entry->entry.file_offset = bfd_getb32 (buf + 2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2005-04-11 16:23:05 +08:00
|
|
|
bfd_sym_parse_contained_modules_table_entry_v32 (unsigned char *buf,
|
|
|
|
size_t len,
|
|
|
|
bfd_sym_contained_modules_table_entry *entry)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
|
|
|
unsigned int type;
|
|
|
|
|
|
|
|
BFD_ASSERT (len == 6);
|
|
|
|
|
|
|
|
memset (entry, 0, sizeof (bfd_sym_contained_modules_table_entry));
|
|
|
|
type = bfd_getb16 (buf);
|
2002-11-12 23:44:24 +08:00
|
|
|
|
2002-11-06 21:26:29 +08:00
|
|
|
switch (type)
|
|
|
|
{
|
|
|
|
case BFD_SYM_END_OF_LIST_3_2:
|
|
|
|
entry->generic.type = BFD_SYM_END_OF_LIST;
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
entry->entry.mte_index = type;
|
|
|
|
entry->entry.nte_index = bfd_getb32 (buf + 2);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2005-04-11 16:23:05 +08:00
|
|
|
bfd_sym_parse_contained_variables_table_entry_v32 (unsigned char *buf,
|
|
|
|
size_t len,
|
|
|
|
bfd_sym_contained_variables_table_entry *entry)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
|
|
|
unsigned int type;
|
2002-11-12 23:44:24 +08:00
|
|
|
|
2002-11-06 21:26:29 +08:00
|
|
|
BFD_ASSERT (len == 26);
|
|
|
|
|
|
|
|
memset (entry, 0, sizeof (bfd_sym_contained_variables_table_entry));
|
|
|
|
type = bfd_getb16 (buf);
|
|
|
|
|
|
|
|
switch (type)
|
|
|
|
{
|
|
|
|
case BFD_SYM_END_OF_LIST_3_2:
|
|
|
|
entry->generic.type = BFD_SYM_END_OF_LIST;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case BFD_SYM_SOURCE_FILE_CHANGE_3_2:
|
|
|
|
entry->file.type = BFD_SYM_SOURCE_FILE_CHANGE;
|
|
|
|
bfd_sym_parse_file_reference_v32 (buf + 2, 6, &entry->file.fref);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
entry->entry.tte_index = type;
|
|
|
|
entry->entry.nte_index = bfd_getb32 (buf + 2);
|
|
|
|
entry->entry.file_delta = bfd_getb16 (buf + 6);
|
|
|
|
entry->entry.scope = buf[8];
|
|
|
|
entry->entry.la_size = buf[9];
|
|
|
|
|
|
|
|
if (entry->entry.la_size == BFD_SYM_CVTE_SCA)
|
|
|
|
{
|
|
|
|
entry->entry.address.scstruct.sca_kind = buf[10];
|
|
|
|
entry->entry.address.scstruct.sca_class = buf[11];
|
|
|
|
entry->entry.address.scstruct.sca_offset = bfd_getb32 (buf + 12);
|
|
|
|
}
|
|
|
|
else if (entry->entry.la_size <= BFD_SYM_CVTE_SCA)
|
|
|
|
{
|
2005-02-12 01:22:47 +08:00
|
|
|
#if BFD_SYM_CVTE_SCA > 0
|
2005-04-11 16:23:05 +08:00
|
|
|
memcpy (&entry->entry.address.lastruct.la, buf + 10,
|
|
|
|
BFD_SYM_CVTE_SCA);
|
2005-02-12 01:22:47 +08:00
|
|
|
#endif
|
2002-11-06 21:26:29 +08:00
|
|
|
entry->entry.address.lastruct.la_kind = buf[23];
|
|
|
|
}
|
|
|
|
else if (entry->entry.la_size == BFD_SYM_CVTE_BIG_LA)
|
|
|
|
{
|
|
|
|
entry->entry.address.biglastruct.big_la = bfd_getb32 (buf + 10);
|
|
|
|
entry->entry.address.biglastruct.big_la_kind = buf[12];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2005-04-11 16:23:05 +08:00
|
|
|
bfd_sym_parse_contained_statements_table_entry_v32 (unsigned char *buf,
|
|
|
|
size_t len,
|
|
|
|
bfd_sym_contained_statements_table_entry *entry)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
|
|
|
unsigned int type;
|
|
|
|
|
|
|
|
BFD_ASSERT (len == 8);
|
|
|
|
|
|
|
|
memset (entry, 0, sizeof (bfd_sym_contained_statements_table_entry));
|
|
|
|
type = bfd_getb16 (buf);
|
2002-11-12 23:44:24 +08:00
|
|
|
|
2002-11-06 21:26:29 +08:00
|
|
|
switch (type)
|
|
|
|
{
|
|
|
|
case BFD_SYM_END_OF_LIST_3_2:
|
|
|
|
entry->generic.type = BFD_SYM_END_OF_LIST;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case BFD_SYM_SOURCE_FILE_CHANGE_3_2:
|
|
|
|
entry->file.type = BFD_SYM_SOURCE_FILE_CHANGE;
|
|
|
|
bfd_sym_parse_file_reference_v32 (buf + 2, 6, &entry->file.fref);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
entry->entry.mte_index = type;
|
|
|
|
entry->entry.mte_offset = bfd_getb16 (buf + 2);
|
|
|
|
entry->entry.file_delta = bfd_getb32 (buf + 4);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2005-04-11 16:23:05 +08:00
|
|
|
bfd_sym_parse_contained_labels_table_entry_v32 (unsigned char *buf,
|
|
|
|
size_t len,
|
|
|
|
bfd_sym_contained_labels_table_entry *entry)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
|
|
|
unsigned int type;
|
|
|
|
|
|
|
|
BFD_ASSERT (len == 12);
|
|
|
|
|
|
|
|
memset (entry, 0, sizeof (bfd_sym_contained_labels_table_entry));
|
|
|
|
type = bfd_getb16 (buf);
|
2002-11-12 23:44:24 +08:00
|
|
|
|
2002-11-06 21:26:29 +08:00
|
|
|
switch (type)
|
|
|
|
{
|
|
|
|
case BFD_SYM_END_OF_LIST_3_2:
|
|
|
|
entry->generic.type = BFD_SYM_END_OF_LIST;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case BFD_SYM_SOURCE_FILE_CHANGE_3_2:
|
|
|
|
entry->file.type = BFD_SYM_SOURCE_FILE_CHANGE;
|
|
|
|
bfd_sym_parse_file_reference_v32 (buf + 2, 6, &entry->file.fref);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
entry->entry.mte_index = type;
|
|
|
|
entry->entry.mte_offset = bfd_getb16 (buf + 2);
|
|
|
|
entry->entry.nte_index = bfd_getb32 (buf + 4);
|
|
|
|
entry->entry.file_delta = bfd_getb16 (buf + 8);
|
|
|
|
entry->entry.scope = bfd_getb16 (buf + 10);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2005-04-11 16:23:05 +08:00
|
|
|
bfd_sym_parse_type_table_entry_v32 (unsigned char *buf,
|
|
|
|
size_t len,
|
|
|
|
bfd_sym_type_table_entry *entry)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
|
|
|
BFD_ASSERT (len == 4);
|
2002-11-12 23:44:24 +08:00
|
|
|
|
2002-11-06 21:26:29 +08:00
|
|
|
*entry = bfd_getb32 (buf);
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2005-04-11 16:23:05 +08:00
|
|
|
bfd_sym_fetch_resources_table_entry (bfd *abfd,
|
|
|
|
bfd_sym_resources_table_entry *entry,
|
2009-12-11 21:42:17 +08:00
|
|
|
unsigned long sym_index)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
2005-04-11 16:23:05 +08:00
|
|
|
void (*parser) (unsigned char *, size_t, bfd_sym_resources_table_entry *);
|
2002-11-06 21:26:29 +08:00
|
|
|
unsigned long offset;
|
|
|
|
unsigned long entry_size;
|
|
|
|
unsigned char buf[18];
|
|
|
|
bfd_sym_data_struct *sdata = NULL;
|
|
|
|
|
2002-11-12 23:44:24 +08:00
|
|
|
parser = NULL;
|
2002-11-06 21:26:29 +08:00
|
|
|
BFD_ASSERT (bfd_sym_valid (abfd));
|
|
|
|
sdata = abfd->tdata.sym_data;
|
|
|
|
|
2009-12-11 21:42:17 +08:00
|
|
|
if (sym_index == 0)
|
2002-11-06 21:26:29 +08:00
|
|
|
return -1;
|
|
|
|
|
|
|
|
switch (sdata->version)
|
|
|
|
{
|
|
|
|
case BFD_SYM_VERSION_3_5:
|
|
|
|
case BFD_SYM_VERSION_3_4:
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
case BFD_SYM_VERSION_3_3:
|
|
|
|
case BFD_SYM_VERSION_3_2:
|
|
|
|
entry_size = 18;
|
|
|
|
parser = bfd_sym_parse_resources_table_entry_v32;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case BFD_SYM_VERSION_3_1:
|
|
|
|
default:
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
if (parser == NULL)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
offset = compute_offset (sdata->header.dshb_rte.dti_first_page,
|
|
|
|
sdata->header.dshb_page_size,
|
2009-12-11 21:42:17 +08:00
|
|
|
entry_size, sym_index);
|
2002-11-12 23:44:24 +08:00
|
|
|
|
2002-11-06 21:26:29 +08:00
|
|
|
if (bfd_seek (abfd, offset, SEEK_SET) < 0)
|
|
|
|
return -1;
|
|
|
|
if (bfd_bread (buf, entry_size, abfd) != entry_size)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
(*parser) (buf, entry_size, entry);
|
2002-11-12 23:44:24 +08:00
|
|
|
|
2002-11-06 21:26:29 +08:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2005-04-11 16:23:05 +08:00
|
|
|
bfd_sym_fetch_modules_table_entry (bfd *abfd,
|
|
|
|
bfd_sym_modules_table_entry *entry,
|
2009-12-11 21:42:17 +08:00
|
|
|
unsigned long sym_index)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
2005-04-11 16:23:05 +08:00
|
|
|
void (*parser) (unsigned char *, size_t, bfd_sym_modules_table_entry *);
|
2002-11-06 21:26:29 +08:00
|
|
|
unsigned long offset;
|
|
|
|
unsigned long entry_size;
|
|
|
|
unsigned char buf[46];
|
|
|
|
bfd_sym_data_struct *sdata = NULL;
|
|
|
|
|
2002-11-12 23:44:24 +08:00
|
|
|
parser = NULL;
|
2002-11-06 21:26:29 +08:00
|
|
|
BFD_ASSERT (bfd_sym_valid (abfd));
|
|
|
|
sdata = abfd->tdata.sym_data;
|
|
|
|
|
2009-12-11 21:42:17 +08:00
|
|
|
if (sym_index == 0)
|
2002-11-06 21:26:29 +08:00
|
|
|
return -1;
|
|
|
|
|
|
|
|
switch (sdata->version)
|
|
|
|
{
|
|
|
|
case BFD_SYM_VERSION_3_5:
|
|
|
|
case BFD_SYM_VERSION_3_4:
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
case BFD_SYM_VERSION_3_3:
|
|
|
|
entry_size = 46;
|
|
|
|
parser = bfd_sym_parse_modules_table_entry_v33;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case BFD_SYM_VERSION_3_2:
|
|
|
|
case BFD_SYM_VERSION_3_1:
|
|
|
|
default:
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
if (parser == NULL)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
offset = compute_offset (sdata->header.dshb_mte.dti_first_page,
|
|
|
|
sdata->header.dshb_page_size,
|
2009-12-11 21:42:17 +08:00
|
|
|
entry_size, sym_index);
|
2002-11-12 23:44:24 +08:00
|
|
|
|
2002-11-06 21:26:29 +08:00
|
|
|
if (bfd_seek (abfd, offset, SEEK_SET) < 0)
|
|
|
|
return -1;
|
|
|
|
if (bfd_bread (buf, entry_size, abfd) != entry_size)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
(*parser) (buf, entry_size, entry);
|
2002-11-12 23:44:24 +08:00
|
|
|
|
2002-11-06 21:26:29 +08:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2005-04-11 16:23:05 +08:00
|
|
|
bfd_sym_fetch_file_references_table_entry (bfd *abfd,
|
|
|
|
bfd_sym_file_references_table_entry *entry,
|
2009-12-11 21:42:17 +08:00
|
|
|
unsigned long sym_index)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
2005-04-11 16:23:05 +08:00
|
|
|
void (*parser) (unsigned char *, size_t, bfd_sym_file_references_table_entry *);
|
2002-11-06 21:26:29 +08:00
|
|
|
unsigned long offset;
|
|
|
|
unsigned long entry_size = 0;
|
|
|
|
unsigned char buf[8];
|
|
|
|
bfd_sym_data_struct *sdata = NULL;
|
|
|
|
|
2002-11-12 23:44:24 +08:00
|
|
|
parser = NULL;
|
2002-11-06 21:26:29 +08:00
|
|
|
BFD_ASSERT (bfd_sym_valid (abfd));
|
|
|
|
sdata = abfd->tdata.sym_data;
|
|
|
|
|
2009-12-11 21:42:17 +08:00
|
|
|
if (sym_index == 0)
|
2002-11-06 21:26:29 +08:00
|
|
|
return -1;
|
|
|
|
|
|
|
|
switch (sdata->version)
|
|
|
|
{
|
|
|
|
case BFD_SYM_VERSION_3_3:
|
|
|
|
case BFD_SYM_VERSION_3_2:
|
|
|
|
entry_size = 10;
|
|
|
|
parser = bfd_sym_parse_file_references_table_entry_v32;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case BFD_SYM_VERSION_3_5:
|
|
|
|
case BFD_SYM_VERSION_3_4:
|
|
|
|
case BFD_SYM_VERSION_3_1:
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (parser == NULL)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
offset = compute_offset (sdata->header.dshb_frte.dti_first_page,
|
|
|
|
sdata->header.dshb_page_size,
|
2009-12-11 21:42:17 +08:00
|
|
|
entry_size, sym_index);
|
2002-11-12 23:44:24 +08:00
|
|
|
|
2002-11-06 21:26:29 +08:00
|
|
|
if (bfd_seek (abfd, offset, SEEK_SET) < 0)
|
|
|
|
return -1;
|
|
|
|
if (bfd_bread (buf, entry_size, abfd) != entry_size)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
(*parser) (buf, entry_size, entry);
|
2002-11-12 23:44:24 +08:00
|
|
|
|
2002-11-06 21:26:29 +08:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2005-04-11 16:23:05 +08:00
|
|
|
bfd_sym_fetch_contained_modules_table_entry (bfd *abfd,
|
|
|
|
bfd_sym_contained_modules_table_entry *entry,
|
2009-12-11 21:42:17 +08:00
|
|
|
unsigned long sym_index)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
2005-04-11 16:23:05 +08:00
|
|
|
void (*parser) (unsigned char *, size_t, bfd_sym_contained_modules_table_entry *);
|
2002-11-06 21:26:29 +08:00
|
|
|
unsigned long offset;
|
|
|
|
unsigned long entry_size = 0;
|
|
|
|
unsigned char buf[6];
|
|
|
|
bfd_sym_data_struct *sdata = NULL;
|
|
|
|
|
2002-11-12 23:44:24 +08:00
|
|
|
parser = NULL;
|
2002-11-06 21:26:29 +08:00
|
|
|
BFD_ASSERT (bfd_sym_valid (abfd));
|
|
|
|
sdata = abfd->tdata.sym_data;
|
|
|
|
|
2009-12-11 21:42:17 +08:00
|
|
|
if (sym_index == 0)
|
2002-11-06 21:26:29 +08:00
|
|
|
return -1;
|
|
|
|
|
|
|
|
switch (sdata->version)
|
|
|
|
{
|
|
|
|
case BFD_SYM_VERSION_3_3:
|
|
|
|
case BFD_SYM_VERSION_3_2:
|
|
|
|
entry_size = 6;
|
|
|
|
parser = bfd_sym_parse_contained_modules_table_entry_v32;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case BFD_SYM_VERSION_3_5:
|
|
|
|
case BFD_SYM_VERSION_3_4:
|
|
|
|
case BFD_SYM_VERSION_3_1:
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (parser == NULL)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
offset = compute_offset (sdata->header.dshb_cmte.dti_first_page,
|
|
|
|
sdata->header.dshb_page_size,
|
2009-12-11 21:42:17 +08:00
|
|
|
entry_size, sym_index);
|
2002-11-12 23:44:24 +08:00
|
|
|
|
2002-11-06 21:26:29 +08:00
|
|
|
if (bfd_seek (abfd, offset, SEEK_SET) < 0)
|
|
|
|
return -1;
|
|
|
|
if (bfd_bread (buf, entry_size, abfd) != entry_size)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
(*parser) (buf, entry_size, entry);
|
2002-11-12 23:44:24 +08:00
|
|
|
|
2002-11-06 21:26:29 +08:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2005-04-11 16:23:05 +08:00
|
|
|
bfd_sym_fetch_contained_variables_table_entry (bfd *abfd,
|
|
|
|
bfd_sym_contained_variables_table_entry *entry,
|
2009-12-11 21:42:17 +08:00
|
|
|
unsigned long sym_index)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
2005-04-11 16:23:05 +08:00
|
|
|
void (*parser) (unsigned char *, size_t, bfd_sym_contained_variables_table_entry *);
|
2002-11-06 21:26:29 +08:00
|
|
|
unsigned long offset;
|
|
|
|
unsigned long entry_size = 0;
|
|
|
|
unsigned char buf[26];
|
|
|
|
bfd_sym_data_struct *sdata = NULL;
|
|
|
|
|
2002-11-12 23:44:24 +08:00
|
|
|
parser = NULL;
|
2002-11-06 21:26:29 +08:00
|
|
|
BFD_ASSERT (bfd_sym_valid (abfd));
|
|
|
|
sdata = abfd->tdata.sym_data;
|
|
|
|
|
2009-12-11 21:42:17 +08:00
|
|
|
if (sym_index == 0)
|
2002-11-06 21:26:29 +08:00
|
|
|
return -1;
|
|
|
|
|
|
|
|
switch (sdata->version)
|
|
|
|
{
|
|
|
|
case BFD_SYM_VERSION_3_3:
|
|
|
|
case BFD_SYM_VERSION_3_2:
|
|
|
|
entry_size = 26;
|
|
|
|
parser = bfd_sym_parse_contained_variables_table_entry_v32;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case BFD_SYM_VERSION_3_5:
|
|
|
|
case BFD_SYM_VERSION_3_4:
|
|
|
|
case BFD_SYM_VERSION_3_1:
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (parser == NULL)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
offset = compute_offset (sdata->header.dshb_cvte.dti_first_page,
|
|
|
|
sdata->header.dshb_page_size,
|
2009-12-11 21:42:17 +08:00
|
|
|
entry_size, sym_index);
|
2002-11-12 23:44:24 +08:00
|
|
|
|
2002-11-06 21:26:29 +08:00
|
|
|
if (bfd_seek (abfd, offset, SEEK_SET) < 0)
|
|
|
|
return -1;
|
|
|
|
if (bfd_bread (buf, entry_size, abfd) != entry_size)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
(*parser) (buf, entry_size, entry);
|
2002-11-12 23:44:24 +08:00
|
|
|
|
2002-11-06 21:26:29 +08:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2005-04-11 16:23:05 +08:00
|
|
|
bfd_sym_fetch_contained_statements_table_entry (bfd *abfd,
|
|
|
|
bfd_sym_contained_statements_table_entry *entry,
|
2009-12-11 21:42:17 +08:00
|
|
|
unsigned long sym_index)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
2005-04-11 16:23:05 +08:00
|
|
|
void (*parser) (unsigned char *, size_t, bfd_sym_contained_statements_table_entry *);
|
2002-11-06 21:26:29 +08:00
|
|
|
unsigned long offset;
|
|
|
|
unsigned long entry_size = 0;
|
|
|
|
unsigned char buf[8];
|
|
|
|
bfd_sym_data_struct *sdata = NULL;
|
|
|
|
|
2002-11-12 23:44:24 +08:00
|
|
|
parser = NULL;
|
2002-11-06 21:26:29 +08:00
|
|
|
BFD_ASSERT (bfd_sym_valid (abfd));
|
|
|
|
sdata = abfd->tdata.sym_data;
|
|
|
|
|
2009-12-11 21:42:17 +08:00
|
|
|
if (sym_index == 0)
|
2002-11-06 21:26:29 +08:00
|
|
|
return -1;
|
|
|
|
|
|
|
|
switch (sdata->version)
|
|
|
|
{
|
|
|
|
case BFD_SYM_VERSION_3_3:
|
|
|
|
case BFD_SYM_VERSION_3_2:
|
|
|
|
entry_size = 8;
|
|
|
|
parser = bfd_sym_parse_contained_statements_table_entry_v32;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case BFD_SYM_VERSION_3_5:
|
|
|
|
case BFD_SYM_VERSION_3_4:
|
|
|
|
case BFD_SYM_VERSION_3_1:
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (parser == NULL)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
offset = compute_offset (sdata->header.dshb_csnte.dti_first_page,
|
|
|
|
sdata->header.dshb_page_size,
|
2009-12-11 21:42:17 +08:00
|
|
|
entry_size, sym_index);
|
2002-11-12 23:44:24 +08:00
|
|
|
|
2002-11-06 21:26:29 +08:00
|
|
|
if (bfd_seek (abfd, offset, SEEK_SET) < 0)
|
|
|
|
return -1;
|
|
|
|
if (bfd_bread (buf, entry_size, abfd) != entry_size)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
(*parser) (buf, entry_size, entry);
|
2002-11-12 23:44:24 +08:00
|
|
|
|
2002-11-06 21:26:29 +08:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2005-04-11 16:23:05 +08:00
|
|
|
bfd_sym_fetch_contained_labels_table_entry (bfd *abfd,
|
|
|
|
bfd_sym_contained_labels_table_entry *entry,
|
2009-12-11 21:42:17 +08:00
|
|
|
unsigned long sym_index)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
2005-04-11 16:23:05 +08:00
|
|
|
void (*parser) (unsigned char *, size_t, bfd_sym_contained_labels_table_entry *);
|
2002-11-06 21:26:29 +08:00
|
|
|
unsigned long offset;
|
|
|
|
unsigned long entry_size = 0;
|
|
|
|
unsigned char buf[12];
|
|
|
|
bfd_sym_data_struct *sdata = NULL;
|
|
|
|
|
2002-11-12 23:44:24 +08:00
|
|
|
parser = NULL;
|
2002-11-06 21:26:29 +08:00
|
|
|
BFD_ASSERT (bfd_sym_valid (abfd));
|
|
|
|
sdata = abfd->tdata.sym_data;
|
|
|
|
|
2009-12-11 21:42:17 +08:00
|
|
|
if (sym_index == 0)
|
2002-11-06 21:26:29 +08:00
|
|
|
return -1;
|
|
|
|
|
|
|
|
switch (sdata->version)
|
|
|
|
{
|
|
|
|
case BFD_SYM_VERSION_3_3:
|
|
|
|
case BFD_SYM_VERSION_3_2:
|
|
|
|
entry_size = 12;
|
|
|
|
parser = bfd_sym_parse_contained_labels_table_entry_v32;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case BFD_SYM_VERSION_3_5:
|
|
|
|
case BFD_SYM_VERSION_3_4:
|
|
|
|
case BFD_SYM_VERSION_3_1:
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (parser == NULL)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
offset = compute_offset (sdata->header.dshb_clte.dti_first_page,
|
|
|
|
sdata->header.dshb_page_size,
|
2009-12-11 21:42:17 +08:00
|
|
|
entry_size, sym_index);
|
2002-11-12 23:44:24 +08:00
|
|
|
|
2002-11-06 21:26:29 +08:00
|
|
|
if (bfd_seek (abfd, offset, SEEK_SET) < 0)
|
|
|
|
return -1;
|
|
|
|
if (bfd_bread (buf, entry_size, abfd) != entry_size)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
(*parser) (buf, entry_size, entry);
|
2002-11-12 23:44:24 +08:00
|
|
|
|
2002-11-06 21:26:29 +08:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2005-04-11 16:23:05 +08:00
|
|
|
bfd_sym_fetch_contained_types_table_entry (bfd *abfd,
|
|
|
|
bfd_sym_contained_types_table_entry *entry,
|
2009-12-11 21:42:17 +08:00
|
|
|
unsigned long sym_index)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
2005-04-11 16:23:05 +08:00
|
|
|
void (*parser) (unsigned char *, size_t, bfd_sym_contained_types_table_entry *);
|
2002-11-06 21:26:29 +08:00
|
|
|
unsigned long offset;
|
|
|
|
unsigned long entry_size = 0;
|
|
|
|
unsigned char buf[0];
|
|
|
|
bfd_sym_data_struct *sdata = NULL;
|
|
|
|
|
2002-11-12 23:44:24 +08:00
|
|
|
parser = NULL;
|
2002-11-06 21:26:29 +08:00
|
|
|
BFD_ASSERT (bfd_sym_valid (abfd));
|
|
|
|
sdata = abfd->tdata.sym_data;
|
|
|
|
|
2009-12-11 21:42:17 +08:00
|
|
|
if (sym_index == 0)
|
2002-11-06 21:26:29 +08:00
|
|
|
return -1;
|
|
|
|
|
|
|
|
switch (sdata->version)
|
|
|
|
{
|
|
|
|
case BFD_SYM_VERSION_3_3:
|
|
|
|
case BFD_SYM_VERSION_3_2:
|
|
|
|
entry_size = 0;
|
|
|
|
parser = NULL;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case BFD_SYM_VERSION_3_5:
|
|
|
|
case BFD_SYM_VERSION_3_4:
|
|
|
|
case BFD_SYM_VERSION_3_1:
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (parser == NULL)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
offset = compute_offset (sdata->header.dshb_ctte.dti_first_page,
|
|
|
|
sdata->header.dshb_page_size,
|
2009-12-11 21:42:17 +08:00
|
|
|
entry_size, sym_index);
|
2002-11-12 23:44:24 +08:00
|
|
|
|
2002-11-06 21:26:29 +08:00
|
|
|
if (bfd_seek (abfd, offset, SEEK_SET) < 0)
|
|
|
|
return -1;
|
|
|
|
if (bfd_bread (buf, entry_size, abfd) != entry_size)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
(*parser) (buf, entry_size, entry);
|
2002-11-12 23:44:24 +08:00
|
|
|
|
2002-11-06 21:26:29 +08:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2005-04-11 16:23:05 +08:00
|
|
|
bfd_sym_fetch_file_references_index_table_entry (bfd *abfd,
|
|
|
|
bfd_sym_file_references_index_table_entry *entry,
|
2009-12-11 21:42:17 +08:00
|
|
|
unsigned long sym_index)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
2005-04-11 16:23:05 +08:00
|
|
|
void (*parser) (unsigned char *, size_t, bfd_sym_file_references_index_table_entry *);
|
2002-11-06 21:26:29 +08:00
|
|
|
unsigned long offset;
|
|
|
|
unsigned long entry_size = 0;
|
|
|
|
unsigned char buf[0];
|
|
|
|
bfd_sym_data_struct *sdata = NULL;
|
|
|
|
|
2002-11-12 23:44:24 +08:00
|
|
|
parser = NULL;
|
2002-11-06 21:26:29 +08:00
|
|
|
BFD_ASSERT (bfd_sym_valid (abfd));
|
|
|
|
sdata = abfd->tdata.sym_data;
|
|
|
|
|
2009-12-11 21:42:17 +08:00
|
|
|
if (sym_index == 0)
|
2002-11-06 21:26:29 +08:00
|
|
|
return -1;
|
|
|
|
|
|
|
|
switch (sdata->version)
|
|
|
|
{
|
|
|
|
case BFD_SYM_VERSION_3_3:
|
|
|
|
case BFD_SYM_VERSION_3_2:
|
|
|
|
entry_size = 0;
|
|
|
|
parser = NULL;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case BFD_SYM_VERSION_3_5:
|
|
|
|
case BFD_SYM_VERSION_3_4:
|
|
|
|
case BFD_SYM_VERSION_3_1:
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (parser == NULL)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
offset = compute_offset (sdata->header.dshb_fite.dti_first_page,
|
|
|
|
sdata->header.dshb_page_size,
|
2009-12-11 21:42:17 +08:00
|
|
|
entry_size, sym_index);
|
2002-11-12 23:44:24 +08:00
|
|
|
|
2002-11-06 21:26:29 +08:00
|
|
|
if (bfd_seek (abfd, offset, SEEK_SET) < 0)
|
|
|
|
return -1;
|
|
|
|
if (bfd_bread (buf, entry_size, abfd) != entry_size)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
(*parser) (buf, entry_size, entry);
|
2002-11-12 23:44:24 +08:00
|
|
|
|
2002-11-06 21:26:29 +08:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2005-04-11 16:23:05 +08:00
|
|
|
bfd_sym_fetch_constant_pool_entry (bfd *abfd,
|
|
|
|
bfd_sym_constant_pool_entry *entry,
|
2009-12-11 21:42:17 +08:00
|
|
|
unsigned long sym_index)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
2005-04-11 16:23:05 +08:00
|
|
|
void (*parser) (unsigned char *, size_t, bfd_sym_constant_pool_entry *);
|
2002-11-06 21:26:29 +08:00
|
|
|
unsigned long offset;
|
|
|
|
unsigned long entry_size = 0;
|
|
|
|
unsigned char buf[0];
|
|
|
|
bfd_sym_data_struct *sdata = NULL;
|
|
|
|
|
2002-11-12 23:44:24 +08:00
|
|
|
parser = NULL;
|
2002-11-06 21:26:29 +08:00
|
|
|
BFD_ASSERT (bfd_sym_valid (abfd));
|
|
|
|
sdata = abfd->tdata.sym_data;
|
|
|
|
|
2009-12-11 21:42:17 +08:00
|
|
|
if (sym_index == 0)
|
2002-11-06 21:26:29 +08:00
|
|
|
return -1;
|
|
|
|
|
|
|
|
switch (sdata->version)
|
|
|
|
{
|
|
|
|
case BFD_SYM_VERSION_3_3:
|
|
|
|
case BFD_SYM_VERSION_3_2:
|
|
|
|
entry_size = 0;
|
|
|
|
parser = NULL;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case BFD_SYM_VERSION_3_5:
|
|
|
|
case BFD_SYM_VERSION_3_4:
|
|
|
|
case BFD_SYM_VERSION_3_1:
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (parser == NULL)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
offset = compute_offset (sdata->header.dshb_fite.dti_first_page,
|
|
|
|
sdata->header.dshb_page_size,
|
2009-12-11 21:42:17 +08:00
|
|
|
entry_size, sym_index);
|
2002-11-12 23:44:24 +08:00
|
|
|
|
2002-11-06 21:26:29 +08:00
|
|
|
if (bfd_seek (abfd, offset, SEEK_SET) < 0)
|
|
|
|
return -1;
|
|
|
|
if (bfd_bread (buf, entry_size, abfd) != entry_size)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
(*parser) (buf, entry_size, entry);
|
2002-11-12 23:44:24 +08:00
|
|
|
|
2002-11-06 21:26:29 +08:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2005-04-11 16:23:05 +08:00
|
|
|
bfd_sym_fetch_type_table_entry (bfd *abfd,
|
|
|
|
bfd_sym_type_table_entry *entry,
|
2009-12-11 21:42:17 +08:00
|
|
|
unsigned long sym_index)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
2005-04-11 16:23:05 +08:00
|
|
|
void (*parser) (unsigned char *, size_t, bfd_sym_type_table_entry *);
|
2002-11-06 21:26:29 +08:00
|
|
|
unsigned long offset;
|
|
|
|
unsigned long entry_size = 0;
|
|
|
|
unsigned char buf[4];
|
|
|
|
bfd_sym_data_struct *sdata = NULL;
|
|
|
|
|
2002-11-12 23:44:24 +08:00
|
|
|
parser = NULL;
|
2002-11-06 21:26:29 +08:00
|
|
|
BFD_ASSERT (bfd_sym_valid (abfd));
|
|
|
|
sdata = abfd->tdata.sym_data;
|
|
|
|
|
|
|
|
switch (sdata->version)
|
|
|
|
{
|
|
|
|
case BFD_SYM_VERSION_3_3:
|
|
|
|
case BFD_SYM_VERSION_3_2:
|
|
|
|
entry_size = 4;
|
|
|
|
parser = bfd_sym_parse_type_table_entry_v32;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case BFD_SYM_VERSION_3_5:
|
|
|
|
case BFD_SYM_VERSION_3_4:
|
|
|
|
case BFD_SYM_VERSION_3_1:
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (parser == NULL)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
offset = compute_offset (sdata->header.dshb_tte.dti_first_page,
|
|
|
|
sdata->header.dshb_page_size,
|
2009-12-11 21:42:17 +08:00
|
|
|
entry_size, sym_index);
|
2002-11-12 23:44:24 +08:00
|
|
|
|
2002-11-06 21:26:29 +08:00
|
|
|
if (bfd_seek (abfd, offset, SEEK_SET) < 0)
|
|
|
|
return -1;
|
|
|
|
if (bfd_bread (buf, entry_size, abfd) != entry_size)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
(*parser) (buf, entry_size, entry);
|
2002-11-12 23:44:24 +08:00
|
|
|
|
2002-11-06 21:26:29 +08:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2005-04-11 16:23:05 +08:00
|
|
|
bfd_sym_fetch_type_information_table_entry (bfd *abfd,
|
|
|
|
bfd_sym_type_information_table_entry *entry,
|
|
|
|
unsigned long offset)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
|
|
|
unsigned char buf[4];
|
|
|
|
|
|
|
|
BFD_ASSERT (bfd_sym_valid (abfd));
|
|
|
|
|
2003-03-12 17:59:52 +08:00
|
|
|
if (offset == 0)
|
2002-11-06 21:26:29 +08:00
|
|
|
return -1;
|
|
|
|
|
|
|
|
if (bfd_seek (abfd, offset, SEEK_SET) < 0)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
if (bfd_bread (buf, 4, abfd) != 4)
|
|
|
|
return -1;
|
|
|
|
entry->nte_index = bfd_getb32 (buf);
|
2002-11-12 23:44:24 +08:00
|
|
|
|
2002-11-06 21:26:29 +08:00
|
|
|
if (bfd_bread (buf, 2, abfd) != 2)
|
|
|
|
return -1;
|
|
|
|
entry->physical_size = bfd_getb16 (buf);
|
2002-11-12 23:44:24 +08:00
|
|
|
|
2002-11-06 21:26:29 +08:00
|
|
|
if (entry->physical_size & 0x8000)
|
|
|
|
{
|
|
|
|
if (bfd_bread (buf, 4, abfd) != 4)
|
|
|
|
return -1;
|
|
|
|
entry->physical_size &= 0x7fff;
|
|
|
|
entry->logical_size = bfd_getb32 (buf);
|
|
|
|
entry->offset = offset + 10;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (bfd_bread (buf, 2, abfd) != 2)
|
|
|
|
return -1;
|
|
|
|
entry->physical_size &= 0x7fff;
|
|
|
|
entry->logical_size = bfd_getb16 (buf);
|
|
|
|
entry->offset = offset + 8;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2005-04-11 16:23:05 +08:00
|
|
|
bfd_sym_fetch_type_table_information (bfd *abfd,
|
|
|
|
bfd_sym_type_information_table_entry *entry,
|
2009-12-11 21:42:17 +08:00
|
|
|
unsigned long sym_index)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
|
|
|
bfd_sym_type_table_entry tindex;
|
|
|
|
bfd_sym_data_struct *sdata = NULL;
|
|
|
|
|
|
|
|
BFD_ASSERT (bfd_sym_valid (abfd));
|
|
|
|
sdata = abfd->tdata.sym_data;
|
|
|
|
|
|
|
|
if (sdata->header.dshb_tte.dti_object_count <= 99)
|
|
|
|
return -1;
|
2009-12-11 21:42:17 +08:00
|
|
|
if (sym_index < 100)
|
2002-11-06 21:26:29 +08:00
|
|
|
return -1;
|
|
|
|
|
2009-12-11 21:42:17 +08:00
|
|
|
if (bfd_sym_fetch_type_table_entry (abfd, &tindex, sym_index - 100) < 0)
|
2002-11-06 21:26:29 +08:00
|
|
|
return -1;
|
|
|
|
if (bfd_sym_fetch_type_information_table_entry (abfd, entry, tindex) < 0)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
const unsigned char *
|
2009-12-11 21:42:17 +08:00
|
|
|
bfd_sym_symbol_name (bfd *abfd, unsigned long sym_index)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
|
|
|
bfd_sym_data_struct *sdata = NULL;
|
|
|
|
|
|
|
|
BFD_ASSERT (bfd_sym_valid (abfd));
|
|
|
|
sdata = abfd->tdata.sym_data;
|
|
|
|
|
2009-12-11 21:42:17 +08:00
|
|
|
if (sym_index == 0)
|
2005-02-20 22:59:07 +08:00
|
|
|
return (const unsigned char *) "";
|
2002-11-12 23:44:24 +08:00
|
|
|
|
2009-12-11 21:42:17 +08:00
|
|
|
sym_index *= 2;
|
|
|
|
if ((sym_index / sdata->header.dshb_page_size)
|
2002-11-12 23:44:24 +08:00
|
|
|
> sdata->header.dshb_nte.dti_page_count)
|
2005-02-20 22:59:07 +08:00
|
|
|
return (const unsigned char *) "\09[INVALID]";
|
2002-11-12 23:44:24 +08:00
|
|
|
|
2009-12-11 21:42:17 +08:00
|
|
|
return (const unsigned char *) sdata->name_table + sym_index;
|
2002-11-06 21:26:29 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
const unsigned char *
|
2009-12-11 21:42:17 +08:00
|
|
|
bfd_sym_module_name (bfd *abfd, unsigned long sym_index)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
|
|
|
bfd_sym_modules_table_entry entry;
|
2002-11-12 23:44:24 +08:00
|
|
|
|
2009-12-11 21:42:17 +08:00
|
|
|
if (bfd_sym_fetch_modules_table_entry (abfd, &entry, sym_index) < 0)
|
2005-02-20 22:59:07 +08:00
|
|
|
return (const unsigned char *) "\09[INVALID]";
|
2002-11-06 21:26:29 +08:00
|
|
|
|
|
|
|
return bfd_sym_symbol_name (abfd, entry.mte_nte_index);
|
|
|
|
}
|
|
|
|
|
|
|
|
const char *
|
2005-04-11 16:23:05 +08:00
|
|
|
bfd_sym_unparse_storage_kind (enum bfd_sym_storage_kind kind)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
|
|
|
switch (kind)
|
|
|
|
{
|
|
|
|
case BFD_SYM_STORAGE_KIND_LOCAL: return "LOCAL";
|
|
|
|
case BFD_SYM_STORAGE_KIND_VALUE: return "VALUE";
|
|
|
|
case BFD_SYM_STORAGE_KIND_REFERENCE: return "REFERENCE";
|
|
|
|
case BFD_SYM_STORAGE_KIND_WITH: return "WITH";
|
|
|
|
default: return "[UNKNOWN]";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
const char *
|
2005-04-11 16:23:05 +08:00
|
|
|
bfd_sym_unparse_storage_class (enum bfd_sym_storage_class kind)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
|
|
|
switch (kind)
|
|
|
|
{
|
|
|
|
case BFD_SYM_STORAGE_CLASS_REGISTER: return "REGISTER";
|
|
|
|
case BFD_SYM_STORAGE_CLASS_GLOBAL: return "GLOBAL";
|
|
|
|
case BFD_SYM_STORAGE_CLASS_FRAME_RELATIVE: return "FRAME_RELATIVE";
|
|
|
|
case BFD_SYM_STORAGE_CLASS_STACK_RELATIVE: return "STACK_RELATIVE";
|
|
|
|
case BFD_SYM_STORAGE_CLASS_ABSOLUTE: return "ABSOLUTE";
|
|
|
|
case BFD_SYM_STORAGE_CLASS_CONSTANT: return "CONSTANT";
|
|
|
|
case BFD_SYM_STORAGE_CLASS_RESOURCE: return "RESOURCE";
|
|
|
|
case BFD_SYM_STORAGE_CLASS_BIGCONSTANT: return "BIGCONSTANT";
|
|
|
|
default: return "[UNKNOWN]";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
const char *
|
2005-04-11 16:23:05 +08:00
|
|
|
bfd_sym_unparse_module_kind (enum bfd_sym_module_kind kind)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
|
|
|
switch (kind)
|
|
|
|
{
|
|
|
|
case BFD_SYM_MODULE_KIND_NONE: return "NONE";
|
|
|
|
case BFD_SYM_MODULE_KIND_PROGRAM: return "PROGRAM";
|
|
|
|
case BFD_SYM_MODULE_KIND_UNIT: return "UNIT";
|
|
|
|
case BFD_SYM_MODULE_KIND_PROCEDURE: return "PROCEDURE";
|
|
|
|
case BFD_SYM_MODULE_KIND_FUNCTION: return "FUNCTION";
|
|
|
|
case BFD_SYM_MODULE_KIND_DATA: return "DATA";
|
|
|
|
case BFD_SYM_MODULE_KIND_BLOCK: return "BLOCK";
|
|
|
|
default: return "[UNKNOWN]";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
const char *
|
2005-04-11 16:23:05 +08:00
|
|
|
bfd_sym_unparse_symbol_scope (enum bfd_sym_symbol_scope scope)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
|
|
|
switch (scope)
|
|
|
|
{
|
|
|
|
case BFD_SYM_SYMBOL_SCOPE_LOCAL: return "LOCAL";
|
|
|
|
case BFD_SYM_SYMBOL_SCOPE_GLOBAL: return "GLOBAL";
|
|
|
|
default:
|
|
|
|
return "[UNKNOWN]";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2005-04-11 16:23:05 +08:00
|
|
|
bfd_sym_print_file_reference (bfd *abfd,
|
|
|
|
FILE *f,
|
|
|
|
bfd_sym_file_reference *entry)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
|
|
|
bfd_sym_file_references_table_entry frtentry;
|
|
|
|
int ret;
|
|
|
|
|
2002-11-12 23:44:24 +08:00
|
|
|
ret = bfd_sym_fetch_file_references_table_entry (abfd, &frtentry,
|
|
|
|
entry->fref_frte_index);
|
2002-11-06 21:26:29 +08:00
|
|
|
fprintf (f, "FILE ");
|
|
|
|
|
|
|
|
if ((ret < 0) || (frtentry.generic.type != BFD_SYM_FILE_NAME_INDEX))
|
|
|
|
fprintf (f, "[INVALID]");
|
|
|
|
else
|
|
|
|
fprintf (f, "\"%.*s\"",
|
|
|
|
bfd_sym_symbol_name (abfd, frtentry.filename.nte_index)[0],
|
|
|
|
&bfd_sym_symbol_name (abfd, frtentry.filename.nte_index)[1]);
|
|
|
|
|
|
|
|
fprintf (f, " (FRTE %lu)", entry->fref_frte_index);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2005-04-11 16:23:05 +08:00
|
|
|
bfd_sym_print_resources_table_entry (bfd *abfd,
|
|
|
|
FILE *f,
|
|
|
|
bfd_sym_resources_table_entry *entry)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
|
|
|
fprintf (f, " \"%.*s\" (NTE %lu), type \"%.4s\", num %u, size %lu, MTE %lu -- %lu",
|
|
|
|
bfd_sym_symbol_name (abfd, entry->rte_nte_index)[0],
|
|
|
|
&bfd_sym_symbol_name (abfd, entry->rte_nte_index)[1],
|
|
|
|
entry->rte_nte_index, entry->rte_res_type, entry->rte_res_number,
|
|
|
|
entry->rte_res_size, entry->rte_mte_first, entry->rte_mte_last);
|
2002-11-12 23:44:24 +08:00
|
|
|
}
|
2002-11-06 21:26:29 +08:00
|
|
|
|
|
|
|
void
|
2005-04-11 16:23:05 +08:00
|
|
|
bfd_sym_print_modules_table_entry (bfd *abfd,
|
|
|
|
FILE *f,
|
|
|
|
bfd_sym_modules_table_entry *entry)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
|
|
|
fprintf (f, "\"%.*s\" (NTE %lu)",
|
|
|
|
bfd_sym_symbol_name (abfd, entry->mte_nte_index)[0],
|
|
|
|
&bfd_sym_symbol_name (abfd, entry->mte_nte_index)[1],
|
|
|
|
entry->mte_nte_index);
|
2002-11-12 23:44:24 +08:00
|
|
|
|
|
|
|
fprintf (f, "\n ");
|
2002-11-06 21:26:29 +08:00
|
|
|
|
|
|
|
bfd_sym_print_file_reference (abfd, f, &entry->mte_imp_fref);
|
2002-11-12 23:44:24 +08:00
|
|
|
fprintf (f, " range %lu -- %lu",
|
|
|
|
entry->mte_imp_fref.fref_offset, entry->mte_imp_end);
|
2002-11-06 21:26:29 +08:00
|
|
|
|
2002-11-12 23:44:24 +08:00
|
|
|
fprintf (f, "\n ");
|
2002-11-06 21:26:29 +08:00
|
|
|
|
|
|
|
fprintf (f, "kind %s", bfd_sym_unparse_module_kind (entry->mte_kind));
|
|
|
|
fprintf (f, ", scope %s", bfd_sym_unparse_symbol_scope (entry->mte_scope));
|
2002-11-12 23:44:24 +08:00
|
|
|
|
2002-11-06 21:26:29 +08:00
|
|
|
fprintf (f, ", RTE %lu, offset %lu, size %lu",
|
|
|
|
entry->mte_rte_index, entry->mte_res_offset, entry->mte_size);
|
|
|
|
|
2002-11-12 23:44:24 +08:00
|
|
|
fprintf (f, "\n ");
|
2002-11-06 21:26:29 +08:00
|
|
|
|
2002-11-12 23:44:24 +08:00
|
|
|
fprintf (f, "CMTE %lu, CVTE %lu, CLTE %lu, CTTE %lu, CSNTE1 %lu, CSNTE2 %lu",
|
2002-11-06 21:26:29 +08:00
|
|
|
entry->mte_cmte_index, entry->mte_cvte_index,
|
|
|
|
entry->mte_clte_index, entry->mte_ctte_index,
|
|
|
|
entry->mte_csnte_idx_1, entry->mte_csnte_idx_2);
|
2002-11-12 23:44:24 +08:00
|
|
|
|
2002-11-06 21:26:29 +08:00
|
|
|
if (entry->mte_parent != 0)
|
|
|
|
fprintf (f, ", parent %lu", entry->mte_parent);
|
|
|
|
else
|
|
|
|
fprintf (f, ", no parent");
|
|
|
|
|
|
|
|
if (entry->mte_cmte_index != 0)
|
|
|
|
fprintf (f, ", child %lu", entry->mte_cmte_index);
|
|
|
|
else
|
|
|
|
fprintf (f, ", no child");
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2005-04-11 16:23:05 +08:00
|
|
|
bfd_sym_print_file_references_table_entry (bfd *abfd,
|
|
|
|
FILE *f,
|
|
|
|
bfd_sym_file_references_table_entry *entry)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
|
|
|
switch (entry->generic.type)
|
|
|
|
{
|
|
|
|
case BFD_SYM_FILE_NAME_INDEX:
|
2002-11-12 23:44:24 +08:00
|
|
|
fprintf (f, "FILE \"%.*s\" (NTE %lu), modtime ",
|
2002-11-06 21:26:29 +08:00
|
|
|
bfd_sym_symbol_name (abfd, entry->filename.nte_index)[0],
|
|
|
|
&bfd_sym_symbol_name (abfd, entry->filename.nte_index)[1],
|
|
|
|
entry->filename.nte_index);
|
|
|
|
|
|
|
|
fprintf (f, "[UNIMPLEMENTED]");
|
|
|
|
/* printModDate (entry->filename.mod_date); */
|
|
|
|
fprintf (f, " (0x%lx)", entry->filename.mod_date);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case BFD_SYM_END_OF_LIST:
|
|
|
|
fprintf (f, "END");
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
fprintf (f, "\"%.*s\" (MTE %lu), offset %lu",
|
|
|
|
bfd_sym_module_name (abfd, entry->entry.mte_index)[0],
|
|
|
|
&bfd_sym_module_name (abfd, entry->entry.mte_index)[1],
|
|
|
|
entry->entry.mte_index,
|
|
|
|
entry->entry.file_offset);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2005-04-11 16:23:05 +08:00
|
|
|
bfd_sym_print_contained_modules_table_entry (bfd *abfd,
|
|
|
|
FILE *f,
|
|
|
|
bfd_sym_contained_modules_table_entry *entry)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
|
|
|
switch (entry->generic.type)
|
|
|
|
{
|
|
|
|
case BFD_SYM_END_OF_LIST:
|
|
|
|
fprintf (f, "END");
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
fprintf (f, "\"%.*s\" (MTE %lu, NTE %lu)",
|
|
|
|
bfd_sym_module_name (abfd, entry->entry.mte_index)[0],
|
|
|
|
&bfd_sym_module_name (abfd, entry->entry.mte_index)[1],
|
|
|
|
entry->entry.mte_index,
|
|
|
|
entry->entry.nte_index);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2005-04-11 16:23:05 +08:00
|
|
|
bfd_sym_print_contained_variables_table_entry (bfd *abfd,
|
|
|
|
FILE *f,
|
|
|
|
bfd_sym_contained_variables_table_entry *entry)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
|
|
|
if (entry->generic.type == BFD_SYM_END_OF_LIST)
|
|
|
|
{
|
|
|
|
fprintf (f, "END");
|
|
|
|
return;
|
|
|
|
}
|
2002-11-12 23:44:24 +08:00
|
|
|
|
2002-11-06 21:26:29 +08:00
|
|
|
if (entry->generic.type == BFD_SYM_SOURCE_FILE_CHANGE)
|
|
|
|
{
|
|
|
|
bfd_sym_print_file_reference (abfd, f, &entry->file.fref);
|
|
|
|
fprintf (f, " offset %lu", entry->file.fref.fref_offset);
|
|
|
|
return;
|
|
|
|
}
|
2002-11-12 23:44:24 +08:00
|
|
|
|
2002-11-06 21:26:29 +08:00
|
|
|
fprintf (f, "\"%.*s\" (NTE %lu)",
|
|
|
|
bfd_sym_symbol_name (abfd, entry->entry.nte_index)[0],
|
|
|
|
&bfd_sym_symbol_name (abfd, entry->entry.nte_index)[1],
|
|
|
|
entry->entry.nte_index);
|
2002-11-12 23:44:24 +08:00
|
|
|
|
2002-11-06 21:26:29 +08:00
|
|
|
fprintf (f, ", TTE %lu", entry->entry.tte_index);
|
|
|
|
fprintf (f, ", offset %lu", entry->entry.file_delta);
|
|
|
|
fprintf (f, ", scope %s", bfd_sym_unparse_symbol_scope (entry->entry.scope));
|
|
|
|
|
|
|
|
if (entry->entry.la_size == BFD_SYM_CVTE_SCA)
|
|
|
|
fprintf (f, ", latype %s, laclass %s, laoffset %lu",
|
|
|
|
bfd_sym_unparse_storage_kind (entry->entry.address.scstruct.sca_kind),
|
|
|
|
bfd_sym_unparse_storage_class (entry->entry.address.scstruct.sca_class),
|
|
|
|
entry->entry.address.scstruct.sca_offset);
|
|
|
|
else if (entry->entry.la_size <= BFD_SYM_CVTE_LA_MAX_SIZE)
|
|
|
|
{
|
|
|
|
unsigned long i;
|
|
|
|
|
|
|
|
fprintf (f, ", la [");
|
|
|
|
for (i = 0; i < entry->entry.la_size; i++)
|
|
|
|
fprintf (f, "0x%02x ", entry->entry.address.lastruct.la[i]);
|
|
|
|
fprintf (f, "]");
|
|
|
|
}
|
|
|
|
else if (entry->entry.la_size == BFD_SYM_CVTE_BIG_LA)
|
|
|
|
fprintf (f, ", bigla %lu, biglakind %u",
|
2002-11-12 23:44:24 +08:00
|
|
|
entry->entry.address.biglastruct.big_la,
|
2002-11-06 21:26:29 +08:00
|
|
|
entry->entry.address.biglastruct.big_la_kind);
|
|
|
|
|
|
|
|
else
|
|
|
|
fprintf (f, ", la [INVALID]");
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2005-04-11 16:23:05 +08:00
|
|
|
bfd_sym_print_contained_statements_table_entry (bfd *abfd,
|
|
|
|
FILE *f,
|
|
|
|
bfd_sym_contained_statements_table_entry *entry)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
|
|
|
if (entry->generic.type == BFD_SYM_END_OF_LIST)
|
|
|
|
{
|
|
|
|
fprintf (f, "END");
|
|
|
|
return;
|
|
|
|
}
|
2002-11-12 23:44:24 +08:00
|
|
|
|
2002-11-06 21:26:29 +08:00
|
|
|
if (entry->generic.type == BFD_SYM_SOURCE_FILE_CHANGE)
|
|
|
|
{
|
|
|
|
bfd_sym_print_file_reference (abfd, f, &entry->file.fref);
|
|
|
|
fprintf (f, " offset %lu", entry->file.fref.fref_offset);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
fprintf (f, "\"%.*s\" (MTE %lu), offset %lu, delta %lu",
|
|
|
|
bfd_sym_module_name (abfd, entry->entry.mte_index)[0],
|
|
|
|
&bfd_sym_module_name (abfd, entry->entry.mte_index)[1],
|
|
|
|
entry->entry.mte_index,
|
|
|
|
entry->entry.mte_offset,
|
|
|
|
entry->entry.file_delta);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2005-04-11 16:23:05 +08:00
|
|
|
bfd_sym_print_contained_labels_table_entry (bfd *abfd,
|
|
|
|
FILE *f,
|
|
|
|
bfd_sym_contained_labels_table_entry *entry)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
|
|
|
if (entry->generic.type == BFD_SYM_END_OF_LIST)
|
|
|
|
{
|
|
|
|
fprintf (f, "END");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (entry->generic.type == BFD_SYM_SOURCE_FILE_CHANGE)
|
|
|
|
{
|
|
|
|
bfd_sym_print_file_reference (abfd, f, &entry->file.fref);
|
|
|
|
fprintf (f, " offset %lu", entry->file.fref.fref_offset);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
fprintf (f, "\"%.*s\" (MTE %lu), offset %lu, delta %lu, scope %s",
|
|
|
|
bfd_sym_module_name (abfd, entry->entry.mte_index)[0],
|
|
|
|
&bfd_sym_module_name (abfd, entry->entry.mte_index)[1],
|
|
|
|
entry->entry.mte_index,
|
|
|
|
entry->entry.mte_offset,
|
|
|
|
entry->entry.file_delta,
|
|
|
|
bfd_sym_unparse_symbol_scope (entry->entry.scope));
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2005-04-11 16:23:05 +08:00
|
|
|
bfd_sym_print_contained_types_table_entry (bfd *abfd ATTRIBUTE_UNUSED,
|
|
|
|
FILE *f,
|
|
|
|
bfd_sym_contained_types_table_entry *entry ATTRIBUTE_UNUSED)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
|
|
|
fprintf (f, "[UNIMPLEMENTED]");
|
|
|
|
}
|
|
|
|
|
|
|
|
const char *
|
2005-04-11 16:23:05 +08:00
|
|
|
bfd_sym_type_operator_name (unsigned char num)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
|
|
|
switch (num)
|
|
|
|
{
|
|
|
|
case 1: return "TTE";
|
|
|
|
case 2: return "PointerTo";
|
|
|
|
case 3: return "ScalarOf";
|
|
|
|
case 4: return "ConstantOf";
|
|
|
|
case 5: return "EnumerationOf";
|
|
|
|
case 6: return "VectorOf";
|
|
|
|
case 7: return "RecordOf";
|
|
|
|
case 8: return "UnionOf";
|
|
|
|
case 9: return "SubRangeOf";
|
|
|
|
case 10: return "SetOf";
|
|
|
|
case 11: return "NamedTypeOf";
|
|
|
|
case 12: return "ProcOf";
|
|
|
|
case 13: return "ValueOf";
|
|
|
|
case 14: return "ArrayOf";
|
|
|
|
default: return "[UNKNOWN OPERATOR]";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
const char *
|
2005-04-11 16:23:05 +08:00
|
|
|
bfd_sym_type_basic_name (unsigned char num)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
|
|
|
switch (num)
|
|
|
|
{
|
|
|
|
case 0: return "void";
|
|
|
|
case 1: return "pascal string";
|
|
|
|
case 2: return "unsigned long";
|
|
|
|
case 3: return "signed long";
|
|
|
|
case 4: return "extended (10 bytes)";
|
|
|
|
case 5: return "pascal boolean (1 byte)";
|
|
|
|
case 6: return "unsigned byte";
|
|
|
|
case 7: return "signed byte";
|
|
|
|
case 8: return "character (1 byte)";
|
|
|
|
case 9: return "wide character (2 bytes)";
|
|
|
|
case 10: return "unsigned short";
|
|
|
|
case 11: return "signed short";
|
|
|
|
case 12: return "singled";
|
|
|
|
case 13: return "double";
|
|
|
|
case 14: return "extended (12 bytes)";
|
|
|
|
case 15: return "computational (8 bytes)";
|
|
|
|
case 16: return "c string";
|
|
|
|
case 17: return "as-is string";
|
|
|
|
default: return "[UNKNOWN BASIC TYPE]";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2005-04-11 16:23:05 +08:00
|
|
|
bfd_sym_fetch_long (unsigned char *buf,
|
|
|
|
unsigned long len,
|
|
|
|
unsigned long offset,
|
|
|
|
unsigned long *offsetptr,
|
|
|
|
long *value)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
if (offset >= len)
|
|
|
|
{
|
|
|
|
*value = 0;
|
|
|
|
offset += 0;
|
|
|
|
ret = -1;
|
|
|
|
}
|
|
|
|
else if (! (buf[offset] & 0x80))
|
|
|
|
{
|
|
|
|
*value = buf[offset];
|
|
|
|
offset += 1;
|
|
|
|
ret = 0;
|
|
|
|
}
|
|
|
|
else if (buf[offset] == 0xc0)
|
|
|
|
{
|
|
|
|
if ((offset + 5) > len)
|
|
|
|
{
|
|
|
|
*value = 0;
|
|
|
|
offset = len;
|
|
|
|
ret = -1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
*value = bfd_getb32 (buf + offset + 1);
|
|
|
|
offset += 5;
|
|
|
|
ret = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if ((buf[offset] & 0xc0) == 0xc0)
|
|
|
|
{
|
|
|
|
*value = -(buf[offset] & 0x3f);
|
|
|
|
offset += 1;
|
|
|
|
ret = 0;
|
|
|
|
}
|
|
|
|
else if ((buf[offset] & 0xc0) == 0x80)
|
|
|
|
{
|
|
|
|
if ((offset + 2) > len)
|
|
|
|
{
|
|
|
|
*value = 0;
|
|
|
|
offset = len;
|
|
|
|
ret = -1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
*value = bfd_getb16 (buf + offset) & 0x3fff;
|
|
|
|
offset += 2;
|
|
|
|
ret = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
abort ();
|
|
|
|
|
|
|
|
if (offsetptr != NULL)
|
|
|
|
*offsetptr = offset;
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2005-04-11 16:23:05 +08:00
|
|
|
bfd_sym_print_type_information (bfd *abfd,
|
|
|
|
FILE *f,
|
|
|
|
unsigned char *buf,
|
|
|
|
unsigned long len,
|
|
|
|
unsigned long offset,
|
|
|
|
unsigned long *offsetptr)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
|
|
|
unsigned int type;
|
|
|
|
|
|
|
|
if (offset >= len)
|
|
|
|
{
|
|
|
|
fprintf (f, "[NULL]");
|
|
|
|
|
|
|
|
if (offsetptr != NULL)
|
|
|
|
*offsetptr = offset;
|
2002-11-12 23:44:24 +08:00
|
|
|
return;
|
2002-11-06 21:26:29 +08:00
|
|
|
}
|
2002-11-12 23:44:24 +08:00
|
|
|
|
2002-11-06 21:26:29 +08:00
|
|
|
type = buf[offset];
|
|
|
|
offset++;
|
|
|
|
|
|
|
|
if (! (type & 0x80))
|
|
|
|
{
|
|
|
|
fprintf (f, "[%s] (0x%x)", bfd_sym_type_basic_name (type & 0x7f), type);
|
|
|
|
|
|
|
|
if (offsetptr != NULL)
|
|
|
|
*offsetptr = offset;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (type & 0x40)
|
|
|
|
fprintf (f, "[packed ");
|
|
|
|
else
|
|
|
|
fprintf (f, "[");
|
|
|
|
|
|
|
|
switch (type & 0x3f)
|
|
|
|
{
|
|
|
|
case 1:
|
|
|
|
{
|
|
|
|
long value;
|
|
|
|
bfd_sym_type_information_table_entry tinfo;
|
|
|
|
|
2002-11-12 23:44:24 +08:00
|
|
|
bfd_sym_fetch_long (buf, len, offset, &offset, &value);
|
2002-11-06 21:26:29 +08:00
|
|
|
if (value <= 0)
|
|
|
|
fprintf (f, "[INVALID]");
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (bfd_sym_fetch_type_table_information (abfd, &tinfo, value) < 0)
|
|
|
|
fprintf (f, "[INVALID]");
|
|
|
|
else
|
2002-11-12 23:44:24 +08:00
|
|
|
fprintf (f, "\"%.*s\"",
|
2002-11-06 21:26:29 +08:00
|
|
|
bfd_sym_symbol_name (abfd, tinfo.nte_index)[0],
|
|
|
|
&bfd_sym_symbol_name (abfd, tinfo.nte_index)[1]);
|
|
|
|
}
|
2008-07-30 12:34:58 +08:00
|
|
|
fprintf (f, " (TTE %lu)", (unsigned long) value);
|
2002-11-06 21:26:29 +08:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case 2:
|
|
|
|
fprintf (f, "pointer (0x%x) to ", type);
|
|
|
|
bfd_sym_print_type_information (abfd, f, buf, len, offset, &offset);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 3:
|
|
|
|
{
|
2005-02-20 22:59:07 +08:00
|
|
|
long value;
|
2002-11-06 21:26:29 +08:00
|
|
|
|
|
|
|
fprintf (f, "scalar (0x%x) of ", type);
|
|
|
|
bfd_sym_print_type_information (abfd, f, buf, len, offset, &offset);
|
|
|
|
bfd_sym_fetch_long (buf, len, offset, &offset, &value);
|
2005-02-20 22:59:07 +08:00
|
|
|
fprintf (f, " (%lu)", (unsigned long) value);
|
2002-11-06 21:26:29 +08:00
|
|
|
break;
|
|
|
|
}
|
2002-11-12 23:44:24 +08:00
|
|
|
|
2002-11-06 21:26:29 +08:00
|
|
|
case 5:
|
|
|
|
{
|
2005-02-20 22:59:07 +08:00
|
|
|
long lower, upper, nelem;
|
|
|
|
int i;
|
2002-11-06 21:26:29 +08:00
|
|
|
|
|
|
|
fprintf (f, "enumeration (0x%x) of ", type);
|
|
|
|
bfd_sym_print_type_information (abfd, f, buf, len, offset, &offset);
|
2002-11-12 23:44:24 +08:00
|
|
|
bfd_sym_fetch_long (buf, len, offset, &offset, &lower);
|
|
|
|
bfd_sym_fetch_long (buf, len, offset, &offset, &upper);
|
|
|
|
bfd_sym_fetch_long (buf, len, offset, &offset, &nelem);
|
2005-02-20 22:59:07 +08:00
|
|
|
fprintf (f, " from %lu to %lu with %lu elements: ",
|
|
|
|
(unsigned long) lower, (unsigned long) upper,
|
|
|
|
(unsigned long) nelem);
|
2002-11-06 21:26:29 +08:00
|
|
|
|
|
|
|
for (i = 0; i < nelem; i++)
|
|
|
|
{
|
|
|
|
fprintf (f, "\n ");
|
|
|
|
bfd_sym_print_type_information (abfd, f, buf, len, offset, &offset);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case 6:
|
|
|
|
fprintf (f, "vector (0x%x)", type);
|
|
|
|
fprintf (f, "\n index ");
|
|
|
|
bfd_sym_print_type_information (abfd, f, buf, len, offset, &offset);
|
|
|
|
fprintf (f, "\n target ");
|
|
|
|
bfd_sym_print_type_information (abfd, f, buf, len, offset, &offset);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 7:
|
|
|
|
case 8:
|
|
|
|
{
|
|
|
|
long nrec, eloff, i;
|
|
|
|
|
|
|
|
if ((type & 0x3f) == 7)
|
|
|
|
fprintf (f, "record (0x%x) of ", type);
|
|
|
|
else
|
|
|
|
fprintf (f, "union (0x%x) of ", type);
|
2002-11-12 23:44:24 +08:00
|
|
|
|
|
|
|
bfd_sym_fetch_long (buf, len, offset, &offset, &nrec);
|
2008-07-30 12:34:58 +08:00
|
|
|
fprintf (f, "%lu elements: ", (unsigned long) nrec);
|
2002-11-06 21:26:29 +08:00
|
|
|
|
|
|
|
for (i = 0; i < nrec; i++)
|
|
|
|
{
|
2002-11-12 23:44:24 +08:00
|
|
|
bfd_sym_fetch_long (buf, len, offset, &offset, &eloff);
|
2002-11-06 21:26:29 +08:00
|
|
|
fprintf (f, "\n ");
|
2008-07-30 12:34:58 +08:00
|
|
|
fprintf (f, "offset %lu: ", (unsigned long) eloff);
|
2002-11-06 21:26:29 +08:00
|
|
|
bfd_sym_print_type_information (abfd, f, buf, len, offset, &offset);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case 9:
|
|
|
|
fprintf (f, "subrange (0x%x) of ", type);
|
|
|
|
bfd_sym_print_type_information (abfd, f, buf, len, offset, &offset);
|
|
|
|
fprintf (f, " lower ");
|
|
|
|
bfd_sym_print_type_information (abfd, f, buf, len, offset, &offset);
|
|
|
|
fprintf (f, " upper ");
|
|
|
|
bfd_sym_print_type_information (abfd, f, buf, len, offset, &offset);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 11:
|
|
|
|
{
|
|
|
|
long value;
|
|
|
|
|
|
|
|
fprintf (f, "named type (0x%x) ", type);
|
2002-11-12 23:44:24 +08:00
|
|
|
bfd_sym_fetch_long (buf, len, offset, &offset, &value);
|
2002-11-06 21:26:29 +08:00
|
|
|
if (value <= 0)
|
|
|
|
fprintf (f, "[INVALID]");
|
|
|
|
else
|
2002-11-12 23:44:24 +08:00
|
|
|
fprintf (f, "\"%.*s\"",
|
2002-11-06 21:26:29 +08:00
|
|
|
bfd_sym_symbol_name (abfd, value)[0],
|
|
|
|
&bfd_sym_symbol_name (abfd, value)[1]);
|
|
|
|
|
2008-07-30 12:34:58 +08:00
|
|
|
fprintf (f, " (NTE %lu) with type ", (unsigned long) value);
|
2002-11-06 21:26:29 +08:00
|
|
|
bfd_sym_print_type_information (abfd, f, buf, len, offset, &offset);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
default:
|
|
|
|
fprintf (f, "%s (0x%x)", bfd_sym_type_operator_name (type), type);
|
|
|
|
break;
|
|
|
|
}
|
2002-11-12 23:44:24 +08:00
|
|
|
|
2002-11-06 21:26:29 +08:00
|
|
|
if (type == (0x40 | 0x6))
|
|
|
|
{
|
|
|
|
/* Vector. */
|
|
|
|
long n, width, m;
|
|
|
|
long l;
|
|
|
|
long i;
|
|
|
|
|
2002-11-12 23:44:24 +08:00
|
|
|
bfd_sym_fetch_long (buf, len, offset, &offset, &n);
|
|
|
|
bfd_sym_fetch_long (buf, len, offset, &offset, &width);
|
|
|
|
bfd_sym_fetch_long (buf, len, offset, &offset, &m);
|
2002-11-06 21:26:29 +08:00
|
|
|
/* fprintf (f, "\n "); */
|
|
|
|
fprintf (f, " N %ld, width %ld, M %ld, ", n, width, m);
|
|
|
|
for (i = 0; i < m; i++)
|
|
|
|
{
|
2002-11-12 23:44:24 +08:00
|
|
|
bfd_sym_fetch_long (buf, len, offset, &offset, &l);
|
2002-11-06 21:26:29 +08:00
|
|
|
if (i != 0)
|
|
|
|
fprintf (f, " ");
|
|
|
|
fprintf (f, "%ld", l);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (type & 0x40)
|
|
|
|
{
|
|
|
|
/* Other packed type. */
|
|
|
|
long msb, lsb;
|
|
|
|
|
2002-11-12 23:44:24 +08:00
|
|
|
bfd_sym_fetch_long (buf, len, offset, &offset, &msb);
|
|
|
|
bfd_sym_fetch_long (buf, len, offset, &offset, &lsb);
|
2002-11-06 21:26:29 +08:00
|
|
|
/* fprintf (f, "\n "); */
|
|
|
|
fprintf (f, " msb %ld, lsb %ld", msb, lsb);
|
|
|
|
}
|
|
|
|
|
|
|
|
fprintf (f, "]");
|
|
|
|
|
|
|
|
if (offsetptr != NULL)
|
|
|
|
*offsetptr = offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2005-04-11 16:23:05 +08:00
|
|
|
bfd_sym_print_type_information_table_entry (bfd *abfd,
|
|
|
|
FILE *f,
|
|
|
|
bfd_sym_type_information_table_entry *entry)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
|
|
|
unsigned char *buf;
|
|
|
|
unsigned long offset;
|
|
|
|
unsigned int i;
|
|
|
|
|
|
|
|
fprintf (f, "\"%.*s\" (NTE %lu), %lu bytes at %lu, logical size %lu",
|
|
|
|
bfd_sym_symbol_name (abfd, entry->nte_index)[0],
|
|
|
|
&bfd_sym_symbol_name (abfd, entry->nte_index)[1],
|
|
|
|
entry->nte_index,
|
|
|
|
entry->physical_size, entry->offset, entry->logical_size);
|
|
|
|
|
2002-11-12 23:44:24 +08:00
|
|
|
fprintf (f, "\n ");
|
2002-11-06 21:26:29 +08:00
|
|
|
|
_bfd_alloc_and_read
This patch provides two new inline functions that are then used in
places that allocate memory, read from file, and then deallocate on a
read failure.
* libbfd-in.h (_bfd_alloc_and_read, _bfd_malloc_and_read): New.
* aoutx.h (aout_get_external_symbols): Replace calls to
bfd_[m]alloc and bfd_bread with call to _bfd_[m]alloc_and_read.
(slurp_reloc_table): Likewise.
* archive.c (do_slurp_bsd_armap): Likewise.
(do_slurp_coff_armap): Likewise.
* archive64.c (_bfd_archive_64_bit_slurp_armap): Likewise.
* coff-rs6000.c (_bfd_xcoff_slurp_armap): Likewise.
* coff64-rs6000.c (xcoff64_slurp_armap): Likewise.
* coffcode.h (coff_set_arch_mach_hook, buy_and_read): Likewise.
* coffgen.c (coff_real_object_p, coff_object_p, build_debug_section),
(_bfd_coff_get_external_symbols): Likewise.
* ecoff.c (ecoff_slurp_symbolic_header),
(_bfd_ecoff_slurp_symbolic_info, ecoff_slurp_reloc_table),
(_bfd_ecoff_slurp_armap, ecoff_link_add_object_symbols, READ),
(ecoff_indirect_link_order): Likewise.
* elf.c (bfd_elf_get_str_section, setup_group, elf_read_notes),
(_bfd_elf_slurp_version_tables): Likewise.
* elf32-m32c.c (m32c_elf_relax_section): Likewise.
* elf32-rl78.c (rl78_elf_relax_section): Likewise.
* elf32-rx.c (elf32_rx_relax_section): Likewise.
* elf64-alpha.c (READ): Likewise.
* elf64-mips.c (mips_elf64_slurp_one_reloc_table): Likewise.
* elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Likewise.
* elfcode.h (elf_slurp_symbol_table),
(elf_slurp_reloc_table_from_section): Likewise.
* elflink.c (elf_link_add_object_symbols),
(elf_link_check_versioned_symbol): Likewise.
* elfxx-mips.c (READ): Likewise.
* i386lynx.c (slurp_reloc_table): Likewise.
* lynx-core.c (lynx_core_file_p): Likewise.
* mach-o.c (bfd_mach_o_canonicalize_relocs),
(bfd_mach_o_read_symtab_strtab, bfd_mach_o_alloc_and_read),
(bfd_mach_o_read_prebound_dylib, bfd_mach_o_read_dyld_content
* pdp11.c (aout_get_external_symbols, slurp_reloc_table
* pef.c (bfd_pef_print_loader_section, bfd_pef_scan_start_address),
(bfd_pef_parse_symbols): Likewise.
* peicode.h (pe_ILF_object_p, pe_bfd_object_p
* som.c (setup_sections, som_slurp_string_table),
(som_slurp_reloc_table, som_bfd_count_ar_symbols),
(som_bfd_fill_in_ar_symbols): Likewise.
* vms-alpha.c (module_find_nearest_line, evax_bfd_print_dst),
(evax_bfd_print_image): Likewise.
* vms-lib.c (_bfd_vms_lib_archive_p): Likewise.
* wasm-module.c (wasm_scan): Likewise.
* xcofflink.c (xcoff_link_add_symbols): Likewise.
* xsym.c (bfd_sym_read_name_table),
(bfd_sym_print_type_information_table_entry): Likewise.
* libbfd.h: Regenerate.
2020-02-19 10:46:01 +08:00
|
|
|
if (bfd_seek (abfd, entry->offset, SEEK_SET) != 0
|
|
|
|
|| (buf = _bfd_malloc_and_read (abfd, entry->physical_size,
|
|
|
|
entry->physical_size)) == NULL)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
|
|
|
fprintf (f, "[ERROR]\n");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
fprintf (f, "[");
|
|
|
|
for (i = 0; i < entry->physical_size; i++)
|
|
|
|
{
|
|
|
|
if (i == 0)
|
|
|
|
fprintf (f, "0x%02x", buf[i]);
|
|
|
|
else
|
|
|
|
fprintf (f, " 0x%02x", buf[i]);
|
|
|
|
}
|
|
|
|
|
|
|
|
fprintf (f, "]");
|
2002-11-12 23:44:24 +08:00
|
|
|
fprintf (f, "\n ");
|
2002-11-06 21:26:29 +08:00
|
|
|
|
|
|
|
bfd_sym_print_type_information (abfd, f, buf, entry->physical_size, 0, &offset);
|
|
|
|
|
|
|
|
if (offset != entry->physical_size)
|
2005-04-11 16:23:05 +08:00
|
|
|
fprintf (f, "\n [parser used %lu bytes instead of %lu]", offset, entry->physical_size);
|
2016-03-22 00:31:46 +08:00
|
|
|
free (buf);
|
2005-04-11 16:23:05 +08:00
|
|
|
}
|
2002-11-06 21:26:29 +08:00
|
|
|
|
|
|
|
void
|
2005-04-11 16:23:05 +08:00
|
|
|
bfd_sym_print_file_references_index_table_entry (bfd *abfd ATTRIBUTE_UNUSED,
|
|
|
|
FILE *f,
|
|
|
|
bfd_sym_file_references_index_table_entry *entry ATTRIBUTE_UNUSED)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
|
|
|
fprintf (f, "[UNIMPLEMENTED]");
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2005-04-11 16:23:05 +08:00
|
|
|
bfd_sym_print_constant_pool_entry (bfd *abfd ATTRIBUTE_UNUSED,
|
|
|
|
FILE *f,
|
|
|
|
bfd_sym_constant_pool_entry *entry ATTRIBUTE_UNUSED)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
|
|
|
fprintf (f, "[UNIMPLEMENTED]");
|
|
|
|
}
|
|
|
|
|
|
|
|
unsigned char *
|
2005-04-11 16:23:05 +08:00
|
|
|
bfd_sym_display_name_table_entry (bfd *abfd,
|
|
|
|
FILE *f,
|
|
|
|
unsigned char *entry)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
2009-12-11 21:42:17 +08:00
|
|
|
unsigned long sym_index;
|
2002-11-06 21:26:29 +08:00
|
|
|
unsigned long offset;
|
|
|
|
bfd_sym_data_struct *sdata = NULL;
|
|
|
|
|
|
|
|
BFD_ASSERT (bfd_sym_valid (abfd));
|
|
|
|
sdata = abfd->tdata.sym_data;
|
2009-12-11 21:42:17 +08:00
|
|
|
sym_index = (entry - sdata->name_table) / 2;
|
2002-11-12 23:44:24 +08:00
|
|
|
|
|
|
|
if (sdata->version >= BFD_SYM_VERSION_3_4 && entry[0] == 255 && entry[1] == 0)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
2002-11-12 23:44:24 +08:00
|
|
|
unsigned short length = bfd_getb16 (entry + 2);
|
2009-12-11 21:42:17 +08:00
|
|
|
fprintf (f, "[%8lu] \"%.*s\"\n", sym_index, length, entry + 4);
|
2002-11-06 21:26:29 +08:00
|
|
|
offset = 2 + length + 1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2002-11-12 23:44:24 +08:00
|
|
|
if (! (entry[0] == 0 || (entry[0] == 1 && entry[1] == '\0')))
|
2009-12-11 21:42:17 +08:00
|
|
|
fprintf (f, "[%8lu] \"%.*s\"\n", sym_index, entry[0], entry + 1);
|
2002-11-06 21:26:29 +08:00
|
|
|
|
|
|
|
if (sdata->version >= BFD_SYM_VERSION_3_4)
|
|
|
|
offset = entry[0] + 2;
|
|
|
|
else
|
|
|
|
offset = entry[0] + 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
return (entry + offset + (offset % 2));
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2005-04-11 16:23:05 +08:00
|
|
|
bfd_sym_display_name_table (bfd *abfd, FILE *f)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
|
|
|
unsigned long name_table_len;
|
|
|
|
unsigned char *name_table, *name_table_end, *cur;
|
|
|
|
bfd_sym_data_struct *sdata = NULL;
|
|
|
|
|
|
|
|
BFD_ASSERT (bfd_sym_valid (abfd));
|
|
|
|
sdata = abfd->tdata.sym_data;
|
|
|
|
|
|
|
|
name_table_len = sdata->header.dshb_nte.dti_page_count * sdata->header.dshb_page_size;
|
|
|
|
name_table = sdata->name_table;
|
|
|
|
name_table_end = name_table + name_table_len;
|
2002-11-12 23:44:24 +08:00
|
|
|
|
2002-11-06 21:26:29 +08:00
|
|
|
fprintf (f, "name table (NTE) contains %lu bytes:\n\n", name_table_len);
|
2002-11-12 23:44:24 +08:00
|
|
|
|
2002-11-06 21:26:29 +08:00
|
|
|
cur = name_table;
|
|
|
|
for (;;)
|
|
|
|
{
|
|
|
|
cur = bfd_sym_display_name_table_entry (abfd, f, cur);
|
|
|
|
if (cur >= name_table_end)
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2005-04-11 16:23:05 +08:00
|
|
|
bfd_sym_display_resources_table (bfd *abfd, FILE *f)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
|
|
|
unsigned long i;
|
|
|
|
bfd_sym_resources_table_entry entry;
|
|
|
|
bfd_sym_data_struct *sdata = NULL;
|
|
|
|
|
|
|
|
BFD_ASSERT (bfd_sym_valid (abfd));
|
|
|
|
sdata = abfd->tdata.sym_data;
|
|
|
|
|
|
|
|
fprintf (f, "resource table (RTE) contains %lu objects:\n\n",
|
|
|
|
sdata->header.dshb_rte.dti_object_count);
|
2002-11-12 23:44:24 +08:00
|
|
|
|
2002-11-06 21:26:29 +08:00
|
|
|
for (i = 1; i <= sdata->header.dshb_rte.dti_object_count; i++)
|
|
|
|
{
|
|
|
|
if (bfd_sym_fetch_resources_table_entry (abfd, &entry, i) < 0)
|
|
|
|
fprintf (f, " [%8lu] [INVALID]\n", i);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
fprintf (f, " [%8lu] ", i);
|
|
|
|
bfd_sym_print_resources_table_entry (abfd, f, &entry);
|
|
|
|
fprintf (f, "\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2005-04-11 16:23:05 +08:00
|
|
|
bfd_sym_display_modules_table (bfd *abfd, FILE *f)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
|
|
|
unsigned long i;
|
|
|
|
bfd_sym_modules_table_entry entry;
|
|
|
|
bfd_sym_data_struct *sdata = NULL;
|
|
|
|
|
|
|
|
BFD_ASSERT (bfd_sym_valid (abfd));
|
|
|
|
sdata = abfd->tdata.sym_data;
|
|
|
|
|
|
|
|
fprintf (f, "module table (MTE) contains %lu objects:\n\n",
|
|
|
|
sdata->header.dshb_mte.dti_object_count);
|
|
|
|
|
|
|
|
for (i = 1; i <= sdata->header.dshb_mte.dti_object_count; i++)
|
|
|
|
{
|
|
|
|
if (bfd_sym_fetch_modules_table_entry (abfd, &entry, i) < 0)
|
|
|
|
fprintf (f, " [%8lu] [INVALID]\n", i);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
fprintf (f, " [%8lu] ", i);
|
|
|
|
bfd_sym_print_modules_table_entry (abfd, f, &entry);
|
|
|
|
fprintf (f, "\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2005-04-11 16:23:05 +08:00
|
|
|
bfd_sym_display_file_references_table (bfd *abfd, FILE *f)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
|
|
|
unsigned long i;
|
|
|
|
bfd_sym_file_references_table_entry entry;
|
|
|
|
bfd_sym_data_struct *sdata = NULL;
|
|
|
|
|
|
|
|
BFD_ASSERT (bfd_sym_valid (abfd));
|
|
|
|
sdata = abfd->tdata.sym_data;
|
|
|
|
|
|
|
|
fprintf (f, "file reference table (FRTE) contains %lu objects:\n\n",
|
|
|
|
sdata->header.dshb_frte.dti_object_count);
|
|
|
|
|
|
|
|
for (i = 1; i <= sdata->header.dshb_frte.dti_object_count; i++)
|
|
|
|
{
|
|
|
|
if (bfd_sym_fetch_file_references_table_entry (abfd, &entry, i) < 0)
|
|
|
|
fprintf (f, " [%8lu] [INVALID]\n", i);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
fprintf (f, " [%8lu] ", i);
|
|
|
|
bfd_sym_print_file_references_table_entry (abfd, f, &entry);
|
|
|
|
fprintf (f, "\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2005-04-11 16:23:05 +08:00
|
|
|
bfd_sym_display_contained_modules_table (bfd *abfd, FILE *f)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
|
|
|
unsigned long i;
|
2002-11-12 23:44:24 +08:00
|
|
|
bfd_sym_contained_modules_table_entry entry;
|
2002-11-06 21:26:29 +08:00
|
|
|
bfd_sym_data_struct *sdata = NULL;
|
|
|
|
|
|
|
|
BFD_ASSERT (bfd_sym_valid (abfd));
|
|
|
|
sdata = abfd->tdata.sym_data;
|
|
|
|
|
|
|
|
fprintf (f, "contained modules table (CMTE) contains %lu objects:\n\n",
|
|
|
|
sdata->header.dshb_cmte.dti_object_count);
|
2002-11-12 23:44:24 +08:00
|
|
|
|
2002-11-06 21:26:29 +08:00
|
|
|
for (i = 1; i <= sdata->header.dshb_cmte.dti_object_count; i++)
|
|
|
|
{
|
|
|
|
if (bfd_sym_fetch_contained_modules_table_entry (abfd, &entry, i) < 0)
|
|
|
|
fprintf (f, " [%8lu] [INVALID]\n", i);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
fprintf (f, " [%8lu] ", i);
|
|
|
|
bfd_sym_print_contained_modules_table_entry (abfd, f, &entry);
|
|
|
|
fprintf (f, "\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2005-04-11 16:23:05 +08:00
|
|
|
bfd_sym_display_contained_variables_table (bfd *abfd, FILE *f)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
|
|
|
unsigned long i;
|
|
|
|
bfd_sym_contained_variables_table_entry entry;
|
|
|
|
bfd_sym_data_struct *sdata = NULL;
|
|
|
|
|
|
|
|
BFD_ASSERT (bfd_sym_valid (abfd));
|
|
|
|
sdata = abfd->tdata.sym_data;
|
|
|
|
|
|
|
|
fprintf (f, "contained variables table (CVTE) contains %lu objects:\n\n",
|
|
|
|
sdata->header.dshb_cvte.dti_object_count);
|
2002-11-12 23:44:24 +08:00
|
|
|
|
2002-11-06 21:26:29 +08:00
|
|
|
for (i = 1; i <= sdata->header.dshb_cvte.dti_object_count; i++)
|
|
|
|
{
|
|
|
|
if (bfd_sym_fetch_contained_variables_table_entry (abfd, &entry, i) < 0)
|
|
|
|
fprintf (f, " [%8lu] [INVALID]\n", i);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
fprintf (f, " [%8lu] ", i);
|
|
|
|
bfd_sym_print_contained_variables_table_entry (abfd, f, &entry);
|
|
|
|
fprintf (f, "\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fprintf (f, "\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2005-04-11 16:23:05 +08:00
|
|
|
bfd_sym_display_contained_statements_table (bfd *abfd, FILE *f)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
|
|
|
unsigned long i;
|
2002-11-12 23:44:24 +08:00
|
|
|
bfd_sym_contained_statements_table_entry entry;
|
2002-11-06 21:26:29 +08:00
|
|
|
bfd_sym_data_struct *sdata = NULL;
|
|
|
|
|
|
|
|
BFD_ASSERT (bfd_sym_valid (abfd));
|
|
|
|
sdata = abfd->tdata.sym_data;
|
|
|
|
|
|
|
|
fprintf (f, "contained statements table (CSNTE) contains %lu objects:\n\n",
|
|
|
|
sdata->header.dshb_csnte.dti_object_count);
|
2002-11-12 23:44:24 +08:00
|
|
|
|
2002-11-06 21:26:29 +08:00
|
|
|
for (i = 1; i <= sdata->header.dshb_csnte.dti_object_count; i++)
|
|
|
|
{
|
|
|
|
if (bfd_sym_fetch_contained_statements_table_entry (abfd, &entry, i) < 0)
|
|
|
|
fprintf (f, " [%8lu] [INVALID]\n", i);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
fprintf (f, " [%8lu] ", i);
|
|
|
|
bfd_sym_print_contained_statements_table_entry (abfd, f, &entry);
|
|
|
|
fprintf (f, "\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2005-04-11 16:23:05 +08:00
|
|
|
bfd_sym_display_contained_labels_table (bfd *abfd, FILE *f)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
|
|
|
unsigned long i;
|
|
|
|
bfd_sym_contained_labels_table_entry entry;
|
|
|
|
bfd_sym_data_struct *sdata = NULL;
|
|
|
|
|
|
|
|
BFD_ASSERT (bfd_sym_valid (abfd));
|
|
|
|
sdata = abfd->tdata.sym_data;
|
|
|
|
|
|
|
|
fprintf (f, "contained labels table (CLTE) contains %lu objects:\n\n",
|
|
|
|
sdata->header.dshb_clte.dti_object_count);
|
2002-11-12 23:44:24 +08:00
|
|
|
|
2002-11-06 21:26:29 +08:00
|
|
|
for (i = 1; i <= sdata->header.dshb_clte.dti_object_count; i++)
|
|
|
|
{
|
|
|
|
if (bfd_sym_fetch_contained_labels_table_entry (abfd, &entry, i) < 0)
|
|
|
|
fprintf (f, " [%8lu] [INVALID]\n", i);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
fprintf (f, " [%8lu] ", i);
|
|
|
|
bfd_sym_print_contained_labels_table_entry (abfd, f, &entry);
|
|
|
|
fprintf (f, "\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2005-04-11 16:23:05 +08:00
|
|
|
bfd_sym_display_contained_types_table (bfd *abfd, FILE *f)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
|
|
|
unsigned long i;
|
2002-11-12 23:44:24 +08:00
|
|
|
bfd_sym_contained_types_table_entry entry;
|
2002-11-06 21:26:29 +08:00
|
|
|
bfd_sym_data_struct *sdata = NULL;
|
|
|
|
|
|
|
|
BFD_ASSERT (bfd_sym_valid (abfd));
|
|
|
|
sdata = abfd->tdata.sym_data;
|
|
|
|
|
|
|
|
fprintf (f, "contained types table (CTTE) contains %lu objects:\n\n",
|
|
|
|
sdata->header.dshb_ctte.dti_object_count);
|
2002-11-12 23:44:24 +08:00
|
|
|
|
2002-11-06 21:26:29 +08:00
|
|
|
for (i = 1; i <= sdata->header.dshb_ctte.dti_object_count; i++)
|
|
|
|
{
|
|
|
|
if (bfd_sym_fetch_contained_types_table_entry (abfd, &entry, i) < 0)
|
|
|
|
fprintf (f, " [%8lu] [INVALID]\n", i);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
fprintf (f, " [%8lu] ", i);
|
|
|
|
bfd_sym_print_contained_types_table_entry (abfd, f, &entry);
|
|
|
|
fprintf (f, "\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2005-04-11 16:23:05 +08:00
|
|
|
bfd_sym_display_file_references_index_table (bfd *abfd, FILE *f)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
|
|
|
unsigned long i;
|
2002-11-12 23:44:24 +08:00
|
|
|
bfd_sym_file_references_index_table_entry entry;
|
2002-11-06 21:26:29 +08:00
|
|
|
bfd_sym_data_struct *sdata = NULL;
|
|
|
|
|
|
|
|
BFD_ASSERT (bfd_sym_valid (abfd));
|
|
|
|
sdata = abfd->tdata.sym_data;
|
|
|
|
|
|
|
|
fprintf (f, "file references index table (FITE) contains %lu objects:\n\n",
|
|
|
|
sdata->header.dshb_fite.dti_object_count);
|
2002-11-12 23:44:24 +08:00
|
|
|
|
2002-11-06 21:26:29 +08:00
|
|
|
for (i = 1; i <= sdata->header.dshb_fite.dti_object_count; i++)
|
|
|
|
{
|
|
|
|
if (bfd_sym_fetch_file_references_index_table_entry (abfd, &entry, i) < 0)
|
|
|
|
fprintf (f, " [%8lu] [INVALID]\n", i);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
fprintf (f, " [%8lu] ", i);
|
|
|
|
bfd_sym_print_file_references_index_table_entry (abfd, f, &entry);
|
|
|
|
fprintf (f, "\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2005-04-11 16:23:05 +08:00
|
|
|
bfd_sym_display_constant_pool (bfd *abfd, FILE *f)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
|
|
|
unsigned long i;
|
2002-11-12 23:44:24 +08:00
|
|
|
bfd_sym_constant_pool_entry entry;
|
2002-11-06 21:26:29 +08:00
|
|
|
bfd_sym_data_struct *sdata = NULL;
|
|
|
|
|
|
|
|
BFD_ASSERT (bfd_sym_valid (abfd));
|
|
|
|
sdata = abfd->tdata.sym_data;
|
|
|
|
|
|
|
|
fprintf (f, "constant pool (CONST) contains %lu objects:\n\n",
|
|
|
|
sdata->header.dshb_const.dti_object_count);
|
2002-11-12 23:44:24 +08:00
|
|
|
|
2002-11-06 21:26:29 +08:00
|
|
|
for (i = 1; i <= sdata->header.dshb_const.dti_object_count; i++)
|
|
|
|
{
|
|
|
|
if (bfd_sym_fetch_constant_pool_entry (abfd, &entry, i) < 0)
|
|
|
|
fprintf (f, " [%8lu] [INVALID]\n", i);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
fprintf (f, " [%8lu] ", i);
|
|
|
|
bfd_sym_print_constant_pool_entry (abfd, f, &entry);
|
|
|
|
fprintf (f, "\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2005-04-11 16:23:05 +08:00
|
|
|
bfd_sym_display_type_information_table (bfd *abfd, FILE *f)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
|
|
|
unsigned long i;
|
2009-12-11 21:42:17 +08:00
|
|
|
bfd_sym_type_table_entry sym_index;
|
2002-11-12 23:44:24 +08:00
|
|
|
bfd_sym_type_information_table_entry entry;
|
2002-11-06 21:26:29 +08:00
|
|
|
bfd_sym_data_struct *sdata = NULL;
|
|
|
|
|
|
|
|
BFD_ASSERT (bfd_sym_valid (abfd));
|
|
|
|
sdata = abfd->tdata.sym_data;
|
|
|
|
|
|
|
|
if (sdata->header.dshb_tte.dti_object_count > 99)
|
|
|
|
fprintf (f, "type table (TINFO) contains %lu objects:\n\n",
|
|
|
|
sdata->header.dshb_tte.dti_object_count - 99);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
fprintf (f, "type table (TINFO) contains [INVALID] objects:\n\n");
|
|
|
|
return;
|
|
|
|
}
|
2002-11-12 23:44:24 +08:00
|
|
|
|
2002-11-06 21:26:29 +08:00
|
|
|
for (i = 100; i <= sdata->header.dshb_tte.dti_object_count; i++)
|
|
|
|
{
|
2009-12-11 21:42:17 +08:00
|
|
|
if (bfd_sym_fetch_type_table_entry (abfd, &sym_index, i - 100) < 0)
|
2002-11-06 21:26:29 +08:00
|
|
|
fprintf (f, " [%8lu] [INVALID]\n", i);
|
|
|
|
else
|
|
|
|
{
|
2009-12-11 21:42:17 +08:00
|
|
|
fprintf (f, " [%8lu] (TINFO %lu) ", i, sym_index);
|
2002-11-06 21:26:29 +08:00
|
|
|
|
2009-12-11 21:42:17 +08:00
|
|
|
if (bfd_sym_fetch_type_information_table_entry (abfd, &entry, sym_index) < 0)
|
2002-11-06 21:26:29 +08:00
|
|
|
fprintf (f, "[INVALID]");
|
|
|
|
else
|
|
|
|
bfd_sym_print_type_information_table_entry (abfd, f, &entry);
|
|
|
|
|
|
|
|
fprintf (f, "\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-11-12 23:44:24 +08:00
|
|
|
int
|
2005-04-11 16:23:05 +08:00
|
|
|
bfd_sym_scan (bfd *abfd, bfd_sym_version version, bfd_sym_data_struct *mdata)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
|
|
|
asection *bfdsec;
|
|
|
|
const char *name = "symbols";
|
|
|
|
|
|
|
|
mdata->name_table = 0;
|
|
|
|
mdata->sbfd = abfd;
|
2002-11-12 23:44:24 +08:00
|
|
|
mdata->version = version;
|
2002-11-06 21:26:29 +08:00
|
|
|
|
|
|
|
bfd_seek (abfd, 0, SEEK_SET);
|
|
|
|
if (bfd_sym_read_header (abfd, &mdata->header, mdata->version) != 0)
|
2002-11-12 23:44:24 +08:00
|
|
|
return -1;
|
2002-11-06 21:26:29 +08:00
|
|
|
|
|
|
|
mdata->name_table = bfd_sym_read_name_table (abfd, &mdata->header);
|
|
|
|
if (mdata->name_table == NULL)
|
2002-11-12 23:44:24 +08:00
|
|
|
return -1;
|
2002-11-06 21:26:29 +08:00
|
|
|
|
2006-06-01 11:45:58 +08:00
|
|
|
bfdsec = bfd_make_section_anyway_with_flags (abfd, name, SEC_HAS_CONTENTS);
|
2002-11-06 21:26:29 +08:00
|
|
|
if (bfdsec == NULL)
|
2002-11-12 23:44:24 +08:00
|
|
|
return -1;
|
|
|
|
|
2002-11-06 21:26:29 +08:00
|
|
|
bfdsec->vma = 0;
|
|
|
|
bfdsec->lma = 0;
|
bfd/
* section.c (struct sec): Rename "_cooked_size" to "size".
Rename "_raw_size" to "rawsize".
(STD_SECTION): Adjust comments.
(bfd_set_section_size, bfd_get_section_contents): Use size.
(bfd_malloc_and_get_section): New function.
* bfd-in.h (bfd_section_size, bfd_get_section_size): Use size.
* coff-sh.c (sh_relax_section): Alloc coff_section_data struct early.
Correctly free reloc and contents memory.
* elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Delete FIXME
and fake CIE now that we can shink section size to zero.
(_bfd_elf_write_section_eh_frame): Likewise..
* elf32-ppc.c (ppc_elf_relax_section): Delay reading section contents.
* elf-m10300.c (mn10300_elf_final_link_relocate): Don't use
_bfd_stab_section_offset. Use _bfd_elf_section_offset.
* stabs.c (_bfd_stab_section_offset_): Remove unused args and
unneeded indirection.
* elf.c (_bfd_elf_section_offset): .. and update call.
* libbfd-in.h (_bfd_stab_section_offset): Update prototype.
* libbfd.h: Regenerate.
* bfd-in2.h: Regenerate.
Replace occurrences of "_raw_size" and "_cooked_size" in most places
with "size". Set new "rawsize" for stabs, eh_frame, and SEC_MERGE
sections. Use "rawsize", if non-zero, for bfd_get_section_contents
calls if the section might be a stabs, eh_frame, or SEC_MERGE section.
Similarly use "rawsize", if non-zero, in reloc functions to validate
reloc addresses. Use new bfd_malloc_and_get_section in most places
where bfd_get_section_contents was called. Expand all occurrences of
bfd_section_size and bfd_get_section_size. Rename "raw_size" var in
grok_prstatus and similar functions to "size".
* aix386-core.c (aix386_core_file_p): ..
* aix5ppc-core.c (xcoff64_core_p): ..
* aout-adobe.c (aout_adobe_callback, aout_adobe_write_object_contents,
aout_adobe_set_section_contents): ..
* aout-target.h (callback): ..
* aout-tic30.c (tic30_aout_callback, tic30_aout_final_link_relocate,
MY_bfd_final_link): ..
* aoutf1.h (sunos4_core_file_p): ..
* aoutx.h (some_aout_object_p, adjust_o_magic, adjust_z_magic,
adjust_n_magic, adjust_sizes_and_vmas, translate_from_native_sym_flags,
final_link, aout_link_input_section): ..
* binary.c (binary_object_p, binary_canonicalize_symtab,
binary_set_section_contents): ..
* bout.c (b_out_callback, b_out_write_object_contents,
b_out_set_section_contents, b_out_bfd_relax_section,
b_out_bfd_get_relocated_section_contents): ..
* cisco-core.c (cisco_core_file_validate): ..
* coff-alpha.c (alpha_ecoff_object_p,
alpha_ecoff_get_relocated_section_conten, alpha_relocate_section): ..
* coff-arm.c (coff_arm_relocate_section,
bfd_arm_allocate_interworking_sections): ..
* coff-h8300.c (h8300_reloc16_extra_cases,
h8300_bfd_link_add_symbols): ..
* coff-mips.c (mips_refhi_reloc, mips_gprel_reloc): ..
* coff-ppc.c (coff_ppc_relocate_section, ppc_allocate_toc_section,
ppc_bfd_coff_final_link): ..
* coff-rs6000.c (xcoff_reloc_type_br, xcoff_ppc_relocate_section): ..
* coff-sh.c (sh_relax_section, sh_relax_delete_bytes,
sh_align_loads, sh_coff_get_relocated_section_contents): ..
* coff64-rs6000.c (xcoff64_write_object_contents,
xcoff64_reloc_type_br, xcoff64_ppc_relocate_section): ..
* coffcode.h (coff_compute_section_file_positions,
coff_write_object_contents): ..
* coffgen.c (make_a_section_from_file, coff_write_symbols,
coff_section_symbol, build_debug_section): ..
* cofflink.c (coff_link_add_symbols, _bfd_coff_final_link,
process_embedded_commands, _bfd_coff_link_input_bfd,
_bfd_coff_write_global_sym): ..
* cpu-arm.c (bfd_arm_update_notes, bfd_arm_get_mach_from_notes): ..
* cpu-ns32k.c (do_ns32k_reloc, _bfd_ns32k_final_link_relocate): ..
* dwarf1.c (parse_line_table, _bfd_dwarf1_find_nearest_line): ..
* dwarf2.c (read_indirect_string, read_abbrevs, decode_line_info,
_bfd_dwarf2_find_nearest_line): ..
* ecoff.c (bfd_debug_section, ecoff_set_symbol_info,
ecoff_compute_section_file_positions,
_bfd_ecoff_write_object_contents, ecoff_indirect_link_order): ..
* elf-eh-frame.c (_bfd_elf_discard_section_eh_frame,
_bfd_elf_discard_section_eh_frame_hdr,
_bfd_elf_maybe_strip_eh_frame_hdr, _bfd_elf_eh_frame_section_offset,
_bfd_elf_write_section_eh_frame,
_bfd_elf_write_section_eh_frame_hdr): ..
* elf-hppa.h (elf_hppa_sort_unwind): ..
* elf-m10200.c (mn10200_elf_relax_section,
mn10200_elf_relax_delete_bytes,
mn10200_elf_get_relocated_section_contents): ..
* elf-m10300.c (_bfd_mn10300_elf_create_got_section,
mn10300_elf_check_relocs, mn10300_elf_relax_section,
mn10300_elf_relax_delete_bytes,
mn10300_elf_get_relocated_section_contents,
_bfd_mn10300_elf_adjust_dynamic_symbol,
_bfd_mn10300_elf_discard_copies,
_bfd_mn10300_elf_size_dynamic_sections,
_bfd_mn10300_elf_finish_dynamic_sections): ..
* elf.c (_bfd_elf_print_private_bfd_data, bfd_elf_get_bfd_needed_list,
_bfd_elf_make_section_from_phdr, elf_fake_sections,
bfd_elf_set_group_contents, map_sections_to_segments,
elf_sort_sections, assign_file_positions_for_segments,
SECTION_SIZE, copy_private_bfd_data,
_bfd_elf_get_dynamic_reloc_upper_bound,
_bfd_elf_canonicalize_dynamic_reloc, elfcore_maybe_make_sect,
_bfd_elfcore_make_pseudosection, elfcore_grok_prstatus,
elfcore_grok_lwpstatus, elfcore_grok_win32pstatus,
elfcore_grok_note, elfcore_grok_nto_status, elfcore_grok_nto_gregs,
_bfd_elf_rel_local_sym, _bfd_elf_get_synthetic_symtab): ..
* elf32-arm.h (bfd_elf32_arm_allocate_interworking_sect,
bfd_elf32_arm_process_before_allocation,
elf32_arm_adjust_dynamic_symbol, allocate_dynrelocs,
elf32_arm_size_dynamic_sections, elf32_arm_finish_dynamic_sections,
elf32_arm_write_section): ..
* elf32-cris.c (cris_elf_grok_prstatus,
elf_cris_finish_dynamic_sections, cris_elf_gc_sweep_hook,
elf_cris_adjust_gotplt_to_got, elf_cris_adjust_dynamic_symbol,
cris_elf_check_relocs, elf_cris_size_dynamic_sections,
elf_cris_discard_excess_dso_dynamics,
elf_cris_discard_excess_program_dynamics): ..
* elf32-d30v.c (bfd_elf_d30v_reloc, bfd_elf_d30v_reloc_21): ..
* elf32-dlx.c (_bfd_dlx_elf_hi16_reloc): ..
* elf32-frv.c (_frvfdpic_add_dyn_reloc, _frvfdpic_add_rofixup,
_frv_create_got_section, _frvfdpic_assign_plt_entries,
elf32_frvfdpic_size_dynamic_sections,
elf32_frvfdpic_modify_segment_map,
elf32_frvfdpic_finish_dynamic_sections): ..
* elf32-h8300.c (elf32_h8_relax_section, elf32_h8_relax_delete_bytes,
elf32_h8_get_relocated_section_contents): ..
* elf32-hppa.c (hppa_build_one_stub, hppa_size_one_stub,
elf32_hppa_adjust_dynamic_symbol, allocate_plt_static,
allocate_dynrelocs, elf32_hppa_size_dynamic_sections, group_sections,
elf32_hppa_size_stubs, elf32_hppa_set_gp, elf32_hppa_build_stubs,
elf32_hppa_finish_dynamic_sections): ..
* elf32-i370.c (i370_elf_adjust_dynamic_symbol,
i370_elf_size_dynamic_sections, i370_elf_check_relocs,
i370_elf_finish_dynamic_sections): ..
* elf32-i386.c (elf_i386_grok_prstatus, elf_i386_adjust_dynamic_symbol,
allocate_dynrelocs, elf_i386_size_dynamic_sections,
elf_i386_relocate_section, elf_i386_finish_dynamic_sections): ..
* elf32-i860.c (i860_howto_pc26_reloc, i860_howto_pc16_reloc,
i860_howto_highadj_reloc, i860_howto_splitn_reloc): ..
* elf32-ip2k.c (ip2k_is_switch_table_128,
ip2k_relax_switch_table_128, ip2k_is_switch_table_256,
ip2k_relax_switch_table_256, ip2k_elf_relax_section,
adjust_all_relocations, ip2k_elf_relax_delete_bytes): ..
* elf32-m32r.c (m32r_elf_do_10_pcrel_reloc, m32r_elf_hi16_reloc,
m32r_elf_generic_reloc, m32r_elf_adjust_dynamic_symbol,
allocate_dynrelocs, m32r_elf_size_dynamic_sections,
m32r_elf_relocate_section, m32r_elf_finish_dynamic_sections,
m32r_elf_relax_section, m32r_elf_relax_delete_bytes,
m32r_elf_get_relocated_section_contents): ..
* elf32-m68hc11.c (m68hc11_elf_build_one_stub,
m68hc11_elf_size_one_stub, m68hc11_elf_relax_section,
m68hc11_elf_relax_delete_bytes): ..
* elf32-m68hc12.c (m68hc12_elf_build_one_stub,
m68hc12_elf_size_one_stub): ..
* elf32-m68hc1x.c (elf32_m68hc11_size_stubs,
elf32_m68hc11_build_stubs, m68hc11_elf_special_reloc): ..
* elf32-m68k.c (elf_m68k_check_relocs, elf_m68k_gc_sweep_hook,
elf_m68k_adjust_dynamic_symbol, elf_m68k_size_dynamic_sections,
elf_m68k_discard_copies, elf_m68k_finish_dynamic_sections): ..
* elf32-mips.c (gprel32_with_gp, mips16_gprel_reloc,
elf32_mips_grok_prstatus): ..
* elf32-or32.c (or32_elf_consth_reloc): ..
* elf32-ppc.c (ppc_elf_relax_section, ppc_elf_addr16_ha_reloc,
elf_create_pointer_linker_section, ppc_elf_create_linker_section,
ppc_elf_additional_program_headers, ppc_elf_adjust_dynamic_symbol,
allocate_dynrelocs, ppc_elf_size_dynamic_sections,
ppc_elf_finish_dynamic_sections, ppc_elf_grok_prstatus,
ppc_elf_final_write_processing): ..
* elf32-s390.c (s390_elf_ldisp_reloc, elf_s390_adjust_dynamic_symbol,
allocate_dynrelocs, elf_s390_size_dynamic_sections,
elf_s390_finish_dynamic_sections, elf_s390_grok_prstatus): ..
* elf32-sh.c (sh_elf_reloc_loop, sh_elf_relax_section,
sh_elf_relax_delete_bytes, sh_elf_align_loads,
sh_elf_adjust_dynamic_symbol, allocate_dynrelocs,
sh_elf_size_dynamic_sections, sh_elf_get_relocated_section_contents,
sh_elf_finish_dynamic_sections, elf32_shlin_grok_prstatus): ..
* elf32-sh64-com.c (sh64_address_in_cranges,
sh64_get_contents_type): ..
* elf32-sh64.c (sh64_find_section_for_address,
sh64_elf_final_write_processing): ..
* elf32-sparc.c (sparc_elf_wdisp16_reloc, sparc_elf_hix22_reloc,
sparc_elf_lox10_reloc, elf32_sparc_adjust_dynamic_symbol,
allocate_dynrelocs, elf32_sparc_size_dynamic_sections,
elf32_sparc_relocate_section, elf32_sparc_finish_dynamic_sections): ..
* elf32-v850.c (v850_elf_reloc, v850_elf_relax_section): ..
* elf32-vax.c (elf_vax_check_relocs, elf_vax_adjust_dynamic_symbol,
elf_vax_size_dynamic_sections, elf_vax_discard_copies,
elf_vax_instantiate_got_entries, elf_vax_relocate_section,
elf_vax_finish_dynamic_sections): ..
* elf32-xstormy16.c (xstormy16_elf_24_reloc,
xstormy16_elf_check_relocs, xstormy16_relax_plt_check,
xstormy16_elf_relax_section, xstormy16_elf_always_size_sections,
xstormy16_elf_finish_dynamic_sections): ..
* elf32-xtensa.c (xtensa_read_table_entries,
elf_xtensa_allocate_got_size, elf_xtensa_allocate_local_got_size,
elf_xtensa_size_dynamic_sections, elf_xtensa_do_reloc,
bfd_elf_xtensa_reloc, elf_xtensa_relocate_section,
elf_xtensa_combine_prop_entries, elf_xtensa_finish_dynamic_sections,
elf_xtensa_discard_info_for_section, elf_xtensa_grok_prstatus,
get_relocation_opcode, retrieve_contents, find_relaxable_sections,
collect_source_relocs, is_resolvable_asm_expansion, remove_literals,
relax_section, shrink_dynamic_reloc_sections, relax_property_section,
xtensa_callback_required_dependence): ..
* elf64-alpha.c (elf64_alpha_reloc_gpdisp, elf64_alpha_relax_section,
elf64_alpha_check_relocs, elf64_alpha_adjust_dynamic_symbol,
elf64_alpha_calc_got_offsets_for_symbol, elf64_alpha_calc_got_offsets,
elf64_alpha_size_plt_section, elf64_alpha_size_plt_section_1,
elf64_alpha_always_size_sections, elf64_alpha_calc_dynrel_sizes,
elf64_alpha_size_rela_got_section, elf64_alpha_size_rela_got_1,
elf64_alpha_size_dynamic_sections, elf64_alpha_emit_dynrel,
elf64_alpha_finish_dynamic_sections, elf64_alpha_final_link): ..
* elf64-hppa.c (allocate_dynrel_entries,
elf64_hppa_size_dynamic_sections,
elf64_hppa_finish_dynamic_sections): ..
* elf64-mips.c (mips_elf64_gprel32_reloc, mips16_gprel_reloc,
mips_elf64_canonicalize_dynamic_reloc, mips_elf64_slurp_reloc_table,
elf64_mips_grok_prstatus): ..
* elf64-mmix.c (mmix_elf_perform_relocation, mmix_elf_reloc,
mmix_elf_relocate_section, mmix_elf_final_link,
mmix_set_relaxable_size, _bfd_mmix_after_linker_allocation,
mmix_elf_relax_section, mmix_elf_get_section_contents): ..
* elf64-ppc.c (ppc64_elf_object_p, ppc64_elf_grok_prstatus,
ppc64_elf_check_relocs, ppc64_elf_func_desc_adjust,
ppc64_elf_adjust_dynamic_symbol, ppc64_elf_edit_opd,
allocate_dynrelocs, ppc64_elf_size_dynamic_sections,
ppc_build_one_stub, ppc_size_one_stub, ppc64_elf_next_toc_section,
toc_adjusting_stub_needed, group_sections, ppc64_elf_size_stubs,
ppc64_elf_build_stubs, ppc64_elf_relocate_section,
ppc64_elf_finish_dynamic_sections): ..
* elf64-s390.c (s390_elf_ldisp_reloc, elf_s390_adjust_dynamic_symbol,
allocate_dynrelocs, elf_s390_size_dynamic_sections,
elf_s390_finish_dynamic_sections): ..
* elf64-sh64.c (sh_elf64_get_relocated_section_contents,
sh_elf64_check_relocs, sh64_elf64_adjust_dynamic_symbol,
sh64_elf64_discard_copies, sh64_elf64_size_dynamic_sections,
sh64_elf64_finish_dynamic_sections): ..
* elf64-sparc.c (sparc64_elf_slurp_reloc_table, init_insn_reloc,
sparc64_elf_check_relocs, sparc64_elf_adjust_dynamic_symbol,
sparc64_elf_size_dynamic_sections, sparc64_elf_relocate_section,
sparc64_elf_finish_dynamic_symbol,
sparc64_elf_finish_dynamic_sections): ..
* elf64-x86-64.c (elf64_x86_64_grok_prstatus,
elf64_x86_64_adjust_dynamic_symbol, allocate_dynrelocs,
elf64_x86_64_size_dynamic_sections, elf64_x86_64_relocate_section,
elf64_x86_64_finish_dynamic_sections): ..
* elfarm-nabi.c (elf32_arm_nabi_grok_prstatus): ..
* elfcode.h (elf_slurp_reloc_table): ..
* elflink.c (_bfd_elf_create_got_section, elf_add_dt_needed_tag,
elf_finalize_dynstr, elf_link_add_object_symbols,
bfd_elf_size_dynamic_sections, elf_link_sort_relocs,
elf_link_input_bfd, bfd_elf_final_link, bfd_elf_discard_info): ..
* elfn32-mips.c (gprel32_with_gp, mips16_gprel_reloc,
elf32_mips_grok_prstatus): ..
* elfxx-ia64.c (elfNN_ia64_relax_section, allocate_dynrel_entries,
elfNN_ia64_size_dynamic_sections, elfNN_ia64_install_dyn_reloc,
elfNN_ia64_choose_gp, elfNN_ia64_final_link,
elfNN_ia64_finish_dynamic_sections): ..
* elfxx-mips.c (mips_elf_create_procedure_table,
mips_elf_check_mips16_stubs, _bfd_mips_elf_gprel16_with_gp,
_bfd_mips_elf_hi16_reloc, _bfd_mips_elf_generic_reloc,
mips_elf_global_got_index, mips_elf_multi_got,
mips_elf_create_compact_rel_section, mips_elf_calculate_relocation,
mips_elf_allocate_dynamic_relocations,
mips_elf_create_dynamic_relocation, _bfd_mips_elf_fake_sections,
_bfd_mips_relax_section, _bfd_mips_elf_adjust_dynamic_symbol,
_bfd_mips_elf_always_size_sections,
_bfd_mips_elf_size_dynamic_sections,
_bfd_mips_elf_finish_dynamic_symbol,
_bfd_mips_elf_finish_dynamic_sections,
_bfd_mips_elf_modify_segment_map, _bfd_mips_elf_discard_info,
_bfd_mips_elf_write_section, _bfd_mips_elf_set_section_contents,
_bfd_elf_mips_get_relocated_section_contents,
_bfd_mips_elf_final_link, _bfd_mips_elf_merge_private_bfd_data): ..
* hp300hpux.c (callback): ..
* hppabsd-core.c (make_bfd_asection): ..
* hpux-core.c (make_bfd_asection): ..
* i386linux.c (linux_link_create_dynamic_sections,
bfd_i386linux_size_dynamic_sections, linux_finish_dynamic_link): ..
* i386msdos.c (msdos_write_object_contents): ..
* i386os9k.c (os9k_callback, os9k_write_object_contents,
os9k_set_section_contents): ..
* ieee.c (parse_expression, ieee_slurp_external_symbols,
ieee_slurp_sections, ieee_slurp_debug, ieee_slurp_section_data,
ieee_write_section_part, do_with_relocs, do_as_repeat,
do_without_relocs, ieee_write_debug_part, init_for_output,
ieee_set_section_contents): ..
* ihex.c (ihex_scan, ihex_read_section, ihex_get_section_contents): ..
* irix-core.c (do_sections, make_bfd_asection): ..
* libaout.h (aout_section_merge_with_text_p): ..
* libbfd.c (_bfd_generic_get_section_contents,
_bfd_generic_get_section_contents_in_window): ..
* linker.c (default_indirect_link_order): ..
* lynx-core.c (make_bfd_asection): ..
* m68klinux.c (linux_link_create_dynamic_sections,
bfd_m68klinux_size_dynamic_sections, linux_finish_dynamic_link): ..
* mach-o.c (bfd_mach_o_make_bfd_section,
bfd_mach_o_scan_read_dylinker, bfd_mach_o_scan_read_dylib,
bfd_mach_o_scan_read_thread, bfd_mach_o_scan_read_symtab,
bfd_mach_o_scan_read_segment): ..
* merge.c (_bfd_add_merge_section, record_section, merge_strings,
_bfd_merge_sections): ..
* mmo.c (mmo_find_sec_w_addr, mmo_get_spec_section, mmo_get_loc,
mmo_map_set_sizes, mmo_canonicalize_symtab,
mmo_internal_write_section, mmo_write_object_contents): ..
* netbsd-core.c (netbsd_core_file_p): ..
* nlm32-alpha.c (nlm_alpha_read_reloc, nlm_alpha_write_import,
nlm_alpha_set_public_section): ..
* nlm32-ppc.c (nlm_powerpc_read_reloc, nlm_powerpc_write_reloc): ..
* nlm32-sparc.c (nlm_sparc_write_import): ..
* nlmcode.h (add_bfd_section, nlm_swap_auxiliary_headers_in,
nlm_compute_section_file_positions): ..
* oasys.c (oasys_object_p, oasys_slurp_section_data,
oasys_write_sections, oasys_write_data, oasys_set_section_contents): ..
* opncls.c (get_debug_link_info): ..
* osf-core.c (make_bfd_asection): ..
* pdp11.c (some_aout_object_p, adjust_o_magic, adjust_z_magic,
adjust_n_magic, adjust_sizes_and_vmas, squirt_out_relocs,
final_link, aout_link_input_section): ..
* peXXigen.c (_bfd_XXi_swap_sym_in, _bfd_XXi_swap_aouthdr_out,
pe_print_idata, pe_print_edata, pe_print_pdata, pe_print_reloc): ..
* pef.c (bfd_pef_make_bfd_section, bfd_pef_print_loader_section,
bfd_pef_scan_start_address, bfd_pef_parse_symbols): ..
* ppcboot.c (ppcboot_object_p, ppcboot_canonicalize_symtab): ..
* ptrace-core.c (ptrace_unix_core_file_p): ..
* reloc.c (bfd_perform_relocation, bfd_install_relocation,
_bfd_final_link_relocate, bfd_generic_relax_section,
bfd_generic_get_relocated_section_contents): ..
* reloc16.c (bfd_coff_reloc16_relax_section,
bfd_coff_reloc16_get_relocated_section_c): ..
* riscix.c (riscix_some_aout_object_p): ..
* rs6000-core.c (read_hdr, make_bfd_asection): ..
* sco5-core.c (make_bfd_asection): ..
* simple.c (bfd_simple_get_relocated_section_contents): ..
* som.c (som_object_setup, setup_sections, som_prep_headers,
som_write_fixups, som_begin_writing, bfd_section_from_som_symbol,
som_set_reloc_info, som_get_section_contents,
som_bfd_link_split_section): ..
* sparclinux.c (linux_link_create_dynamic_sections,
bfd_sparclinux_size_dynamic_sections, linux_finish_dynamic_link): ..
* srec.c (srec_scan, srec_read_section, srec_get_section_contents): ..
* stabs.c (_bfd_link_section_stabs, _bfd_discard_section_stabs,
_bfd_write_stab_strings, _bfd_stab_section_offset): ..
* sunos.c (sunos_read_dynamic_info, sunos_create_dynamic_sections,
bfd_sunos_size_dynamic_sections, sunos_scan_std_relocs,
sunos_scan_ext_relocs, sunos_scan_dynamic_symbol,
sunos_write_dynamic_symbol, sunos_check_dynamic_reloc,
sunos_finish_dynamic_link): ..
* syms.c (_bfd_stab_section_find_nearest_line): ..
* tekhex.c (first_phase, tekhex_set_section_contents,
tekhex_write_object_contents): ..
* trad-core.c (trad_unix_core_file_p): ..
* versados.c (process_esd, process_otr, process_otr): ..
* vms-gsd.c (_bfd_vms_slurp_gsd, _bfd_vms_write_gsd): ..
* vms-misc.c (add_new_contents): ..
* vms-tir.c (check_section, new_section, _bfd_vms_write_tir): ..
* vms.c (vms_set_section_contents): ..
* xcofflink.c (xcoff_get_section_contents, xcoff_link_add_symbols,
xcoff_sweep, bfd_xcoff_size_dynamic_sections, xcoff_build_ldsyms,
_bfd_xcoff_bfd_final_link, xcoff_link_input_bfd): ..
* xsym.c (bfd_sym_scan): .. See above.
binutils/
* objcopy.c (copy_section): Don't set _cooked_size.
include/
* bfdlink.h (struct bfd_link_order): Update comment.
ld/
* ldlang.c (print_output_section_statement): Don't print size before
relaxation.
(IGNORE_SECTION): Remove bfd arg. Update all callers.
* ldexp.c (fold_name): .. See below.
* ldlang.c (section_already_linked, print_output_section_statement,
print_input_section, insert_pad, size_input_section,
lang_check_section_addresses, lang_size_sections_1,
lang_size_sections, lang_do_assignments_1, lang_set_startof,
lang_one_common, lang_reset_memory_regions, lang_process,
lang_abs_symbol_at_end_of, lang_do_version_exports_section): ..
* ldwrite.c (build_link_order, clone_section, ds, split_sections): ..
* pe-dll.c (process_def_file, generate_reloc): ..
* emultempl/elf32.em (gld${EMULATION_NAME}_find_statement_assignment,
gld${EMULATION_NAME}_before_allocation): ..
* emultempl/mmix-elfnmmo.em (mmix_after_allocation): ..
* emultempl/sh64elf.em (sh64_elf_${EMULATION_NAME}_before_allocation,
sh64_elf_${EMULATION_NAME}_after_allocation): ..
* emultempl/sunos.em (gld${EMULATION_NAME}_before_allocation): ..
* emultempl/xtensaelf.em (ld_assign_relative_paged_dot,
ld_local_file_relocations_fit, ld_xtensa_insert_page_offsets): Use
"size" instead of "_raw_size" and "_cooked_size". Expand
bfd_section_size macro invocations.
2004-06-24 12:46:28 +08:00
|
|
|
bfdsec->size = 0;
|
2002-11-06 21:26:29 +08:00
|
|
|
bfdsec->filepos = 0;
|
|
|
|
bfdsec->alignment_power = 0;
|
2002-11-12 23:44:24 +08:00
|
|
|
|
|
|
|
abfd->tdata.sym_data = mdata;
|
|
|
|
|
|
|
|
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 12:51:09 +08:00
|
|
|
bfd_cleanup
|
2005-04-11 16:23:05 +08:00
|
|
|
bfd_sym_object_p (bfd *abfd)
|
2002-11-12 23:44:24 +08:00
|
|
|
{
|
|
|
|
bfd_sym_version version = -1;
|
2013-01-26 10:08:01 +08:00
|
|
|
bfd_sym_data_struct *mdata;
|
2002-11-12 23:44:24 +08:00
|
|
|
|
|
|
|
bfd_seek (abfd, 0, SEEK_SET);
|
|
|
|
if (bfd_sym_read_version (abfd, &version) != 0)
|
|
|
|
goto wrong;
|
|
|
|
|
2013-01-26 10:08:01 +08:00
|
|
|
mdata = (bfd_sym_data_struct *) bfd_alloc (abfd, sizeof (*mdata));
|
|
|
|
if (mdata == NULL)
|
2002-11-12 23:44:24 +08:00
|
|
|
goto fail;
|
|
|
|
|
2013-01-26 10:08:01 +08:00
|
|
|
if (bfd_sym_scan (abfd, version, mdata) != 0)
|
2002-11-12 23:44:24 +08:00
|
|
|
goto wrong;
|
|
|
|
|
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 12:51:09 +08:00
|
|
|
return _bfd_no_cleanup;
|
2002-11-12 23:44:24 +08:00
|
|
|
|
|
|
|
wrong:
|
|
|
|
bfd_set_error (bfd_error_wrong_format);
|
|
|
|
|
|
|
|
fail:
|
|
|
|
return NULL;
|
2002-11-06 21:26:29 +08:00
|
|
|
}
|
|
|
|
|
2006-11-22 11:33:51 +08:00
|
|
|
#define bfd_sym_make_empty_symbol _bfd_generic_make_empty_symbol
|
2002-11-06 21:26:29 +08:00
|
|
|
|
|
|
|
void
|
2005-04-11 16:23:05 +08:00
|
|
|
bfd_sym_get_symbol_info (bfd *abfd ATTRIBUTE_UNUSED, asymbol *symbol, symbol_info *ret)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
|
|
|
bfd_symbol_info (symbol, ret);
|
|
|
|
}
|
|
|
|
|
|
|
|
long
|
2005-04-11 16:23:05 +08:00
|
|
|
bfd_sym_get_symtab_upper_bound (bfd *abfd ATTRIBUTE_UNUSED)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
long
|
2005-04-11 16:23:05 +08:00
|
|
|
bfd_sym_canonicalize_symtab (bfd *abfd ATTRIBUTE_UNUSED, asymbol **sym ATTRIBUTE_UNUSED)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2006-06-19 21:17:44 +08:00
|
|
|
bfd_sym_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED,
|
|
|
|
struct bfd_link_info *info ATTRIBUTE_UNUSED)
|
2002-11-06 21:26:29 +08:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
const bfd_target sym_vec =
|
|
|
|
{
|
2005-04-11 16:23:05 +08:00
|
|
|
"sym", /* Name. */
|
|
|
|
bfd_target_sym_flavour, /* Flavour. */
|
|
|
|
BFD_ENDIAN_BIG, /* Byteorder. */
|
|
|
|
BFD_ENDIAN_BIG, /* Header byteorder. */
|
|
|
|
(HAS_RELOC | EXEC_P | /* Object flags. */
|
2002-11-06 21:26:29 +08:00
|
|
|
HAS_LINENO | HAS_DEBUG |
|
|
|
|
HAS_SYMS | HAS_LOCALS | DYNAMIC | WP_TEXT | D_PAGED),
|
|
|
|
(SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_CODE | SEC_DATA
|
2005-04-11 16:23:05 +08:00
|
|
|
| SEC_ROM | SEC_HAS_CONTENTS), /* Section_flags. */
|
|
|
|
0, /* Symbol_leading_char. */
|
|
|
|
' ', /* AR_pad_char. */
|
|
|
|
16, /* AR_max_namelen. */
|
* targets.c (bfd_target): Make ar_max_namelen an unsigned char.
Add match_priority.
* configure.in: Bump bfd version.
* elfcode.h (elf_object_p): Delete hacks preventing match of
EM_NONE and ELFOSABI_NONE targets when a better match exists.
* elfxx-target.h (elf_match_priority): Define and use.
* format.c (bfd_check_format_matches): Use target match_priority
to choose best of multiple matching targets. In cases with multiple
matches rerun _bfd_check_format if we don't choose the last match.
* aout-adobe.c, * aout-arm.c, * aout-target.h, * aout-tic30.c,
* binary.c, * bout.c, * coff-alpha.c, * coff-i386.c, * coff-i860.c,
* coff-i960.c, * coff-ia64.c, * coff-mips.c, * coff-or32.c,
* coff-ppc.c, * coff-rs6000.c, * coff-sh.c, * coff-tic30.c,
* coff-tic54x.c, * coff-x86_64.c, * coff64-rs6000.c, * coffcode.h,
* i386msdos.c, * i386os9k.c, * ieee.c, * ihex.c, * mach-o-target.c,
* mipsbsd.c, * mmo.c, * nlm-target.h, * oasys.c, * pdp11.c,
* pe-mips.c, * pef.c, * plugin.c, * ppcboot.c, * som.c, * srec.c,
* tekhex.c, * trad-core.c, * verilog.c, * versados.c, * vms-alpha.c,
* vms-lib.c, * xsym.c: Init match_priority field.
* configure: Regenerate.
* bfd-in2.h: Regenerate.
2011-06-06 09:26:05 +08:00
|
|
|
0, /* match priority. */
|
2021-01-07 22:42:00 +08:00
|
|
|
TARGET_KEEP_UNUSED_SECTION_SYMBOLS, /* keep unused section symbols. */
|
2002-11-06 21:26:29 +08:00
|
|
|
bfd_getb64, bfd_getb_signed_64, bfd_putb64,
|
|
|
|
bfd_getb32, bfd_getb_signed_32, bfd_putb32,
|
2005-04-11 16:23:05 +08:00
|
|
|
bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* Data. */
|
2002-11-06 21:26:29 +08:00
|
|
|
bfd_getb64, bfd_getb_signed_64, bfd_putb64,
|
|
|
|
bfd_getb32, bfd_getb_signed_32, bfd_putb32,
|
2005-04-11 16:23:05 +08:00
|
|
|
bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* Hdrs. */
|
|
|
|
{ /* bfd_check_format. */
|
2002-11-06 21:26:29 +08:00
|
|
|
_bfd_dummy_target,
|
2005-04-11 16:23:05 +08:00
|
|
|
bfd_sym_object_p, /* bfd_check_format. */
|
2002-11-06 21:26:29 +08:00
|
|
|
_bfd_dummy_target,
|
|
|
|
_bfd_dummy_target,
|
|
|
|
},
|
2005-04-11 16:23:05 +08:00
|
|
|
{ /* 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 08:28:06 +08:00
|
|
|
_bfd_bool_bfd_false_error,
|
2002-11-06 21:26:29 +08:00
|
|
|
bfd_sym_mkobject,
|
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 08:28:06 +08:00
|
|
|
_bfd_bool_bfd_false_error,
|
|
|
|
_bfd_bool_bfd_false_error,
|
2002-11-06 21:26:29 +08:00
|
|
|
},
|
2005-04-11 16:23:05 +08:00
|
|
|
{ /* 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 08:28:06 +08:00
|
|
|
_bfd_bool_bfd_false_error,
|
|
|
|
_bfd_bool_bfd_true,
|
|
|
|
_bfd_bool_bfd_false_error,
|
|
|
|
_bfd_bool_bfd_false_error,
|
2002-11-06 21:26:29 +08:00
|
|
|
},
|
|
|
|
|
|
|
|
BFD_JUMP_TABLE_GENERIC (bfd_sym),
|
|
|
|
BFD_JUMP_TABLE_COPY (_bfd_generic),
|
|
|
|
BFD_JUMP_TABLE_CORE (_bfd_nocore),
|
|
|
|
BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive),
|
|
|
|
BFD_JUMP_TABLE_SYMBOLS (bfd_sym),
|
2007-02-15 16:33:53 +08:00
|
|
|
BFD_JUMP_TABLE_RELOCS (_bfd_norelocs),
|
2002-11-06 21:26:29 +08:00
|
|
|
BFD_JUMP_TABLE_WRITE (bfd_sym),
|
|
|
|
BFD_JUMP_TABLE_LINK (bfd_sym),
|
|
|
|
BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
|
|
|
|
|
|
|
|
NULL,
|
2002-11-12 23:44:24 +08:00
|
|
|
|
2002-11-06 21:26:29 +08:00
|
|
|
NULL
|
|
|
|
};
|