1999-05-03 09:29:11 +02:00
|
|
|
/* BFD back-end for MS-DOS executables.
|
2018-01-03 06:17:27 +01:00
|
|
|
Copyright (C) 1990-2018 Free Software Foundation, Inc.
|
1999-05-03 09:29:11 +02:00
|
|
|
Written by Bryan Ford of the University of Utah.
|
|
|
|
|
|
|
|
Contributed by the Center for Software Science at the
|
|
|
|
University of Utah (pa-gdb-bugs@cs.utah.edu).
|
|
|
|
|
|
|
|
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 16:26:43 +02:00
|
|
|
the Free Software Foundation; either version 3 of the License, or
|
1999-05-03 09:29:11 +02: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
|
|
|
|
along with this program; if not, write to the Free Software
|
2007-07-03 16:26:43 +02:00
|
|
|
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
|
|
|
|
MA 02110-1301, USA. */
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
|
|
|
|
#include "sysdep.h"
|
2007-04-26 16:47:00 +02:00
|
|
|
#include "bfd.h"
|
1999-05-03 09:29:11 +02:00
|
|
|
#include "libbfd.h"
|
|
|
|
#include "libaout.h"
|
2018-02-12 14:12:45 +01:00
|
|
|
#include "coff/msdos.h"
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
#define EXE_LOAD_HIGH 0x0000
|
|
|
|
#define EXE_LOAD_LOW 0xffff
|
|
|
|
#define EXE_PAGE_SIZE 512
|
|
|
|
|
2018-02-12 14:12:45 +01:00
|
|
|
static bfd_boolean
|
|
|
|
msdos_mkobject (bfd *abfd)
|
|
|
|
{
|
|
|
|
bfd_default_set_arch_mach (abfd, bfd_arch_i386, bfd_mach_i386_i8086);
|
|
|
|
|
|
|
|
return aout_32_mkobject (abfd);
|
|
|
|
}
|
|
|
|
|
|
|
|
static const bfd_target *
|
|
|
|
msdos_object_p (bfd *abfd)
|
|
|
|
{
|
|
|
|
struct external_DOS_hdr hdr;
|
|
|
|
bfd_byte buffer[2];
|
|
|
|
asection *section;
|
|
|
|
unsigned int size;
|
|
|
|
|
|
|
|
if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0
|
|
|
|
|| bfd_bread (&hdr, (bfd_size_type) sizeof (hdr), abfd) < DOS_HDR_SIZE)
|
|
|
|
{
|
|
|
|
if (bfd_get_error () != bfd_error_system_call)
|
|
|
|
bfd_set_error (bfd_error_wrong_format);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (H_GET_16 (abfd, hdr.e_magic) != IMAGE_DOS_SIGNATURE)
|
|
|
|
{
|
|
|
|
bfd_set_error (bfd_error_wrong_format);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Check that this isn't actually a PE, NE, or LE file. If it is, the
|
|
|
|
e_lfanew field will be valid and point to a header beginning with one of
|
|
|
|
the relevant signatures. If not, e_lfanew might point to anything, so
|
|
|
|
don't bail if we can't read there. */
|
|
|
|
if (H_GET_16 (abfd, hdr.e_cparhdr) < 4
|
|
|
|
|| bfd_seek (abfd, (file_ptr) H_GET_32 (abfd, hdr.e_lfanew), SEEK_SET) != 0
|
|
|
|
|| bfd_bread (buffer, (bfd_size_type) 2, abfd) != 2)
|
|
|
|
{
|
|
|
|
if (bfd_get_error () == bfd_error_system_call)
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (H_GET_16 (abfd, buffer) == IMAGE_NT_SIGNATURE
|
|
|
|
|| H_GET_16 (abfd, buffer) == IMAGE_OS2_SIGNATURE
|
|
|
|
|| H_GET_16 (abfd, buffer) == IMAGE_OS2_SIGNATURE_LE
|
|
|
|
|| H_GET_16 (abfd, buffer) == IMAGE_OS2_SIGNATURE_LX)
|
|
|
|
{
|
|
|
|
bfd_set_error (bfd_error_wrong_format);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!msdos_mkobject (abfd))
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
abfd->flags = EXEC_P;
|
|
|
|
abfd->start_address = H_GET_16 (abfd, hdr.e_ip);
|
|
|
|
|
|
|
|
section = bfd_make_section (abfd, ".text");
|
|
|
|
if (section == NULL)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
section->flags = (SEC_ALLOC | SEC_LOAD | SEC_CODE | SEC_HAS_CONTENTS);
|
|
|
|
section->filepos = H_GET_16 (abfd, hdr.e_cparhdr) * 16;
|
|
|
|
size = (H_GET_16 (abfd, hdr.e_cp) - 1) * EXE_PAGE_SIZE - section->filepos;
|
|
|
|
size += H_GET_16 (abfd, hdr.e_cblp);
|
|
|
|
|
|
|
|
/* Check that the size is valid. */
|
|
|
|
if (bfd_seek (abfd, (file_ptr) (section->filepos + size), SEEK_SET) != 0)
|
|
|
|
{
|
|
|
|
if (bfd_get_error () != bfd_error_system_call)
|
|
|
|
bfd_set_error (bfd_error_wrong_format);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
bfd_set_section_size (abfd, section, size);
|
|
|
|
section->alignment_power = 4;
|
|
|
|
|
|
|
|
return abfd->xvec;
|
|
|
|
}
|
|
|
|
|
1999-05-03 09:29:11 +02:00
|
|
|
static int
|
2006-06-19 15:17:44 +02:00
|
|
|
msdos_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED,
|
|
|
|
struct bfd_link_info *info ATTRIBUTE_UNUSED)
|
1999-05-03 09:29:11 +02:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2002-11-30 09:39:46 +01:00
|
|
|
static bfd_boolean
|
2006-06-19 15:17:44 +02:00
|
|
|
msdos_write_object_contents (bfd *abfd)
|
1999-05-03 09:29:11 +02:00
|
|
|
{
|
|
|
|
static char hdr[EXE_PAGE_SIZE];
|
|
|
|
file_ptr outfile_size = sizeof(hdr);
|
|
|
|
bfd_vma high_vma = 0;
|
|
|
|
asection *sec;
|
|
|
|
|
|
|
|
/* Find the total size of the program on disk and in memory. */
|
|
|
|
for (sec = abfd->sections; sec != (asection *) NULL; sec = sec->next)
|
|
|
|
{
|
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 06:46:28 +02:00
|
|
|
if (sec->size == 0)
|
BFD whitespace fixes
Binutils is supposed to use tabs. In my git config I have
whitespace = indent-with-non-tab,space-before-tab,trailing-space
and I got annoyed enough seeing red in "git diff" output to fix
the problems.
* doc/header.sed: Trim trailing space when splitting lines.
* aix386-core.c, * aout-adobe.c, * aout-arm.c, * aout-cris.c,
* aout-ns32k.c, * aout-target.h, * aout-tic30.c, * aoutf1.h, * aoutx.h,
* arc-got.h, * arc-plt.def, * arc-plt.h, * archive.c, * archive64.c,
* archures.c, * armnetbsd.c, * bfd-in.h, * bfd.c, * bfdio.c, * binary.c,
* bout.c, * cache.c, * cisco-core.c, * coff-alpha.c, * coff-apollo.c,
* coff-arm.c, * coff-h8300.c, * coff-i386.c, * coff-i860.c,
* coff-i960.c, * coff-m68k.c, * coff-m88k.c, * coff-mcore.c,
* coff-mips.c, * coff-ppc.c, * coff-rs6000.c, * coff-sh.c,
* coff-stgo32.c, * coff-tic4x.c, * coff-tic54x.c, * coff-tic80.c,
* coff-we32k.c, * coff-x86_64.c, * coff-z80.c, * coff-z8k.c,
* coff64-rs6000.c, * coffcode.h, * coffgen.c, * cofflink.c,
* coffswap.h, * compress.c, * corefile.c, * cpu-alpha.c, * cpu-arm.c,
* cpu-avr.c, * cpu-bfin.c, * cpu-cr16.c, * cpu-cr16c.c, * cpu-crx.c,
* cpu-d10v.c, * cpu-frv.c, * cpu-ft32.c, * cpu-i370.c, * cpu-i960.c,
* cpu-ia64-opc.c, * cpu-ip2k.c, * cpu-lm32.c, * cpu-m32r.c,
* cpu-mcore.c, * cpu-microblaze.c, * cpu-mips.c, * cpu-moxie.c,
* cpu-mt.c, * cpu-nios2.c, * cpu-ns32k.c, * cpu-or1k.c, * cpu-powerpc.c,
* cpu-pru.c, * cpu-sh.c, * cpu-spu.c, * cpu-v850.c, * cpu-v850_rh850.c,
* cpu-xgate.c, * cpu-z80.c, * dwarf1.c, * dwarf2.c, * ecoff.c,
* ecofflink.c, * ecoffswap.h, * elf-bfd.h, * elf-eh-frame.c,
* elf-hppa.h, * elf-m10200.c, * elf-m10300.c, * elf-s390-common.c,
* elf-strtab.c, * elf-vxworks.c, * elf.c, * elf32-am33lin.c,
* elf32-arc.c, * elf32-arm.c, * elf32-avr.c, * elf32-avr.h,
* elf32-bfin.c, * elf32-cr16.c, * elf32-cr16c.c, * elf32-cris.c,
* elf32-crx.c, * elf32-d10v.c, * elf32-d30v.c, * elf32-dlx.c,
* elf32-epiphany.c, * elf32-fr30.c, * elf32-frv.c, * elf32-ft32.c,
* elf32-h8300.c, * elf32-hppa.c, * elf32-i386.c, * elf32-i860.c,
* elf32-i960.c, * elf32-ip2k.c, * elf32-lm32.c, * elf32-m32c.c,
* elf32-m32r.c, * elf32-m68hc11.c, * elf32-m68hc12.c, * elf32-m68hc1x.c,
* elf32-m68hc1x.h, * elf32-m68k.c, * elf32-m88k.c, * elf32-mcore.c,
* elf32-mep.c, * elf32-metag.c, * elf32-microblaze.c, * elf32-mips.c,
* elf32-moxie.c, * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c,
* elf32-nds32.h, * elf32-nios2.c, * elf32-or1k.c, * elf32-pj.c,
* elf32-ppc.c, * elf32-ppc.h, * elf32-pru.c, * elf32-rl78.c,
* elf32-rx.c, * elf32-s390.c, * elf32-score.c, * elf32-score.h,
* elf32-score7.c, * elf32-sh-symbian.c, * elf32-sh.c, * elf32-sh64.c,
* elf32-sparc.c, * elf32-spu.c, * elf32-tic6x.c, * elf32-tilegx.c,
* elf32-tilegx.h, * elf32-tilepro.c, * elf32-tilepro.h, * elf32-v850.c,
* elf32-vax.c, * elf32-wasm32.c, * elf32-xc16x.c, * elf32-xgate.c,
* elf32-xgate.h, * elf32-xstormy16.c, * elf32-xtensa.c, * elf64-alpha.c,
* elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mips.c, * elf64-mmix.c,
* elf64-ppc.c, * elf64-s390.c, * elf64-sh64.c, * elf64-sparc.c,
* elf64-tilegx.c, * elf64-tilegx.h, * elf64-x86-64.c, * elfcore.h,
* elflink.c, * elfn32-mips.c, * elfnn-aarch64.c, * elfnn-ia64.c,
* elfnn-riscv.c, * elfxx-aarch64.c, * elfxx-aarch64.h, * elfxx-ia64.c,
* elfxx-ia64.h, * elfxx-mips.c, * elfxx-riscv.c, * elfxx-sparc.c,
* elfxx-tilegx.c, * elfxx-x86.c, * elfxx-x86.h, * freebsd.h, * hash.c,
* host-aout.c, * hp300hpux.c, * hppabsd-core.c, * hpux-core.c,
* i386aout.c, * i386linux.c, * i386lynx.c, * i386mach3.c, * i386msdos.c,
* i386netbsd.c, * ieee.c, * ihex.c, * irix-core.c, * libaout.h,
* libbfd-in.h, * libbfd.c, * libcoff-in.h, * libnlm.h, * libpei.h,
* libxcoff.h, * linker.c, * lynx-core.c, * m68k4knetbsd.c,
* m68klinux.c, * m68knetbsd.c, * m88kmach3.c, * mach-o-aarch64.c,
* mach-o-arm.c, * mach-o-i386.c, * mach-o-target.c, * mach-o-x86-64.c,
* mach-o.c, * mach-o.h, * merge.c, * mipsbsd.c, * mmo.c, * netbsd.h,
* netbsd-core.c, * newsos3.c, * nlm-target.h, * nlm32-ppc.c,
* nlm32-sparc.c, * nlmcode.h, * ns32k.h, * ns32knetbsd.c, * oasys.c,
* opncls.c, * pc532-mach.c, * pdp11.c, * pe-arm.c, * pe-i386.c,
* pe-mcore.c, * pe-mips.c, * pe-x86_64.c, * peXXigen.c, * pef.c,
* pef.h, * pei-arm.c, * pei-i386.c, * pei-mcore.c, * pei-x86_64.c,
* peicode.h, * plugin.c, * ppcboot.c, * ptrace-core.c, * reloc.c,
* riscix.c, * rs6000-core.c, * section.c, * som.c, * som.h,
* sparclinux.c, * sparcnetbsd.c, * srec.c, * stabs.c, * sunos.c,
* syms.c, * targets.c, * tekhex.c, * trad-core.c, * vax1knetbsd.c,
* vaxnetbsd.c, * verilog.c, * versados.c, * vms-alpha.c, * vms-lib.c,
* vms-misc.c, * wasm-module.c, * wasm-module.h, * xcofflink.c,
* xsym.c, * xsym.h: Whitespace fixes.
* bfd-in2.h, * libbfd.h, * libcoff.h: Regenerate.
2017-12-05 23:56:00 +01:00
|
|
|
continue;
|
1999-05-03 09:29:11 +02:00
|
|
|
if (bfd_get_section_flags (abfd, sec) & SEC_ALLOC)
|
BFD whitespace fixes
Binutils is supposed to use tabs. In my git config I have
whitespace = indent-with-non-tab,space-before-tab,trailing-space
and I got annoyed enough seeing red in "git diff" output to fix
the problems.
* doc/header.sed: Trim trailing space when splitting lines.
* aix386-core.c, * aout-adobe.c, * aout-arm.c, * aout-cris.c,
* aout-ns32k.c, * aout-target.h, * aout-tic30.c, * aoutf1.h, * aoutx.h,
* arc-got.h, * arc-plt.def, * arc-plt.h, * archive.c, * archive64.c,
* archures.c, * armnetbsd.c, * bfd-in.h, * bfd.c, * bfdio.c, * binary.c,
* bout.c, * cache.c, * cisco-core.c, * coff-alpha.c, * coff-apollo.c,
* coff-arm.c, * coff-h8300.c, * coff-i386.c, * coff-i860.c,
* coff-i960.c, * coff-m68k.c, * coff-m88k.c, * coff-mcore.c,
* coff-mips.c, * coff-ppc.c, * coff-rs6000.c, * coff-sh.c,
* coff-stgo32.c, * coff-tic4x.c, * coff-tic54x.c, * coff-tic80.c,
* coff-we32k.c, * coff-x86_64.c, * coff-z80.c, * coff-z8k.c,
* coff64-rs6000.c, * coffcode.h, * coffgen.c, * cofflink.c,
* coffswap.h, * compress.c, * corefile.c, * cpu-alpha.c, * cpu-arm.c,
* cpu-avr.c, * cpu-bfin.c, * cpu-cr16.c, * cpu-cr16c.c, * cpu-crx.c,
* cpu-d10v.c, * cpu-frv.c, * cpu-ft32.c, * cpu-i370.c, * cpu-i960.c,
* cpu-ia64-opc.c, * cpu-ip2k.c, * cpu-lm32.c, * cpu-m32r.c,
* cpu-mcore.c, * cpu-microblaze.c, * cpu-mips.c, * cpu-moxie.c,
* cpu-mt.c, * cpu-nios2.c, * cpu-ns32k.c, * cpu-or1k.c, * cpu-powerpc.c,
* cpu-pru.c, * cpu-sh.c, * cpu-spu.c, * cpu-v850.c, * cpu-v850_rh850.c,
* cpu-xgate.c, * cpu-z80.c, * dwarf1.c, * dwarf2.c, * ecoff.c,
* ecofflink.c, * ecoffswap.h, * elf-bfd.h, * elf-eh-frame.c,
* elf-hppa.h, * elf-m10200.c, * elf-m10300.c, * elf-s390-common.c,
* elf-strtab.c, * elf-vxworks.c, * elf.c, * elf32-am33lin.c,
* elf32-arc.c, * elf32-arm.c, * elf32-avr.c, * elf32-avr.h,
* elf32-bfin.c, * elf32-cr16.c, * elf32-cr16c.c, * elf32-cris.c,
* elf32-crx.c, * elf32-d10v.c, * elf32-d30v.c, * elf32-dlx.c,
* elf32-epiphany.c, * elf32-fr30.c, * elf32-frv.c, * elf32-ft32.c,
* elf32-h8300.c, * elf32-hppa.c, * elf32-i386.c, * elf32-i860.c,
* elf32-i960.c, * elf32-ip2k.c, * elf32-lm32.c, * elf32-m32c.c,
* elf32-m32r.c, * elf32-m68hc11.c, * elf32-m68hc12.c, * elf32-m68hc1x.c,
* elf32-m68hc1x.h, * elf32-m68k.c, * elf32-m88k.c, * elf32-mcore.c,
* elf32-mep.c, * elf32-metag.c, * elf32-microblaze.c, * elf32-mips.c,
* elf32-moxie.c, * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c,
* elf32-nds32.h, * elf32-nios2.c, * elf32-or1k.c, * elf32-pj.c,
* elf32-ppc.c, * elf32-ppc.h, * elf32-pru.c, * elf32-rl78.c,
* elf32-rx.c, * elf32-s390.c, * elf32-score.c, * elf32-score.h,
* elf32-score7.c, * elf32-sh-symbian.c, * elf32-sh.c, * elf32-sh64.c,
* elf32-sparc.c, * elf32-spu.c, * elf32-tic6x.c, * elf32-tilegx.c,
* elf32-tilegx.h, * elf32-tilepro.c, * elf32-tilepro.h, * elf32-v850.c,
* elf32-vax.c, * elf32-wasm32.c, * elf32-xc16x.c, * elf32-xgate.c,
* elf32-xgate.h, * elf32-xstormy16.c, * elf32-xtensa.c, * elf64-alpha.c,
* elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mips.c, * elf64-mmix.c,
* elf64-ppc.c, * elf64-s390.c, * elf64-sh64.c, * elf64-sparc.c,
* elf64-tilegx.c, * elf64-tilegx.h, * elf64-x86-64.c, * elfcore.h,
* elflink.c, * elfn32-mips.c, * elfnn-aarch64.c, * elfnn-ia64.c,
* elfnn-riscv.c, * elfxx-aarch64.c, * elfxx-aarch64.h, * elfxx-ia64.c,
* elfxx-ia64.h, * elfxx-mips.c, * elfxx-riscv.c, * elfxx-sparc.c,
* elfxx-tilegx.c, * elfxx-x86.c, * elfxx-x86.h, * freebsd.h, * hash.c,
* host-aout.c, * hp300hpux.c, * hppabsd-core.c, * hpux-core.c,
* i386aout.c, * i386linux.c, * i386lynx.c, * i386mach3.c, * i386msdos.c,
* i386netbsd.c, * ieee.c, * ihex.c, * irix-core.c, * libaout.h,
* libbfd-in.h, * libbfd.c, * libcoff-in.h, * libnlm.h, * libpei.h,
* libxcoff.h, * linker.c, * lynx-core.c, * m68k4knetbsd.c,
* m68klinux.c, * m68knetbsd.c, * m88kmach3.c, * mach-o-aarch64.c,
* mach-o-arm.c, * mach-o-i386.c, * mach-o-target.c, * mach-o-x86-64.c,
* mach-o.c, * mach-o.h, * merge.c, * mipsbsd.c, * mmo.c, * netbsd.h,
* netbsd-core.c, * newsos3.c, * nlm-target.h, * nlm32-ppc.c,
* nlm32-sparc.c, * nlmcode.h, * ns32k.h, * ns32knetbsd.c, * oasys.c,
* opncls.c, * pc532-mach.c, * pdp11.c, * pe-arm.c, * pe-i386.c,
* pe-mcore.c, * pe-mips.c, * pe-x86_64.c, * peXXigen.c, * pef.c,
* pef.h, * pei-arm.c, * pei-i386.c, * pei-mcore.c, * pei-x86_64.c,
* peicode.h, * plugin.c, * ppcboot.c, * ptrace-core.c, * reloc.c,
* riscix.c, * rs6000-core.c, * section.c, * som.c, * som.h,
* sparclinux.c, * sparcnetbsd.c, * srec.c, * stabs.c, * sunos.c,
* syms.c, * targets.c, * tekhex.c, * trad-core.c, * vax1knetbsd.c,
* vaxnetbsd.c, * verilog.c, * versados.c, * vms-alpha.c, * vms-lib.c,
* vms-misc.c, * wasm-module.c, * wasm-module.h, * xcofflink.c,
* xsym.c, * xsym.h: Whitespace fixes.
* bfd-in2.h, * libbfd.h, * libcoff.h: Regenerate.
2017-12-05 23:56:00 +01:00
|
|
|
{
|
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 06:46:28 +02:00
|
|
|
bfd_vma sec_vma = bfd_get_section_vma (abfd, sec) + sec->size;
|
1999-05-03 09:29:11 +02:00
|
|
|
if (sec_vma > high_vma)
|
|
|
|
high_vma = sec_vma;
|
|
|
|
}
|
|
|
|
if (bfd_get_section_flags (abfd, sec) & SEC_LOAD)
|
BFD whitespace fixes
Binutils is supposed to use tabs. In my git config I have
whitespace = indent-with-non-tab,space-before-tab,trailing-space
and I got annoyed enough seeing red in "git diff" output to fix
the problems.
* doc/header.sed: Trim trailing space when splitting lines.
* aix386-core.c, * aout-adobe.c, * aout-arm.c, * aout-cris.c,
* aout-ns32k.c, * aout-target.h, * aout-tic30.c, * aoutf1.h, * aoutx.h,
* arc-got.h, * arc-plt.def, * arc-plt.h, * archive.c, * archive64.c,
* archures.c, * armnetbsd.c, * bfd-in.h, * bfd.c, * bfdio.c, * binary.c,
* bout.c, * cache.c, * cisco-core.c, * coff-alpha.c, * coff-apollo.c,
* coff-arm.c, * coff-h8300.c, * coff-i386.c, * coff-i860.c,
* coff-i960.c, * coff-m68k.c, * coff-m88k.c, * coff-mcore.c,
* coff-mips.c, * coff-ppc.c, * coff-rs6000.c, * coff-sh.c,
* coff-stgo32.c, * coff-tic4x.c, * coff-tic54x.c, * coff-tic80.c,
* coff-we32k.c, * coff-x86_64.c, * coff-z80.c, * coff-z8k.c,
* coff64-rs6000.c, * coffcode.h, * coffgen.c, * cofflink.c,
* coffswap.h, * compress.c, * corefile.c, * cpu-alpha.c, * cpu-arm.c,
* cpu-avr.c, * cpu-bfin.c, * cpu-cr16.c, * cpu-cr16c.c, * cpu-crx.c,
* cpu-d10v.c, * cpu-frv.c, * cpu-ft32.c, * cpu-i370.c, * cpu-i960.c,
* cpu-ia64-opc.c, * cpu-ip2k.c, * cpu-lm32.c, * cpu-m32r.c,
* cpu-mcore.c, * cpu-microblaze.c, * cpu-mips.c, * cpu-moxie.c,
* cpu-mt.c, * cpu-nios2.c, * cpu-ns32k.c, * cpu-or1k.c, * cpu-powerpc.c,
* cpu-pru.c, * cpu-sh.c, * cpu-spu.c, * cpu-v850.c, * cpu-v850_rh850.c,
* cpu-xgate.c, * cpu-z80.c, * dwarf1.c, * dwarf2.c, * ecoff.c,
* ecofflink.c, * ecoffswap.h, * elf-bfd.h, * elf-eh-frame.c,
* elf-hppa.h, * elf-m10200.c, * elf-m10300.c, * elf-s390-common.c,
* elf-strtab.c, * elf-vxworks.c, * elf.c, * elf32-am33lin.c,
* elf32-arc.c, * elf32-arm.c, * elf32-avr.c, * elf32-avr.h,
* elf32-bfin.c, * elf32-cr16.c, * elf32-cr16c.c, * elf32-cris.c,
* elf32-crx.c, * elf32-d10v.c, * elf32-d30v.c, * elf32-dlx.c,
* elf32-epiphany.c, * elf32-fr30.c, * elf32-frv.c, * elf32-ft32.c,
* elf32-h8300.c, * elf32-hppa.c, * elf32-i386.c, * elf32-i860.c,
* elf32-i960.c, * elf32-ip2k.c, * elf32-lm32.c, * elf32-m32c.c,
* elf32-m32r.c, * elf32-m68hc11.c, * elf32-m68hc12.c, * elf32-m68hc1x.c,
* elf32-m68hc1x.h, * elf32-m68k.c, * elf32-m88k.c, * elf32-mcore.c,
* elf32-mep.c, * elf32-metag.c, * elf32-microblaze.c, * elf32-mips.c,
* elf32-moxie.c, * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c,
* elf32-nds32.h, * elf32-nios2.c, * elf32-or1k.c, * elf32-pj.c,
* elf32-ppc.c, * elf32-ppc.h, * elf32-pru.c, * elf32-rl78.c,
* elf32-rx.c, * elf32-s390.c, * elf32-score.c, * elf32-score.h,
* elf32-score7.c, * elf32-sh-symbian.c, * elf32-sh.c, * elf32-sh64.c,
* elf32-sparc.c, * elf32-spu.c, * elf32-tic6x.c, * elf32-tilegx.c,
* elf32-tilegx.h, * elf32-tilepro.c, * elf32-tilepro.h, * elf32-v850.c,
* elf32-vax.c, * elf32-wasm32.c, * elf32-xc16x.c, * elf32-xgate.c,
* elf32-xgate.h, * elf32-xstormy16.c, * elf32-xtensa.c, * elf64-alpha.c,
* elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mips.c, * elf64-mmix.c,
* elf64-ppc.c, * elf64-s390.c, * elf64-sh64.c, * elf64-sparc.c,
* elf64-tilegx.c, * elf64-tilegx.h, * elf64-x86-64.c, * elfcore.h,
* elflink.c, * elfn32-mips.c, * elfnn-aarch64.c, * elfnn-ia64.c,
* elfnn-riscv.c, * elfxx-aarch64.c, * elfxx-aarch64.h, * elfxx-ia64.c,
* elfxx-ia64.h, * elfxx-mips.c, * elfxx-riscv.c, * elfxx-sparc.c,
* elfxx-tilegx.c, * elfxx-x86.c, * elfxx-x86.h, * freebsd.h, * hash.c,
* host-aout.c, * hp300hpux.c, * hppabsd-core.c, * hpux-core.c,
* i386aout.c, * i386linux.c, * i386lynx.c, * i386mach3.c, * i386msdos.c,
* i386netbsd.c, * ieee.c, * ihex.c, * irix-core.c, * libaout.h,
* libbfd-in.h, * libbfd.c, * libcoff-in.h, * libnlm.h, * libpei.h,
* libxcoff.h, * linker.c, * lynx-core.c, * m68k4knetbsd.c,
* m68klinux.c, * m68knetbsd.c, * m88kmach3.c, * mach-o-aarch64.c,
* mach-o-arm.c, * mach-o-i386.c, * mach-o-target.c, * mach-o-x86-64.c,
* mach-o.c, * mach-o.h, * merge.c, * mipsbsd.c, * mmo.c, * netbsd.h,
* netbsd-core.c, * newsos3.c, * nlm-target.h, * nlm32-ppc.c,
* nlm32-sparc.c, * nlmcode.h, * ns32k.h, * ns32knetbsd.c, * oasys.c,
* opncls.c, * pc532-mach.c, * pdp11.c, * pe-arm.c, * pe-i386.c,
* pe-mcore.c, * pe-mips.c, * pe-x86_64.c, * peXXigen.c, * pef.c,
* pef.h, * pei-arm.c, * pei-i386.c, * pei-mcore.c, * pei-x86_64.c,
* peicode.h, * plugin.c, * ppcboot.c, * ptrace-core.c, * reloc.c,
* riscix.c, * rs6000-core.c, * section.c, * som.c, * som.h,
* sparclinux.c, * sparcnetbsd.c, * srec.c, * stabs.c, * sunos.c,
* syms.c, * targets.c, * tekhex.c, * trad-core.c, * vax1knetbsd.c,
* vaxnetbsd.c, * verilog.c, * versados.c, * vms-alpha.c, * vms-lib.c,
* vms-misc.c, * wasm-module.c, * wasm-module.h, * xcofflink.c,
* xsym.c, * xsym.h: Whitespace fixes.
* bfd-in2.h, * libbfd.h, * libcoff.h: Regenerate.
2017-12-05 23:56:00 +01:00
|
|
|
{
|
2004-06-15 03:24:22 +02:00
|
|
|
file_ptr sec_end = (sizeof (hdr)
|
|
|
|
+ bfd_get_section_vma (abfd, sec)
|
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 06:46:28 +02:00
|
|
|
+ sec->size);
|
1999-05-03 09:29:11 +02:00
|
|
|
if (sec_end > outfile_size)
|
|
|
|
outfile_size = sec_end;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Make sure the program isn't too big. */
|
|
|
|
if (high_vma > (bfd_vma)0xffff)
|
|
|
|
{
|
|
|
|
bfd_set_error(bfd_error_file_too_big);
|
2002-11-30 09:39:46 +01:00
|
|
|
return FALSE;
|
1999-05-03 09:29:11 +02:00
|
|
|
}
|
|
|
|
|
2001-08-27 12:35:20 +02:00
|
|
|
/* Constants. */
|
2018-02-12 14:12:45 +01:00
|
|
|
H_PUT_16 (abfd, IMAGE_DOS_SIGNATURE, &hdr[0]);
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 11:57:26 +02:00
|
|
|
H_PUT_16 (abfd, EXE_PAGE_SIZE / 16, &hdr[8]);
|
|
|
|
H_PUT_16 (abfd, EXE_LOAD_LOW, &hdr[12]);
|
|
|
|
H_PUT_16 (abfd, 0x3e, &hdr[24]);
|
|
|
|
H_PUT_16 (abfd, 0x0001, &hdr[28]); /* XXX??? */
|
|
|
|
H_PUT_16 (abfd, 0x30fb, &hdr[30]); /* XXX??? */
|
|
|
|
H_PUT_16 (abfd, 0x726a, &hdr[32]); /* XXX??? */
|
1999-05-03 09:29:11 +02:00
|
|
|
|
2001-08-27 12:35:20 +02:00
|
|
|
/* Bytes in last page (0 = full page). */
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 11:57:26 +02:00
|
|
|
H_PUT_16 (abfd, outfile_size & (EXE_PAGE_SIZE - 1), &hdr[2]);
|
1999-05-03 09:29:11 +02:00
|
|
|
|
2001-08-27 12:35:20 +02:00
|
|
|
/* Number of pages. */
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 11:57:26 +02:00
|
|
|
H_PUT_16 (abfd, (outfile_size + EXE_PAGE_SIZE - 1) / EXE_PAGE_SIZE, &hdr[4]);
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
/* Set the initial stack pointer to the end of the bss.
|
|
|
|
The program's crt0 code must relocate it to a real stack. */
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 11:57:26 +02:00
|
|
|
H_PUT_16 (abfd, high_vma, &hdr[16]);
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 11:57:26 +02:00
|
|
|
|| bfd_bwrite (hdr, (bfd_size_type) sizeof(hdr), abfd) != sizeof(hdr))
|
2002-11-30 09:39:46 +01:00
|
|
|
return FALSE;
|
1999-05-03 09:29:11 +02:00
|
|
|
|
2002-11-30 09:39:46 +01:00
|
|
|
return TRUE;
|
1999-05-03 09:29:11 +02:00
|
|
|
}
|
|
|
|
|
2002-11-30 09:39:46 +01:00
|
|
|
static bfd_boolean
|
2006-06-19 15:17:44 +02:00
|
|
|
msdos_set_section_contents (bfd *abfd,
|
|
|
|
sec_ptr section,
|
|
|
|
const void *location,
|
|
|
|
file_ptr offset,
|
|
|
|
bfd_size_type count)
|
1999-05-03 09:29:11 +02:00
|
|
|
{
|
|
|
|
|
|
|
|
if (count == 0)
|
2002-11-30 09:39:46 +01:00
|
|
|
return TRUE;
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
section->filepos = EXE_PAGE_SIZE + bfd_get_section_vma (abfd, section);
|
|
|
|
|
|
|
|
if (bfd_get_section_flags (abfd, section) & SEC_LOAD)
|
|
|
|
{
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 11:57:26 +02:00
|
|
|
if (bfd_seek (abfd, section->filepos + offset, SEEK_SET) != 0
|
BFD whitespace fixes
Binutils is supposed to use tabs. In my git config I have
whitespace = indent-with-non-tab,space-before-tab,trailing-space
and I got annoyed enough seeing red in "git diff" output to fix
the problems.
* doc/header.sed: Trim trailing space when splitting lines.
* aix386-core.c, * aout-adobe.c, * aout-arm.c, * aout-cris.c,
* aout-ns32k.c, * aout-target.h, * aout-tic30.c, * aoutf1.h, * aoutx.h,
* arc-got.h, * arc-plt.def, * arc-plt.h, * archive.c, * archive64.c,
* archures.c, * armnetbsd.c, * bfd-in.h, * bfd.c, * bfdio.c, * binary.c,
* bout.c, * cache.c, * cisco-core.c, * coff-alpha.c, * coff-apollo.c,
* coff-arm.c, * coff-h8300.c, * coff-i386.c, * coff-i860.c,
* coff-i960.c, * coff-m68k.c, * coff-m88k.c, * coff-mcore.c,
* coff-mips.c, * coff-ppc.c, * coff-rs6000.c, * coff-sh.c,
* coff-stgo32.c, * coff-tic4x.c, * coff-tic54x.c, * coff-tic80.c,
* coff-we32k.c, * coff-x86_64.c, * coff-z80.c, * coff-z8k.c,
* coff64-rs6000.c, * coffcode.h, * coffgen.c, * cofflink.c,
* coffswap.h, * compress.c, * corefile.c, * cpu-alpha.c, * cpu-arm.c,
* cpu-avr.c, * cpu-bfin.c, * cpu-cr16.c, * cpu-cr16c.c, * cpu-crx.c,
* cpu-d10v.c, * cpu-frv.c, * cpu-ft32.c, * cpu-i370.c, * cpu-i960.c,
* cpu-ia64-opc.c, * cpu-ip2k.c, * cpu-lm32.c, * cpu-m32r.c,
* cpu-mcore.c, * cpu-microblaze.c, * cpu-mips.c, * cpu-moxie.c,
* cpu-mt.c, * cpu-nios2.c, * cpu-ns32k.c, * cpu-or1k.c, * cpu-powerpc.c,
* cpu-pru.c, * cpu-sh.c, * cpu-spu.c, * cpu-v850.c, * cpu-v850_rh850.c,
* cpu-xgate.c, * cpu-z80.c, * dwarf1.c, * dwarf2.c, * ecoff.c,
* ecofflink.c, * ecoffswap.h, * elf-bfd.h, * elf-eh-frame.c,
* elf-hppa.h, * elf-m10200.c, * elf-m10300.c, * elf-s390-common.c,
* elf-strtab.c, * elf-vxworks.c, * elf.c, * elf32-am33lin.c,
* elf32-arc.c, * elf32-arm.c, * elf32-avr.c, * elf32-avr.h,
* elf32-bfin.c, * elf32-cr16.c, * elf32-cr16c.c, * elf32-cris.c,
* elf32-crx.c, * elf32-d10v.c, * elf32-d30v.c, * elf32-dlx.c,
* elf32-epiphany.c, * elf32-fr30.c, * elf32-frv.c, * elf32-ft32.c,
* elf32-h8300.c, * elf32-hppa.c, * elf32-i386.c, * elf32-i860.c,
* elf32-i960.c, * elf32-ip2k.c, * elf32-lm32.c, * elf32-m32c.c,
* elf32-m32r.c, * elf32-m68hc11.c, * elf32-m68hc12.c, * elf32-m68hc1x.c,
* elf32-m68hc1x.h, * elf32-m68k.c, * elf32-m88k.c, * elf32-mcore.c,
* elf32-mep.c, * elf32-metag.c, * elf32-microblaze.c, * elf32-mips.c,
* elf32-moxie.c, * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c,
* elf32-nds32.h, * elf32-nios2.c, * elf32-or1k.c, * elf32-pj.c,
* elf32-ppc.c, * elf32-ppc.h, * elf32-pru.c, * elf32-rl78.c,
* elf32-rx.c, * elf32-s390.c, * elf32-score.c, * elf32-score.h,
* elf32-score7.c, * elf32-sh-symbian.c, * elf32-sh.c, * elf32-sh64.c,
* elf32-sparc.c, * elf32-spu.c, * elf32-tic6x.c, * elf32-tilegx.c,
* elf32-tilegx.h, * elf32-tilepro.c, * elf32-tilepro.h, * elf32-v850.c,
* elf32-vax.c, * elf32-wasm32.c, * elf32-xc16x.c, * elf32-xgate.c,
* elf32-xgate.h, * elf32-xstormy16.c, * elf32-xtensa.c, * elf64-alpha.c,
* elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mips.c, * elf64-mmix.c,
* elf64-ppc.c, * elf64-s390.c, * elf64-sh64.c, * elf64-sparc.c,
* elf64-tilegx.c, * elf64-tilegx.h, * elf64-x86-64.c, * elfcore.h,
* elflink.c, * elfn32-mips.c, * elfnn-aarch64.c, * elfnn-ia64.c,
* elfnn-riscv.c, * elfxx-aarch64.c, * elfxx-aarch64.h, * elfxx-ia64.c,
* elfxx-ia64.h, * elfxx-mips.c, * elfxx-riscv.c, * elfxx-sparc.c,
* elfxx-tilegx.c, * elfxx-x86.c, * elfxx-x86.h, * freebsd.h, * hash.c,
* host-aout.c, * hp300hpux.c, * hppabsd-core.c, * hpux-core.c,
* i386aout.c, * i386linux.c, * i386lynx.c, * i386mach3.c, * i386msdos.c,
* i386netbsd.c, * ieee.c, * ihex.c, * irix-core.c, * libaout.h,
* libbfd-in.h, * libbfd.c, * libcoff-in.h, * libnlm.h, * libpei.h,
* libxcoff.h, * linker.c, * lynx-core.c, * m68k4knetbsd.c,
* m68klinux.c, * m68knetbsd.c, * m88kmach3.c, * mach-o-aarch64.c,
* mach-o-arm.c, * mach-o-i386.c, * mach-o-target.c, * mach-o-x86-64.c,
* mach-o.c, * mach-o.h, * merge.c, * mipsbsd.c, * mmo.c, * netbsd.h,
* netbsd-core.c, * newsos3.c, * nlm-target.h, * nlm32-ppc.c,
* nlm32-sparc.c, * nlmcode.h, * ns32k.h, * ns32knetbsd.c, * oasys.c,
* opncls.c, * pc532-mach.c, * pdp11.c, * pe-arm.c, * pe-i386.c,
* pe-mcore.c, * pe-mips.c, * pe-x86_64.c, * peXXigen.c, * pef.c,
* pef.h, * pei-arm.c, * pei-i386.c, * pei-mcore.c, * pei-x86_64.c,
* peicode.h, * plugin.c, * ppcboot.c, * ptrace-core.c, * reloc.c,
* riscix.c, * rs6000-core.c, * section.c, * som.c, * som.h,
* sparclinux.c, * sparcnetbsd.c, * srec.c, * stabs.c, * sunos.c,
* syms.c, * targets.c, * tekhex.c, * trad-core.c, * vax1knetbsd.c,
* vaxnetbsd.c, * verilog.c, * versados.c, * vms-alpha.c, * vms-lib.c,
* vms-misc.c, * wasm-module.c, * wasm-module.h, * xcofflink.c,
* xsym.c, * xsym.h: Whitespace fixes.
* bfd-in2.h, * libbfd.h, * libcoff.h: Regenerate.
2017-12-05 23:56:00 +01:00
|
|
|
|| bfd_bwrite (location, count, abfd) != count)
|
|
|
|
return FALSE;
|
1999-05-03 09:29:11 +02:00
|
|
|
}
|
|
|
|
|
2002-11-30 09:39:46 +01:00
|
|
|
return TRUE;
|
1999-05-03 09:29:11 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define msdos_make_empty_symbol aout_32_make_empty_symbol
|
|
|
|
#define msdos_bfd_reloc_type_lookup aout_32_reloc_type_lookup
|
2007-03-26 14:23:03 +02:00
|
|
|
#define msdos_bfd_reloc_name_lookup aout_32_reloc_name_lookup
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
#define msdos_close_and_cleanup _bfd_generic_close_and_cleanup
|
|
|
|
#define msdos_bfd_free_cached_info _bfd_generic_bfd_free_cached_info
|
|
|
|
#define msdos_new_section_hook _bfd_generic_new_section_hook
|
|
|
|
#define msdos_get_section_contents _bfd_generic_get_section_contents
|
|
|
|
#define msdos_get_section_contents_in_window \
|
|
|
|
_bfd_generic_get_section_contents_in_window
|
|
|
|
#define msdos_bfd_get_relocated_section_contents \
|
|
|
|
bfd_generic_get_relocated_section_contents
|
|
|
|
#define msdos_bfd_relax_section bfd_generic_relax_section
|
|
|
|
#define msdos_bfd_gc_sections bfd_generic_gc_sections
|
2011-07-11 17:03:09 +02:00
|
|
|
#define msdos_bfd_lookup_section_flags bfd_generic_lookup_section_flags
|
* merge.c (struct sec_merge_hash_entry): Add u.entsize and u.suffix
fields, change sec into secinfo.
(struct sec_merge_info): Add chain, remove last fields.
(struct sec_merge_sec_info): Add next, sec, psecinfo fields.
(sec_merge_hash_lookup): If lookup could not use a string only
because it has bad alignment, mark the old string for deletion.
(sec_merge_add): Add secinfo argument. Don't compute entry's
position, instead record the section.
(sec_merge_emit): Update for the sec into secinfo change in
struct sec_merge_hash_entry.
(_bfd_merge_section): Only record the section for merging, defer
putting strings into the hash table.
(cmplengthentry, last4_eq, last_eq, record_section, merge_strings,
_bfd_merge_sections): New functions.
(_bfd_merged_section_offset): Update for the sec_merge_hash_entry
changes.
* libbfd-in.h (_bfd_merge_sections): Add prototype.
(_bfd_nolink_bfd_merge_sections): Define.
* libbfd.h: Likewise.
(bfd_generic_merge_sections): Add prototype.
* targets.c (BFD_JUMP_TABLE_LINK): Add _bfd_merge_sections.
(struct bfd_target): Likewise.
* bfd.c (bfd_merge_sections): Define.
* bfd-in2.h: Rebuilt.
* elf.c (_bfd_elf_merge_sections): New function.
* elf-bfd.h (_bfd_elf_merge_sections): Add prototype.
* elfxx-target.h (bfd_elfNN_bfd_merge_sections): Define.
* reloc.c (bfd_generic_merge_sections): New function.
* vms.c (vms_bfd_merge_sections): New function.
* aout-adobe.c (aout_32_bfd_merge_sections): Define.
* aout-target.h (MY_bfd_merge_sections): Define.
* aout-tic30.c (MY_bfd_merge_sections): Define.
* binary.c (binary_bfd_merge_sections): Define.
* bout.c (b_out_bfd_merge_sections): Define.
* coff-alpha.c (_bfd_ecoff_bfd_merge_sections): Define.
* coffcode.c (coff_bfd_merge_sections): Define.
* coff-mips.c (_bfd_ecoff_bfd_merge_sections): Define.
* i386msdos.c (msdos_bfd_merge_sections): Define.
* i386os9k.c (os9k_bfd_merge_sections): Define.
* ieee.c (ieee_bfd_merge_sections): Define.
* ihex.c (ihex_bfd_merge_sections): Define.
* nlm-target.h (nlm_bfd_merge_sections): Define.
* oasys.c (oasys_bfd_merge_sections): Define.
* ppcboot.c (ppcboot_bfd_merge_sections): Define.
* som.c (som_bfd_merge_sections): Define.
* srec.c (srec_bfd_merge_sections): Define.
* tekhex.c (tekhex_bfd_merge_sections): Define.
* versados.c (versados_bfd_merge_sections): Define.
* xcoff-target.h (_bfd_xcoff_bfd_merge_sections): Define.
* ldlang.c (lang_process): Call bfd_merge_sections.
2001-05-11 14:23:48 +02:00
|
|
|
#define msdos_bfd_merge_sections bfd_generic_merge_sections
|
2004-04-30 16:23:40 +02:00
|
|
|
#define msdos_bfd_is_group_section bfd_generic_is_group_section
|
2002-06-05 05:43:11 +02:00
|
|
|
#define msdos_bfd_discard_group bfd_generic_discard_group
|
2004-07-21 17:42:58 +02:00
|
|
|
#define msdos_section_already_linked \
|
|
|
|
_bfd_generic_section_already_linked
|
2009-04-17 01:07:00 +02:00
|
|
|
#define msdos_bfd_define_common_symbol bfd_generic_define_common_symbol
|
Rewrite __start and __stop symbol handling
This arranges for __start and __stop symbols to be defined before
garbage collection, for all target formats. That should allow the
COFF and PE --gc-sections to keep a singleton orphan input section,
a feature lost by 2017-06-13 commit cbd0eecf26. The fancier ELF
treatment of keeping all input sections associated with a __start or
__stop symbol, from 2015-10-23 commit 1cce69b9dc, is retained.
.startof. and .sizeof. symbols are deliberately not defined before
garbage collection, so these won't affect garbage collection of
sections.
The patch also ensures __start, __stop, .startof. and .sizeof. symbols
are defined before target size_dynamic_sections is called, albeit
with a preliminary value, so that target code doesn't need to cope
with a symbol changing from undefined at size_dynamic_sections to
defined at relocate_section.
Also, a number of problems with the testcases have been fixed.
PR ld/20022
PR ld/21557
PR ld/21562
PR ld/21571
include/
* bfdlink.h (struct bfd_link_hash_entry): Delete undef.section.
bfd/
* targets.c (struct bfd_target): Add _bfd_define_start_stop.
(BFD_JUMP_TABLE_LINK): Likewise.
* elf-bfd.h (bfd_elf_define_start_stop): Declare.
* elflink.c (_bfd_elf_gc_mark_rsec): Update comment.
(bfd_elf_define_start_stop): New function.
* linker.c (bfd_generic_define_start_stop): New function.
* coff64-rs6000.c (rs6000_xcoff64_vec, rs6000_xcoff64_aix_vec): Init
new field.
* aout-adobe.c (aout_32_bfd_define_start_stop): Define.
* aout-target.h (MY_bfd_define_start_stop): Define.
* aout-tic30.c (MY_bfd_define_start_stop): Define.
* binary.c (binary_bfd_define_start_stop): Define.
* bout.c (b_out_bfd_define_start_stop): Define.
* coff-alpha.c (_bfd_ecoff_bfd_define_start_stop): Define.
* coff-mips.c (_bfd_ecoff_bfd_define_start_stop): Define.
* coff-rs6000.c (_bfd_xcoff_bfd_define_start_stop): Define.
* coffcode.h (coff_bfd_define_start_stop): Define.
* elfxx-target.h (bfd_elfNN_bfd_define_start_stop): Define.
* i386msdos.c (msdos_bfd_define_start_stop): Define.
* i386os9k.c (os9k_bfd_define_start_stop): Define.
* ieee.c (ieee_bfd_define_start_stop): Define.
* ihex.c (ihex_bfd_define_start_stop): Define.
* libbfd-in.h (_bfd_nolink_bfd_define_start_stop): Define.
* mach-o-target.c (bfd_mach_o_bfd_define_start_stop): Define.
* mmo.c (mmo_bfd_define_start_stop): Define.
* nlm-target.h (nlm_bfd_define_start_stop): Define.
* oasys.c (oasys_bfd_define_start_stop): Define.
* pef.c (bfd_pef_bfd_define_start_stop): Define.
* plugin.c (bfd_plugin_bfd_define_start_stop): Define.
* ppcboot.c (ppcboot_bfd_define_start_stop): Define.
* som.c (som_bfd_define_start_stop): Define.
* srec.c (srec_bfd_define_start_stop): Define.
* tekhex.c (tekhex_bfd_define_start_stop): Define.
* versados.c (versados_bfd_define_start_stop): Define.
* vms-alpha.c (vms_bfd_define_start_stop): Define.
(alpha_vms_bfd_define_start_stop): Define.
* xsym.c (bfd_sym_bfd_define_start_stop): Define.
* bfd-in2.h: Regenerate.
* libbfd.h: Regenerate.
ld/
* emultempl/elf32.em (gld${EMULATION_NAME}_after_open): Don't set
__start/__stop syms here.
* ldlang.c (lang_set_startof): Delete.
(start_stop_syms, start_stop_count, start_stop_alloc): New vars.
(lang_define_start_stop, lang_init_start_stop, foreach_start_stop,
undef_start_stop, lang_undef_start_stop, lang_init_startof_sizeof,
set_start_stop, lang_finalize_start_stop): New functions.
(lang_process): Call _start_stop functions.
* testsuite/ld-elf/pr21562a.d: Use xfail rather than notarget.
Correct typos and list of xfail targets.
* testsuite/ld-elf/pr21562b.d: Likewise.
* testsuite/ld-elf/pr21562c.d: Likewise.
* testsuite/ld-elf/pr21562d.d: Likewise.
* testsuite/ld-elf/pr21562e.d: Likewise.
* testsuite/ld-elf/pr21562f.d: Likewise.
* testsuite/ld-elf/pr21562g.d: Likewise.
* testsuite/ld-elf/pr21562h.d: Likewise.
* testsuite/ld-elf/pr21562i.d: Likewise.
* testsuite/ld-elf/pr21562j.d: Likewise.
* testsuite/ld-elf/pr21562k.d: Likewise.
* testsuite/ld-elf/pr21562l.d: Likewise.
* testsuite/ld-elf/pr21562m.d: Likewise.
* testsuite/ld-elf/pr21562n.d: Likewise.
* testsuite/ld-elf/sizeofa.d: Likewise. Adjust to pass for generic ELF.
* testsuite/ld-elf/sizeofb.d: Likewise.
* testsuite/ld-elf/startofa.d: Likewise.
* testsuite/ld-elf/startofb.d: Likewise.
2017-06-16 12:11:41 +02:00
|
|
|
#define msdos_bfd_define_start_stop bfd_generic_define_start_stop
|
1999-05-03 09:29:11 +02:00
|
|
|
#define msdos_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
|
|
|
|
#define msdos_bfd_link_add_symbols _bfd_generic_link_add_symbols
|
2002-05-15 02:18:58 +02:00
|
|
|
#define msdos_bfd_link_just_syms _bfd_generic_link_just_syms
|
2009-11-23 15:41:33 +01:00
|
|
|
#define msdos_bfd_copy_link_hash_symbol_type \
|
|
|
|
_bfd_generic_copy_link_hash_symbol_type
|
1999-05-03 09:29:11 +02:00
|
|
|
#define msdos_bfd_final_link _bfd_generic_final_link
|
|
|
|
#define msdos_bfd_link_split_section _bfd_generic_link_split_section
|
|
|
|
#define msdos_set_arch_mach _bfd_generic_set_arch_mach
|
2016-04-21 16:43:00 +02:00
|
|
|
#define msdos_bfd_link_check_relocs _bfd_generic_link_check_relocs
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
#define msdos_get_symtab_upper_bound _bfd_nosymbols_get_symtab_upper_bound
|
2003-10-16 06:11:10 +02:00
|
|
|
#define msdos_canonicalize_symtab _bfd_nosymbols_canonicalize_symtab
|
1999-05-03 09:29:11 +02:00
|
|
|
#define msdos_print_symbol _bfd_nosymbols_print_symbol
|
|
|
|
#define msdos_get_symbol_info _bfd_nosymbols_get_symbol_info
|
2014-11-25 18:28:32 +01:00
|
|
|
#define msdos_get_symbol_version_string \
|
|
|
|
_bfd_nosymbols_get_symbol_version_string
|
1999-05-03 09:29:11 +02:00
|
|
|
#define msdos_find_nearest_line _bfd_nosymbols_find_nearest_line
|
Define bfd_find_line entry of BFD_JUMP_TABLE_SYMBOLS using NAME.
In https://www.sourceware.org/ml/binutils/2005-06/msg00082.html
HJ implemented bfd_find_line for DWARF2, but cheated a little in not
using the usual NAME##_find_line, saving quite a lot of boring
editing. However that shortcut probably contributed to
bfd_find_nearest_line_discriminator being implemented the same way,
and missing support for some targets.
* targets.c (BFD_JUMP_TABLE_SYMBOLS): Use NAME##_find_line.
* aout-adobe.c (aout_32_find_line): Define.
(aout_32_bfd_make_debug_symbol, aout_32_bfd_reloc_type_lookup,
aout_32_bfd_reloc_name_lookup): Define using _bfd_nosymbols define.
* aout-target.h (MY_find_line): Define.
* aout-tic30.c (MY_find_line): Define.
* binary.c (binary_find_line): Define.
* bout.c (aout_32_find_line): Define.
* coff-rs6000.c (_bfd_xcoff_find_line): Define.
* coff64-rs6000.c (rs6000_xcoff64_vec): Use coff_find_line.
(rs6000_xcoff64_aix_vec): Likewise.
* elf-bfd.h (_bfd_generic_find_line): Don't define.
* elfxx-target.h (bfd_elfNN_find_line): Define.
* i386msdos.c (msdos_find_line): Define.
* i386os9k.c (aout_32_find_line): Define.
* ieee.c (ieee_find_nearest_line, ieee_find_inliner_info): Delete func.
(ieee_find_nearest_line, ieee_find_line,
ieee_find_inliner_info): Define.
* ihex.c (ihex_find_line): Define.
* libbfd-in.h (_bfd_nosymbols_find_line): Define.
(_bfd_generic_find_line): Don't define.
* libbfd.c (_bfd_generic_find_line): Delete.
* libcoff-in.h (coff_find_line): Define.
* libecoff.h (_bfd_ecoff_find_line): Define.
* mach-o.h (bfd_mach_o_find_line): Define.
* mmo.c (mmo_find_line): Define.
* nlm-target.h (nlm_find_line): Define.
* oasys.c (oasys_find_nearest_line, oasys_find_inliner_info): Delete.
(oasys_find_nearest_line, oasys_find_line,
oasys_find_inliner_info): Define.
* pef.c (bfd_pef_find_line): Define.
* plugin.c (bfd_plugin_find_line): Define.
* ppcboot.c (ppcboot_find_line): Define.
* som.c (som_find_line): Define.
* srec.c (srec_find_line): Define.
* tekhex.c (tekhex_find_line): Define.
* versados.c (versados_find_line): Define.
* vms-alpha.c (alpha_vms_find_line): Define.
* xsym.c (bfd_sym_find_line): Define.
* bfd-in2.h: Regenerate.
* libbfd.h: Regenerate.
* libcoff.h: Regenerate.
2014-10-15 07:10:45 +02:00
|
|
|
#define msdos_find_line _bfd_nosymbols_find_line
|
2005-05-23 19:44:55 +02:00
|
|
|
#define msdos_find_inliner_info _bfd_nosymbols_find_inliner_info
|
1999-05-03 09:29:11 +02:00
|
|
|
#define msdos_get_lineno _bfd_nosymbols_get_lineno
|
Remove bfd stub function casts.
This patch defines a bunch of new functions to use in the BFD target
structs rather than casting bfd_false or bfd_true and similar stub
functions. I've also renamed the stub functions to reflect their
parameters and put "error" in the name if they set bfd_error. The
latter change is important since there were quite a few uses of
bfd_false where setting bfd_error was inappropriate, for example in
elf_backend_allow_non_load_phdr and is_target_special_symbol.
* libbfd.c (_bfd_bool_bfd_false_error): Rename from bfd_false.
(_bfd_bool_bfd_true): Rename from bfd_true.
(_bfd_ptr_bfd_null_error): Rename from bfd_nullvoidptr.
(_bfd_int_bfd_0): Rename from bfd_0.
(_bfd_uint_bfd_0): Rename from bfd_0u.
(_bfd_long_bfd_0): Rename from bfd_0l.
(_bfd_long_bfd_n1_error): Rename from _bfd_n1.
(_bfd_void_bfd): Rename from bfd_void.
(_bfd_bool_bfd_false, _bfd_bool_bfd_asymbol_false),
(_bfd_bool_bfd_link_false_error),
(_bfd_bool_bfd_link_true, _bfd_bool_bfd_bfd_true),
(_bfd_bool_bfd_uint_true, _bfd_bool_bfd_ptr_true),
(_bfd_bool_bfd_asection_bfd_asection_true),
(_bfd_bool_bfd_asymbol_bfd_asymbol_true),
(_bfd_void_bfd_link, _bfd_void_bfd_asection): New functions.
* archive.c (_bfd_noarchive_get_elt_at_index),
(_bfd_noarchive_openr_next_archived_file),
(_bfd_noarchive_construct_extended_name_table),
(_bfd_noarchive_write_ar_hdr, _bfd_noarchive_truncate_arname),
(_bfd_noarchive_write_armap): New functions.
* archures.c (_bfd_nowrite_set_arch_mach): New function.
* coff-alpha.c (alpha_ecoff_swap_coff_aux_in),
(alpha_ecoff_swap_coff_sym_in, alpha_ecoff_swap_coff_lineno_in),
(alpha_ecoff_swap_coff_aux_out, alpha_ecoff_swap_coff_sym_out),
(alpha_ecoff_swap_coff_lineno_out),
(alpha_ecoff_swap_coff_reloc_out): New functions.
* coff-mips.c (mips_ecoff_swap_coff_aux_in),
(mips_ecoff_swap_coff_sym_in, mips_ecoff_swap_coff_lineno_in),
(mips_ecoff_swap_coff_aux_out, mips_ecoff_swap_coff_sym_out),
(mips_ecoff_swap_coff_lineno_out),
(mips_ecoff_swap_coff_reloc_out): New functions.
* coffcode.h (coff_set_alignment_hook): Replace define with
new function.
(symname_in_debug_hook): Likewise.
* ecoff.c (_bfd_ecoff_set_alignment_hook): New function.
* elfxx-target.h (elf_backend_allow_non_load_phdr): Default to 0.
* elf.c (assign_file_positions_except_relocs): Test
elf_backend_allow_non_load_phdr for NULL.
* elflink.c (_bfd_elf_omit_section_dynsym_default): Rename from
_bfd_elf_link_omit_section_dynsym. Update uses.
(_bfd_elf_omit_section_dynsym_all): New function.
* elf-bfd.h (_bfd_elf_link_omit_section_dynsym): Delete.
(_bfd_elf_omit_section_dynsym_default): Declare.
(_bfd_elf_omit_section_dynsym_all): Declare.
* linker.c (_bfd_nolink_sizeof_headers, _bfd_nolink_bfd_relax_section),
(_bfd_nolink_bfd_get_relocated_section_contents),
(_bfd_nolink_bfd_lookup_section_flags),
(_bfd_nolink_bfd_is_group_section, _bfd_nolink_bfd_discard_group),
(_bfd_nolink_bfd_link_hash_table_create),
(_bfd_nolink_bfd_link_just_syms),
(_bfd_nolink_bfd_copy_link_hash_symbol_type),
(_bfd_nolink_bfd_link_split_section),
(_bfd_nolink_section_already_linked),
(_bfd_nolink_bfd_define_common_symbol),
(_bfd_nolink_bfd_define_start_stop): New functions.
* reloc.c (_bfd_norelocs_bfd_reloc_type_lookup),
(_bfd_norelocs_bfd_reloc_name_lookup),
(_bfd_nodynamic_canonicalize_dynamic_reloc): New functions.
* section.c (_bfd_nowrite_set_section_contents): New function.
* syms.c (_bfd_nosymbols_canonicalize_symtab),
(_bfd_nosymbols_print_symbol, _bfd_nosymbols_get_symbol_info),
(_bfd_nosymbols_get_symbol_version_string),
(_bfd_nosymbols_bfd_is_local_label_name),
(_bfd_nosymbols_get_lineno, _bfd_nosymbols_find_nearest_line),
(_bfd_nosymbols_find_line, _bfd_nosymbols_find_inliner_info),
(_bfd_nosymbols_bfd_make_debug_symbol),
( _bfd_nosymbols_read_minisymbols),
( _bfd_nosymbols_minisymbol_to_symbol),
(_bfd_nodynamic_get_synthetic_symtab): New functions.
* libbfd-in.h: Declare new functions. Update existing defines,
removing casts.
* aix386-core.c: Update to use new hooks. Formatting.
* aout-adobe.c: Likewise.
* aout-arm.c: Likewise.
* aout-target.h: Likewise.
* aout-tic30.c: Likewise.
* aoutf1.h: Likewise.
* binary.c: Likewise.
* bout.c: Likewise.
* cisco-core.c: Likewise.
* coff-alpha.c: Likewise.
* coff-i386.c: Likewise.
* coff-i860.c: Likewise.
* coff-i960.c: Likewise.
* coff-ia64.c: Likewise.
* coff-mips.c: Likewise.
* coff-ppc.c: Likewise.
* coff-rs6000.c: Likewise.
* coff-sh.c: Likewise.
* coff-tic30.c: Likewise.
* coff-tic54x.c: Likewise.
* coff-x86_64.c: Likewise.
* coff64-rs6000.c: Likewise.
* coffcode.h: Likewise.
* elf-m10300.c: Likewise.
* elf32-cr16.c: Likewise.
* elf32-lm32.c: Likewise.
* elf32-m32r.c: Likewise.
* elf32-metag.c: Likewise.
* elf32-score.c: Likewise.
* elf32-score7.c: Likewise.
* elf32-tilepro.c: Likewise.
* elf32-xstormy16.c: Likewise.
* elf32-xtensa.c: Likewise.
* elf64-alpha.c: Likewise.
* elf64-hppa.c: Likewise.
* elf64-ia64-vms.c: Likewise.
* elf64-mmix.c: Likewise.
* elf64-sh64.c: Likewise.
* elfnn-ia64.c: Likewise.
* elfxx-sparc.c: Likewise.
* elfxx-target.h: Likewise.
* elfxx-tilegx.c: Likewise.
* elfxx-x86.h: Likewise.
* hp300hpux.c: Likewise.
* hppabsd-core.c: Likewise.
* hpux-core.c: Likewise.
* i386msdos.c: Likewise.
* i386os9k.c: Likewise.
* ieee.c: Likewise.
* ihex.c: Likewise.
* irix-core.c: Likewise.
* libaout.h: Likewise.
* libecoff.h: Likewise.
* mach-o-target.c: Likewise.
* mach-o.c: Likewise.
* mipsbsd.c: Likewise.
* mmo.c: Likewise.
* netbsd-core.c: Likewise.
* nlm-target.h: Likewise.
* oasys.c: Likewise.
* osf-core.c: Likewise.
* pdp11.c: Likewise.
* pe-mips.c: Likewise.
* pe-x86_64.c: Likewise.
* pef.c: Likewise.
* plugin.c: Likewise.
* ppcboot.c: Likewise.
* ptrace-core.c: Likewise.
* sco5-core.c: Likewise.
* som.c: Likewise.
* sparclynx.c: Likewise.
* srec.c: Likewise.
* tekhex.c: Likewise.
* trad-core.c: Likewise.
* verilog.c: Likewise.
* versados.c: Likewise.
* vms-alpha.c: Likewise.
* vms-lib.c: Likewise.
* wasm-module.c: Likewise.
* xsym.c: Likewise.
* libbfd.h: Regenerate.
2018-02-15 01:28:06 +01:00
|
|
|
#define msdos_bfd_is_target_special_symbol _bfd_bool_bfd_asymbol_false
|
1999-05-03 09:29:11 +02:00
|
|
|
#define msdos_bfd_is_local_label_name _bfd_nosymbols_bfd_is_local_label_name
|
|
|
|
#define msdos_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
|
|
|
|
#define msdos_read_minisymbols _bfd_nosymbols_read_minisymbols
|
|
|
|
#define msdos_minisymbol_to_symbol _bfd_nosymbols_minisymbol_to_symbol
|
|
|
|
|
|
|
|
#define msdos_canonicalize_reloc _bfd_norelocs_canonicalize_reloc
|
2017-05-10 18:40:04 +02:00
|
|
|
#define msdos_set_reloc _bfd_norelocs_set_reloc
|
1999-05-03 09:29:11 +02:00
|
|
|
#define msdos_get_reloc_upper_bound _bfd_norelocs_get_reloc_upper_bound
|
|
|
|
#define msdos_32_bfd_link_split_section _bfd_generic_link_split_section
|
|
|
|
|
bfd target vector rationalisation
This renames the bfd targets to <cpu>_<format>_<other>_<endian>_vec.
So for example, bfd_elf32_ntradlittlemips_vec becomes
mips_elf32_ntrad_le_vec and hp300bsd_vec becomes m68k_aout_hp300bsd_vec.
bfd/
* aix386-core.c, * aout-adobe.c, * aout-arm.c, * aout-ns32k.c,
* aout-sparcle.c, * aout0.c, * aoutx.h, * armnetbsd.c, * bout.c,
* cf-i386lynx.c, * cf-sparclynx.c, * cisco-core.c, * coff-alpha.c,
* coff-apollo.c, * coff-arm.c, * coff-aux.c, * coff-go32.c,
* coff-h8300.c, * coff-h8500.c, * coff-i386.c, * coff-i860.c,
* coff-i960.c, * coff-m68k.c, * coff-m88k.c, * coff-mips.c,
* coff-rs6000.c, * coff-sh.c, * coff-sparc.c, * coff-stgo32.c,
* coff-svm68k.c, * coff-tic80.c, * coff-u68k.c, * coff-w65.c,
* coff-we32k.c, * coff-x86_64.c, * coff-z80.c, * coff-z8k.c,
* coff64-rs6000.c, * config.bfd, * configure.com, * configure.in,
* demo64.c, * elf-m10200.c, * elf-m10300.c, * elf32-am33lin.c,
* elf32-arc.c, * elf32-arm.c, * elf32-avr.c, * 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-gen.c, * elf32-h8300.c,
* elf32-hppa.c, * elf32-i370.c, * elf32-i386.c, * elf32-i860.c,
* elf32-i960.c, * elf32-ip2k.c, * elf32-iq2000.c, * elf32-lm32.c,
* elf32-m32c.c, * elf32-m32r.c, * elf32-m68hc11.c, * elf32-m68hc12.c,
* 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-nios2.c,
* elf32-or1k.c, * elf32-pj.c, * elf32-ppc.c, * elf32-rl78.c,
* elf32-rx.c, * elf32-s390.c, * elf32-score.c, * elf32-sh-symbian.c,
* elf32-sh.c, * elf32-sh64.c, * elf32-sparc.c, * elf32-spu.c,
* elf32-tic6x.c, * elf32-tilegx.c, * elf32-tilepro.c, * elf32-v850.c,
* elf32-vax.c, * elf32-xc16x.c, * elf32-xgate.c, * elf32-xstormy16.c,
* elf32-xtensa.c, * elf64-alpha.c, * elf64-gen.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-x86-64.c, * elfn32-mips.c, * elfnn-aarch64.c, * elfnn-ia64.c,
* epoc-pe-arm.c, * epoc-pei-arm.c, * hp300bsd.c, * hp300hpux.c,
* hppabsd-core.c, * hpux-core.c, * i386aout.c, * i386bsd.c,
* i386dynix.c, * i386freebsd.c, * i386linux.c, * i386lynx.c,
* i386mach3.c, * i386msdos.c, * i386netbsd.c, * i386os9k.c,
* irix-core.c, * m68k4knetbsd.c, * m68klinux.c, * m68knetbsd.c,
* m88kmach3.c, * m88kopenbsd.c, * mach-o-i386.c, * mach-o-x86-64.c,
* makefile.vms, * mipsbsd.c, * mmo.c, * netbsd-core.c, * newsos3.c,
* nlm32-alpha.c, * nlm32-i386.c, * nlm32-ppc.c, * nlm32-sparc.c,
* ns32knetbsd.c, * osf-core.c, * pc532-mach.c, * pe-arm-wince.c,
* pe-arm.c, * pe-i386.c, * pe-mcore.c, * pe-mips.c, * pe-ppc.c,
* pe-sh.c, * pe-x86_64.c, * pei-arm-wince.c, * pei-arm.c,
* pei-i386.c, * pei-ia64.c, * pei-mcore.c, * pei-mips.c, * pei-ppc.c,
* pei-sh.c, * pei-x86_64.c, * ppcboot.c, * ptrace-core.c, * riscix.c,
* sco5-core.c, * som.c, * sparclinux.c, * sparclynx.c,
* sparcnetbsd.c, * sunos.c, * targets.c, * trad-core.c,
* vax1knetbsd.c, * vaxbsd.c, * vaxnetbsd.c, * versados.c,
* vms-alpha.c, * vms-lib.c: Rename bfd targets to
<cpu>_<format>_<other>_<endian>_vec. Adjust associated MY macros
on aout targets.
* configure: Regenerate.
binutils/
* emul_aix.c: Update bfd target vector naming.
* testsuite/binutils-all/objcopy.exp: Likewise.
ld/
* emultempl/metagelf.em: Update bfd target vector naming.
* emultempl/nios2elf.em: Likewise.
* emultempl/spuelf.em: Likewise.
* emultempl/tic6xdsbt.em: Likewise.
2014-05-02 12:39:40 +02:00
|
|
|
const bfd_target i386_msdos_vec =
|
1999-05-03 09:29:11 +02:00
|
|
|
{
|
2001-08-27 12:35:20 +02:00
|
|
|
"msdos", /* name */
|
|
|
|
bfd_target_msdos_flavour,
|
|
|
|
BFD_ENDIAN_LITTLE, /* target byte order */
|
|
|
|
BFD_ENDIAN_LITTLE, /* target headers byte order */
|
|
|
|
(EXEC_P), /* object flags */
|
|
|
|
(SEC_CODE | SEC_DATA | SEC_HAS_CONTENTS
|
|
|
|
| SEC_ALLOC | SEC_LOAD), /* section flags */
|
|
|
|
0, /* leading underscore */
|
|
|
|
' ', /* 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 03:26:05 +02:00
|
|
|
0, /* match priority. */
|
2001-08-27 12:35:20 +02:00
|
|
|
bfd_getl64, bfd_getl_signed_64, bfd_putl64,
|
|
|
|
bfd_getl32, bfd_getl_signed_32, bfd_putl32,
|
|
|
|
bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */
|
|
|
|
bfd_getl64, bfd_getl_signed_64, bfd_putl64,
|
|
|
|
bfd_getl32, bfd_getl_signed_32, bfd_putl32,
|
|
|
|
bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */
|
|
|
|
|
|
|
|
{
|
|
|
|
_bfd_dummy_target,
|
2018-02-12 14:12:45 +01:00
|
|
|
msdos_object_p, /* bfd_check_format */
|
2001-08-27 12:35:20 +02:00
|
|
|
_bfd_dummy_target,
|
|
|
|
_bfd_dummy_target,
|
|
|
|
},
|
|
|
|
{
|
Remove bfd stub function casts.
This patch defines a bunch of new functions to use in the BFD target
structs rather than casting bfd_false or bfd_true and similar stub
functions. I've also renamed the stub functions to reflect their
parameters and put "error" in the name if they set bfd_error. The
latter change is important since there were quite a few uses of
bfd_false where setting bfd_error was inappropriate, for example in
elf_backend_allow_non_load_phdr and is_target_special_symbol.
* libbfd.c (_bfd_bool_bfd_false_error): Rename from bfd_false.
(_bfd_bool_bfd_true): Rename from bfd_true.
(_bfd_ptr_bfd_null_error): Rename from bfd_nullvoidptr.
(_bfd_int_bfd_0): Rename from bfd_0.
(_bfd_uint_bfd_0): Rename from bfd_0u.
(_bfd_long_bfd_0): Rename from bfd_0l.
(_bfd_long_bfd_n1_error): Rename from _bfd_n1.
(_bfd_void_bfd): Rename from bfd_void.
(_bfd_bool_bfd_false, _bfd_bool_bfd_asymbol_false),
(_bfd_bool_bfd_link_false_error),
(_bfd_bool_bfd_link_true, _bfd_bool_bfd_bfd_true),
(_bfd_bool_bfd_uint_true, _bfd_bool_bfd_ptr_true),
(_bfd_bool_bfd_asection_bfd_asection_true),
(_bfd_bool_bfd_asymbol_bfd_asymbol_true),
(_bfd_void_bfd_link, _bfd_void_bfd_asection): New functions.
* archive.c (_bfd_noarchive_get_elt_at_index),
(_bfd_noarchive_openr_next_archived_file),
(_bfd_noarchive_construct_extended_name_table),
(_bfd_noarchive_write_ar_hdr, _bfd_noarchive_truncate_arname),
(_bfd_noarchive_write_armap): New functions.
* archures.c (_bfd_nowrite_set_arch_mach): New function.
* coff-alpha.c (alpha_ecoff_swap_coff_aux_in),
(alpha_ecoff_swap_coff_sym_in, alpha_ecoff_swap_coff_lineno_in),
(alpha_ecoff_swap_coff_aux_out, alpha_ecoff_swap_coff_sym_out),
(alpha_ecoff_swap_coff_lineno_out),
(alpha_ecoff_swap_coff_reloc_out): New functions.
* coff-mips.c (mips_ecoff_swap_coff_aux_in),
(mips_ecoff_swap_coff_sym_in, mips_ecoff_swap_coff_lineno_in),
(mips_ecoff_swap_coff_aux_out, mips_ecoff_swap_coff_sym_out),
(mips_ecoff_swap_coff_lineno_out),
(mips_ecoff_swap_coff_reloc_out): New functions.
* coffcode.h (coff_set_alignment_hook): Replace define with
new function.
(symname_in_debug_hook): Likewise.
* ecoff.c (_bfd_ecoff_set_alignment_hook): New function.
* elfxx-target.h (elf_backend_allow_non_load_phdr): Default to 0.
* elf.c (assign_file_positions_except_relocs): Test
elf_backend_allow_non_load_phdr for NULL.
* elflink.c (_bfd_elf_omit_section_dynsym_default): Rename from
_bfd_elf_link_omit_section_dynsym. Update uses.
(_bfd_elf_omit_section_dynsym_all): New function.
* elf-bfd.h (_bfd_elf_link_omit_section_dynsym): Delete.
(_bfd_elf_omit_section_dynsym_default): Declare.
(_bfd_elf_omit_section_dynsym_all): Declare.
* linker.c (_bfd_nolink_sizeof_headers, _bfd_nolink_bfd_relax_section),
(_bfd_nolink_bfd_get_relocated_section_contents),
(_bfd_nolink_bfd_lookup_section_flags),
(_bfd_nolink_bfd_is_group_section, _bfd_nolink_bfd_discard_group),
(_bfd_nolink_bfd_link_hash_table_create),
(_bfd_nolink_bfd_link_just_syms),
(_bfd_nolink_bfd_copy_link_hash_symbol_type),
(_bfd_nolink_bfd_link_split_section),
(_bfd_nolink_section_already_linked),
(_bfd_nolink_bfd_define_common_symbol),
(_bfd_nolink_bfd_define_start_stop): New functions.
* reloc.c (_bfd_norelocs_bfd_reloc_type_lookup),
(_bfd_norelocs_bfd_reloc_name_lookup),
(_bfd_nodynamic_canonicalize_dynamic_reloc): New functions.
* section.c (_bfd_nowrite_set_section_contents): New function.
* syms.c (_bfd_nosymbols_canonicalize_symtab),
(_bfd_nosymbols_print_symbol, _bfd_nosymbols_get_symbol_info),
(_bfd_nosymbols_get_symbol_version_string),
(_bfd_nosymbols_bfd_is_local_label_name),
(_bfd_nosymbols_get_lineno, _bfd_nosymbols_find_nearest_line),
(_bfd_nosymbols_find_line, _bfd_nosymbols_find_inliner_info),
(_bfd_nosymbols_bfd_make_debug_symbol),
( _bfd_nosymbols_read_minisymbols),
( _bfd_nosymbols_minisymbol_to_symbol),
(_bfd_nodynamic_get_synthetic_symtab): New functions.
* libbfd-in.h: Declare new functions. Update existing defines,
removing casts.
* aix386-core.c: Update to use new hooks. Formatting.
* aout-adobe.c: Likewise.
* aout-arm.c: Likewise.
* aout-target.h: Likewise.
* aout-tic30.c: Likewise.
* aoutf1.h: Likewise.
* binary.c: Likewise.
* bout.c: Likewise.
* cisco-core.c: Likewise.
* coff-alpha.c: Likewise.
* coff-i386.c: Likewise.
* coff-i860.c: Likewise.
* coff-i960.c: Likewise.
* coff-ia64.c: Likewise.
* coff-mips.c: Likewise.
* coff-ppc.c: Likewise.
* coff-rs6000.c: Likewise.
* coff-sh.c: Likewise.
* coff-tic30.c: Likewise.
* coff-tic54x.c: Likewise.
* coff-x86_64.c: Likewise.
* coff64-rs6000.c: Likewise.
* coffcode.h: Likewise.
* elf-m10300.c: Likewise.
* elf32-cr16.c: Likewise.
* elf32-lm32.c: Likewise.
* elf32-m32r.c: Likewise.
* elf32-metag.c: Likewise.
* elf32-score.c: Likewise.
* elf32-score7.c: Likewise.
* elf32-tilepro.c: Likewise.
* elf32-xstormy16.c: Likewise.
* elf32-xtensa.c: Likewise.
* elf64-alpha.c: Likewise.
* elf64-hppa.c: Likewise.
* elf64-ia64-vms.c: Likewise.
* elf64-mmix.c: Likewise.
* elf64-sh64.c: Likewise.
* elfnn-ia64.c: Likewise.
* elfxx-sparc.c: Likewise.
* elfxx-target.h: Likewise.
* elfxx-tilegx.c: Likewise.
* elfxx-x86.h: Likewise.
* hp300hpux.c: Likewise.
* hppabsd-core.c: Likewise.
* hpux-core.c: Likewise.
* i386msdos.c: Likewise.
* i386os9k.c: Likewise.
* ieee.c: Likewise.
* ihex.c: Likewise.
* irix-core.c: Likewise.
* libaout.h: Likewise.
* libecoff.h: Likewise.
* mach-o-target.c: Likewise.
* mach-o.c: Likewise.
* mipsbsd.c: Likewise.
* mmo.c: Likewise.
* netbsd-core.c: Likewise.
* nlm-target.h: Likewise.
* oasys.c: Likewise.
* osf-core.c: Likewise.
* pdp11.c: Likewise.
* pe-mips.c: Likewise.
* pe-x86_64.c: Likewise.
* pef.c: Likewise.
* plugin.c: Likewise.
* ppcboot.c: Likewise.
* ptrace-core.c: Likewise.
* sco5-core.c: Likewise.
* som.c: Likewise.
* sparclynx.c: Likewise.
* srec.c: Likewise.
* tekhex.c: Likewise.
* trad-core.c: Likewise.
* verilog.c: Likewise.
* versados.c: Likewise.
* vms-alpha.c: Likewise.
* vms-lib.c: Likewise.
* wasm-module.c: Likewise.
* xsym.c: Likewise.
* libbfd.h: Regenerate.
2018-02-15 01:28:06 +01:00
|
|
|
_bfd_bool_bfd_false_error,
|
2001-08-27 12:35:20 +02:00
|
|
|
msdos_mkobject,
|
|
|
|
_bfd_generic_mkarchive,
|
Remove bfd stub function casts.
This patch defines a bunch of new functions to use in the BFD target
structs rather than casting bfd_false or bfd_true and similar stub
functions. I've also renamed the stub functions to reflect their
parameters and put "error" in the name if they set bfd_error. The
latter change is important since there were quite a few uses of
bfd_false where setting bfd_error was inappropriate, for example in
elf_backend_allow_non_load_phdr and is_target_special_symbol.
* libbfd.c (_bfd_bool_bfd_false_error): Rename from bfd_false.
(_bfd_bool_bfd_true): Rename from bfd_true.
(_bfd_ptr_bfd_null_error): Rename from bfd_nullvoidptr.
(_bfd_int_bfd_0): Rename from bfd_0.
(_bfd_uint_bfd_0): Rename from bfd_0u.
(_bfd_long_bfd_0): Rename from bfd_0l.
(_bfd_long_bfd_n1_error): Rename from _bfd_n1.
(_bfd_void_bfd): Rename from bfd_void.
(_bfd_bool_bfd_false, _bfd_bool_bfd_asymbol_false),
(_bfd_bool_bfd_link_false_error),
(_bfd_bool_bfd_link_true, _bfd_bool_bfd_bfd_true),
(_bfd_bool_bfd_uint_true, _bfd_bool_bfd_ptr_true),
(_bfd_bool_bfd_asection_bfd_asection_true),
(_bfd_bool_bfd_asymbol_bfd_asymbol_true),
(_bfd_void_bfd_link, _bfd_void_bfd_asection): New functions.
* archive.c (_bfd_noarchive_get_elt_at_index),
(_bfd_noarchive_openr_next_archived_file),
(_bfd_noarchive_construct_extended_name_table),
(_bfd_noarchive_write_ar_hdr, _bfd_noarchive_truncate_arname),
(_bfd_noarchive_write_armap): New functions.
* archures.c (_bfd_nowrite_set_arch_mach): New function.
* coff-alpha.c (alpha_ecoff_swap_coff_aux_in),
(alpha_ecoff_swap_coff_sym_in, alpha_ecoff_swap_coff_lineno_in),
(alpha_ecoff_swap_coff_aux_out, alpha_ecoff_swap_coff_sym_out),
(alpha_ecoff_swap_coff_lineno_out),
(alpha_ecoff_swap_coff_reloc_out): New functions.
* coff-mips.c (mips_ecoff_swap_coff_aux_in),
(mips_ecoff_swap_coff_sym_in, mips_ecoff_swap_coff_lineno_in),
(mips_ecoff_swap_coff_aux_out, mips_ecoff_swap_coff_sym_out),
(mips_ecoff_swap_coff_lineno_out),
(mips_ecoff_swap_coff_reloc_out): New functions.
* coffcode.h (coff_set_alignment_hook): Replace define with
new function.
(symname_in_debug_hook): Likewise.
* ecoff.c (_bfd_ecoff_set_alignment_hook): New function.
* elfxx-target.h (elf_backend_allow_non_load_phdr): Default to 0.
* elf.c (assign_file_positions_except_relocs): Test
elf_backend_allow_non_load_phdr for NULL.
* elflink.c (_bfd_elf_omit_section_dynsym_default): Rename from
_bfd_elf_link_omit_section_dynsym. Update uses.
(_bfd_elf_omit_section_dynsym_all): New function.
* elf-bfd.h (_bfd_elf_link_omit_section_dynsym): Delete.
(_bfd_elf_omit_section_dynsym_default): Declare.
(_bfd_elf_omit_section_dynsym_all): Declare.
* linker.c (_bfd_nolink_sizeof_headers, _bfd_nolink_bfd_relax_section),
(_bfd_nolink_bfd_get_relocated_section_contents),
(_bfd_nolink_bfd_lookup_section_flags),
(_bfd_nolink_bfd_is_group_section, _bfd_nolink_bfd_discard_group),
(_bfd_nolink_bfd_link_hash_table_create),
(_bfd_nolink_bfd_link_just_syms),
(_bfd_nolink_bfd_copy_link_hash_symbol_type),
(_bfd_nolink_bfd_link_split_section),
(_bfd_nolink_section_already_linked),
(_bfd_nolink_bfd_define_common_symbol),
(_bfd_nolink_bfd_define_start_stop): New functions.
* reloc.c (_bfd_norelocs_bfd_reloc_type_lookup),
(_bfd_norelocs_bfd_reloc_name_lookup),
(_bfd_nodynamic_canonicalize_dynamic_reloc): New functions.
* section.c (_bfd_nowrite_set_section_contents): New function.
* syms.c (_bfd_nosymbols_canonicalize_symtab),
(_bfd_nosymbols_print_symbol, _bfd_nosymbols_get_symbol_info),
(_bfd_nosymbols_get_symbol_version_string),
(_bfd_nosymbols_bfd_is_local_label_name),
(_bfd_nosymbols_get_lineno, _bfd_nosymbols_find_nearest_line),
(_bfd_nosymbols_find_line, _bfd_nosymbols_find_inliner_info),
(_bfd_nosymbols_bfd_make_debug_symbol),
( _bfd_nosymbols_read_minisymbols),
( _bfd_nosymbols_minisymbol_to_symbol),
(_bfd_nodynamic_get_synthetic_symtab): New functions.
* libbfd-in.h: Declare new functions. Update existing defines,
removing casts.
* aix386-core.c: Update to use new hooks. Formatting.
* aout-adobe.c: Likewise.
* aout-arm.c: Likewise.
* aout-target.h: Likewise.
* aout-tic30.c: Likewise.
* aoutf1.h: Likewise.
* binary.c: Likewise.
* bout.c: Likewise.
* cisco-core.c: Likewise.
* coff-alpha.c: Likewise.
* coff-i386.c: Likewise.
* coff-i860.c: Likewise.
* coff-i960.c: Likewise.
* coff-ia64.c: Likewise.
* coff-mips.c: Likewise.
* coff-ppc.c: Likewise.
* coff-rs6000.c: Likewise.
* coff-sh.c: Likewise.
* coff-tic30.c: Likewise.
* coff-tic54x.c: Likewise.
* coff-x86_64.c: Likewise.
* coff64-rs6000.c: Likewise.
* coffcode.h: Likewise.
* elf-m10300.c: Likewise.
* elf32-cr16.c: Likewise.
* elf32-lm32.c: Likewise.
* elf32-m32r.c: Likewise.
* elf32-metag.c: Likewise.
* elf32-score.c: Likewise.
* elf32-score7.c: Likewise.
* elf32-tilepro.c: Likewise.
* elf32-xstormy16.c: Likewise.
* elf32-xtensa.c: Likewise.
* elf64-alpha.c: Likewise.
* elf64-hppa.c: Likewise.
* elf64-ia64-vms.c: Likewise.
* elf64-mmix.c: Likewise.
* elf64-sh64.c: Likewise.
* elfnn-ia64.c: Likewise.
* elfxx-sparc.c: Likewise.
* elfxx-target.h: Likewise.
* elfxx-tilegx.c: Likewise.
* elfxx-x86.h: Likewise.
* hp300hpux.c: Likewise.
* hppabsd-core.c: Likewise.
* hpux-core.c: Likewise.
* i386msdos.c: Likewise.
* i386os9k.c: Likewise.
* ieee.c: Likewise.
* ihex.c: Likewise.
* irix-core.c: Likewise.
* libaout.h: Likewise.
* libecoff.h: Likewise.
* mach-o-target.c: Likewise.
* mach-o.c: Likewise.
* mipsbsd.c: Likewise.
* mmo.c: Likewise.
* netbsd-core.c: Likewise.
* nlm-target.h: Likewise.
* oasys.c: Likewise.
* osf-core.c: Likewise.
* pdp11.c: Likewise.
* pe-mips.c: Likewise.
* pe-x86_64.c: Likewise.
* pef.c: Likewise.
* plugin.c: Likewise.
* ppcboot.c: Likewise.
* ptrace-core.c: Likewise.
* sco5-core.c: Likewise.
* som.c: Likewise.
* sparclynx.c: Likewise.
* srec.c: Likewise.
* tekhex.c: Likewise.
* trad-core.c: Likewise.
* verilog.c: Likewise.
* versados.c: Likewise.
* vms-alpha.c: Likewise.
* vms-lib.c: Likewise.
* wasm-module.c: Likewise.
* xsym.c: Likewise.
* libbfd.h: Regenerate.
2018-02-15 01:28:06 +01:00
|
|
|
_bfd_bool_bfd_false_error,
|
2001-08-27 12:35:20 +02: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 01:28:06 +01:00
|
|
|
_bfd_bool_bfd_false_error,
|
2001-08-27 12:35:20 +02:00
|
|
|
msdos_write_object_contents,
|
|
|
|
_bfd_write_archive_contents,
|
Remove bfd stub function casts.
This patch defines a bunch of new functions to use in the BFD target
structs rather than casting bfd_false or bfd_true and similar stub
functions. I've also renamed the stub functions to reflect their
parameters and put "error" in the name if they set bfd_error. The
latter change is important since there were quite a few uses of
bfd_false where setting bfd_error was inappropriate, for example in
elf_backend_allow_non_load_phdr and is_target_special_symbol.
* libbfd.c (_bfd_bool_bfd_false_error): Rename from bfd_false.
(_bfd_bool_bfd_true): Rename from bfd_true.
(_bfd_ptr_bfd_null_error): Rename from bfd_nullvoidptr.
(_bfd_int_bfd_0): Rename from bfd_0.
(_bfd_uint_bfd_0): Rename from bfd_0u.
(_bfd_long_bfd_0): Rename from bfd_0l.
(_bfd_long_bfd_n1_error): Rename from _bfd_n1.
(_bfd_void_bfd): Rename from bfd_void.
(_bfd_bool_bfd_false, _bfd_bool_bfd_asymbol_false),
(_bfd_bool_bfd_link_false_error),
(_bfd_bool_bfd_link_true, _bfd_bool_bfd_bfd_true),
(_bfd_bool_bfd_uint_true, _bfd_bool_bfd_ptr_true),
(_bfd_bool_bfd_asection_bfd_asection_true),
(_bfd_bool_bfd_asymbol_bfd_asymbol_true),
(_bfd_void_bfd_link, _bfd_void_bfd_asection): New functions.
* archive.c (_bfd_noarchive_get_elt_at_index),
(_bfd_noarchive_openr_next_archived_file),
(_bfd_noarchive_construct_extended_name_table),
(_bfd_noarchive_write_ar_hdr, _bfd_noarchive_truncate_arname),
(_bfd_noarchive_write_armap): New functions.
* archures.c (_bfd_nowrite_set_arch_mach): New function.
* coff-alpha.c (alpha_ecoff_swap_coff_aux_in),
(alpha_ecoff_swap_coff_sym_in, alpha_ecoff_swap_coff_lineno_in),
(alpha_ecoff_swap_coff_aux_out, alpha_ecoff_swap_coff_sym_out),
(alpha_ecoff_swap_coff_lineno_out),
(alpha_ecoff_swap_coff_reloc_out): New functions.
* coff-mips.c (mips_ecoff_swap_coff_aux_in),
(mips_ecoff_swap_coff_sym_in, mips_ecoff_swap_coff_lineno_in),
(mips_ecoff_swap_coff_aux_out, mips_ecoff_swap_coff_sym_out),
(mips_ecoff_swap_coff_lineno_out),
(mips_ecoff_swap_coff_reloc_out): New functions.
* coffcode.h (coff_set_alignment_hook): Replace define with
new function.
(symname_in_debug_hook): Likewise.
* ecoff.c (_bfd_ecoff_set_alignment_hook): New function.
* elfxx-target.h (elf_backend_allow_non_load_phdr): Default to 0.
* elf.c (assign_file_positions_except_relocs): Test
elf_backend_allow_non_load_phdr for NULL.
* elflink.c (_bfd_elf_omit_section_dynsym_default): Rename from
_bfd_elf_link_omit_section_dynsym. Update uses.
(_bfd_elf_omit_section_dynsym_all): New function.
* elf-bfd.h (_bfd_elf_link_omit_section_dynsym): Delete.
(_bfd_elf_omit_section_dynsym_default): Declare.
(_bfd_elf_omit_section_dynsym_all): Declare.
* linker.c (_bfd_nolink_sizeof_headers, _bfd_nolink_bfd_relax_section),
(_bfd_nolink_bfd_get_relocated_section_contents),
(_bfd_nolink_bfd_lookup_section_flags),
(_bfd_nolink_bfd_is_group_section, _bfd_nolink_bfd_discard_group),
(_bfd_nolink_bfd_link_hash_table_create),
(_bfd_nolink_bfd_link_just_syms),
(_bfd_nolink_bfd_copy_link_hash_symbol_type),
(_bfd_nolink_bfd_link_split_section),
(_bfd_nolink_section_already_linked),
(_bfd_nolink_bfd_define_common_symbol),
(_bfd_nolink_bfd_define_start_stop): New functions.
* reloc.c (_bfd_norelocs_bfd_reloc_type_lookup),
(_bfd_norelocs_bfd_reloc_name_lookup),
(_bfd_nodynamic_canonicalize_dynamic_reloc): New functions.
* section.c (_bfd_nowrite_set_section_contents): New function.
* syms.c (_bfd_nosymbols_canonicalize_symtab),
(_bfd_nosymbols_print_symbol, _bfd_nosymbols_get_symbol_info),
(_bfd_nosymbols_get_symbol_version_string),
(_bfd_nosymbols_bfd_is_local_label_name),
(_bfd_nosymbols_get_lineno, _bfd_nosymbols_find_nearest_line),
(_bfd_nosymbols_find_line, _bfd_nosymbols_find_inliner_info),
(_bfd_nosymbols_bfd_make_debug_symbol),
( _bfd_nosymbols_read_minisymbols),
( _bfd_nosymbols_minisymbol_to_symbol),
(_bfd_nodynamic_get_synthetic_symtab): New functions.
* libbfd-in.h: Declare new functions. Update existing defines,
removing casts.
* aix386-core.c: Update to use new hooks. Formatting.
* aout-adobe.c: Likewise.
* aout-arm.c: Likewise.
* aout-target.h: Likewise.
* aout-tic30.c: Likewise.
* aoutf1.h: Likewise.
* binary.c: Likewise.
* bout.c: Likewise.
* cisco-core.c: Likewise.
* coff-alpha.c: Likewise.
* coff-i386.c: Likewise.
* coff-i860.c: Likewise.
* coff-i960.c: Likewise.
* coff-ia64.c: Likewise.
* coff-mips.c: Likewise.
* coff-ppc.c: Likewise.
* coff-rs6000.c: Likewise.
* coff-sh.c: Likewise.
* coff-tic30.c: Likewise.
* coff-tic54x.c: Likewise.
* coff-x86_64.c: Likewise.
* coff64-rs6000.c: Likewise.
* coffcode.h: Likewise.
* elf-m10300.c: Likewise.
* elf32-cr16.c: Likewise.
* elf32-lm32.c: Likewise.
* elf32-m32r.c: Likewise.
* elf32-metag.c: Likewise.
* elf32-score.c: Likewise.
* elf32-score7.c: Likewise.
* elf32-tilepro.c: Likewise.
* elf32-xstormy16.c: Likewise.
* elf32-xtensa.c: Likewise.
* elf64-alpha.c: Likewise.
* elf64-hppa.c: Likewise.
* elf64-ia64-vms.c: Likewise.
* elf64-mmix.c: Likewise.
* elf64-sh64.c: Likewise.
* elfnn-ia64.c: Likewise.
* elfxx-sparc.c: Likewise.
* elfxx-target.h: Likewise.
* elfxx-tilegx.c: Likewise.
* elfxx-x86.h: Likewise.
* hp300hpux.c: Likewise.
* hppabsd-core.c: Likewise.
* hpux-core.c: Likewise.
* i386msdos.c: Likewise.
* i386os9k.c: Likewise.
* ieee.c: Likewise.
* ihex.c: Likewise.
* irix-core.c: Likewise.
* libaout.h: Likewise.
* libecoff.h: Likewise.
* mach-o-target.c: Likewise.
* mach-o.c: Likewise.
* mipsbsd.c: Likewise.
* mmo.c: Likewise.
* netbsd-core.c: Likewise.
* nlm-target.h: Likewise.
* oasys.c: Likewise.
* osf-core.c: Likewise.
* pdp11.c: Likewise.
* pe-mips.c: Likewise.
* pe-x86_64.c: Likewise.
* pef.c: Likewise.
* plugin.c: Likewise.
* ppcboot.c: Likewise.
* ptrace-core.c: Likewise.
* sco5-core.c: Likewise.
* som.c: Likewise.
* sparclynx.c: Likewise.
* srec.c: Likewise.
* tekhex.c: Likewise.
* trad-core.c: Likewise.
* verilog.c: Likewise.
* versados.c: Likewise.
* vms-alpha.c: Likewise.
* vms-lib.c: Likewise.
* wasm-module.c: Likewise.
* xsym.c: Likewise.
* libbfd.h: Regenerate.
2018-02-15 01:28:06 +01:00
|
|
|
_bfd_bool_bfd_false_error,
|
2001-08-27 12:35:20 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
BFD_JUMP_TABLE_GENERIC (msdos),
|
|
|
|
BFD_JUMP_TABLE_COPY (_bfd_generic),
|
|
|
|
BFD_JUMP_TABLE_CORE (_bfd_nocore),
|
|
|
|
BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive),
|
|
|
|
BFD_JUMP_TABLE_SYMBOLS (msdos),
|
|
|
|
BFD_JUMP_TABLE_RELOCS (msdos),
|
|
|
|
BFD_JUMP_TABLE_WRITE (msdos),
|
|
|
|
BFD_JUMP_TABLE_LINK (msdos),
|
|
|
|
BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
|
|
|
|
|
|
|
|
NULL,
|
Touches most files in bfd/, so likely will be blamed for everything..
o bfd_read and bfd_write lose an unnecessary param and become
bfd_bread and bfd_bwrite.
o bfd_*alloc now all take a bfd_size_type arg, and will error if
size_t is too small. eg. 32 bit host, 64 bit bfd, verrry big files
or bugs in linker scripts etc.
o file_ptr becomes a bfd_signed_vma. Besides matching sizes with
various other types involved in handling sections, this should make
it easier for bfd to support a 64 bit off_t on 32 bit hosts that
provide it.
o I've made the H_GET_* and H_PUT_* macros (which invoke bfd_h_{get,put}_*)
generally available. They now cast their args to bfd_vma and
bfd_byte * as appropriate, which removes a swag of casts from the
source.
o Bug fixes to bfd_get8, aix386_core_vec, elf32_h8_relax_section, and
aout-encap.c.
o Zillions of formatting and -Wconversion fixes.
2001-09-18 11:57:26 +02:00
|
|
|
|
2012-07-13 16:22:50 +02:00
|
|
|
NULL
|
2001-08-27 12:35:20 +02:00
|
|
|
};
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
|