Alan Modra
9bab7074b0
Replace bfd_alloc/bfd_malloc + memset with bfd_zalloc/bfd_zmalloc
2002-06-07 15:04:49 +00:00
Alan Modra
e61463e1e6
* bfd-in.h: Remove "taken from the source" comment.
...
* libbfd-in.h: Likewise.
* libcoff-in.h: Likewise.
* bfd-in2.h: Regenerate.
* libbfd.h: Regenerate.
* libcoff.h: Regenerate.
* elf.c (bfd_elf_discard_group): Return true.
* elf-bfd.h (bfd_elf_discard_group): Declare.
* bfd-in.h (bfd_elf_discard_group): Don't declare here.
* section.c (bfd_discard_group): Rename to bfd_generic_discard_group.
* bfd.c (bfd_discard_group): Define.
* targets.c (struct bfd_target): Add _bfd_discard_group.
(BFD_JUMP_TABLE_LINK): Here too.
* libbfd-in.h (_bfd_nolink_bfd_discard_group): Define.
* aout-adobe.c (aout_32_bfd_discard_group): Define.
* aout-target.h (MY_bfd_discard_group): Define.
* aout-tic30.c (MY_bfd_discard_group): Define.
* binary.c (binary_bfd_discard_group): Define.
* bout.c (b_out_bfd_discard_group): Define.
* coff-alpha.c (_bfd_ecoff_bfd_discard_group): Define.
* coffcode.h (coff_bfd_discard_group): Define.
* coff-mips.c (_bfd_ecoff_bfd_discard_group): Define.
* elfxx-target.h (bfd_elfNN_bfd_discard_group): Define.
* i386msdos.c (msdos_bfd_discard_group): Define.
* i386os9k.c (os9k_bfd_discard_group): Define.
* ieee.c (ieee_bfd_discard_group): Define.
* ihex.c (ihex_bfd_discard_group): Define.
* mmo.c (mmo_bfd_discard_group): Define.
* nlm-target.h (nlm_bfd_discard_group): Define.
* oasys.c (oasys_bfd_discard_group): Define.
* ppcboot.c (ppcboot_bfd_discard_group): Define.
* som.c (som_bfd_discard_group): Define.
* srec.c (srec_bfd_discard_group): Define.
* tekhex.c (tekhex_bfd_discard_group): Define.
* versados.c (versados_bfd_discard_group): Define.
* vms.c (vms_bfd_discard_group): Define.
* xcoff-target.h (_bfd_xcoff_bfd_discard_group): Define.
* coff64-rs6000.c (rs6000coff64_vec): Update initialiser.
(aix5coff64_vec): Likewise.
* coff-rs6000.c (rs6000coff_vec, pmac_xcoff_vec): Likewise.
2002-06-05 03:43:11 +00:00
Alan Modra
2d653fc760
Fix ld --just-symbols
...
* aix5ppc-core.c: Warning fixes.
* aout-adobe.c (aout_32_bfd_link_just_syms): Define.
* aout-target.h (MY_bfd_link_just_syms): Define.
* aout-tic30.c (MY_bfd_link_just_syms): Define.
* bfd.c (bfd_link_just_syms): Define.
* binary.c (binary_bfd_link_just_syms): Define.
* bout.c (b_out_bfd_link_just_syms): Define.
* coff-rs6000.c (rs6000coff_vec, pmac_xcoff_vec): Update initializer.
* coff64-rs6000.c (rs6000coff64_vec, aix5coff64_vec): Likewise.
* coffcode.h (coff_bfd_link_just_syms): Define.
* elf-bfd.h (enum elf_link_info_type): Add ELF_INFO_TYPE_JUST_SYMS.
(elf_discarded_section): Check for ELF_INFO_TYPE_JUST_SYMS.
(_bfd_elf_link_just_syms): Declare.
* elf.c (_bfd_elf_link_just_syms): New function.
* elf-eh-frame.c (_bfd_elf_maybe_strip_eh_frame_hdr): Check that
sections haven't already been discarded by the linker.
* elflink.h (elf_link_add_object_symbols): Likewise for stab
sections and SEC_MERGE sections.
(elf_bfd_discard_info): Similarly here.
* elfxx-target.h (bfd_elfNN_bfd_link_just_syms): Define.
* i386msdos.c (msdos_bfd_link_just_syms): Define.
* i386os9k.c (os9k_bfd_link_just_syms): Define.
* ieee.c (ieee_bfd_link_just_syms): Define.
* ihex.c (ihex_bfd_link_just_syms): Define.
* libbfd-in.h (_bfd_nolink_bfd_link_just_syms): Define.
(_bfd_generic_link_just_syms): Declare.
* libecoff.h (_bfd_ecoff_bfd_link_just_syms): Define.
* linker.c (_bfd_generic_link_just_syms): New function.
* mmo.c (mmo_bfd_link_just_syms): Define.
* nlm-target.h (nlm_bfd_link_just_syms): Define.
* oasys.c (oasys_bfd_link_just_syms): Define.
* ppcboot.c (ppcboot_bfd_link_just_syms): Define.
* som.c (som_bfd_link_just_syms): Define.
* srec.c (srec_bfd_link_just_syms): Define.
* targets.c (struct bfd_target): Add _bfd_link_just_syms.
(BFD_JUMP_TABLE_LINK): And here.
* tekhex.c (tekhex_bfd_link_just_syms): Define.
* versados.c (versados_bfd_link_just_syms): Define.
* vms.c (vms_bfd_link_just_syms): Define.
* libbfd.h: Regenerate.
* bfd-in2.h: Regenerate.
2002-05-15 00:18:58 +00:00
Daniel Jacobowitz
e2d34d7de2
2002-04-04 Daniel Jacobowitz <drow@mvista.com>
...
* aout-adobe.c (aout_32_bfd_link_hash_table_free): Define.
* aout-target.h (MY_bfd_link_hash_table_free): Conditionally
define.
* aout-tic30.c (MY_bfd_link_hash_table_free): Likewise.
* bfd.c (bfd_link_hash_table_free): Define.
* binary.c (binary_bfd_link_hash_table_free): Define.
* bout.c (b_out_bfd_link_hash_table_free): Define.
* coff-rs6000.c (rs6000coff_vec): Include
_bfd_generic_link_hash_table_free.
(pmac_xcoff_vec): Likewise.
* coff64-rs6000.c (rs6000coff64_vec): Likewise.
(aix5coff64_vec): Likewise.
* coffcode.h (coff_bfd_link_hash_table_free): Conditionally define.
* elf-m10300.c (elf32_mn10300_link_hash_table_free): New function.
(bfd_elf32_bfd_link_hash_table_free): Define.
* elf32-hppa.c (elf32_hppa_link_hash_table_free): New function.
(bfd_elf32_bfd_link_hash_table_free): Define.
* elfxx-target.h (bfd_elfNN_bfd_link_hash_table_free): Conditionally
define.
* i386msdos.c (msdos_bfd_link_hash_table_free): Define.
* i386os9k.c (os9k_bfd_link_hash_table_free): Define.
* ieee.c (ieee_bfd_link_hash_table_free): Define.
* ihex.c (ihex_bfd_link_hash_table_free): Define.
* libbfd-in.h (_bfd_nolink_bfd_link_hash_table_free): Define.
(_bfd_generic_link_hash_table_free): Add prototype.
* libcoff-in.h (_bfd_xcoff_bfd_link_hash_table_free): Add prototype.
* libecoff.h (_bfd_ecoff_bfd_link_hash_table_free): Define.
* linker.c (_bfd_generic_link_hash_table_free): New function.
* mmo.c (mmo_bfd_link_hash_table_free): Define.
* nlm-target.h (nlm_bfd_link_hash_table_free): Define.
* oasys.c (oasys_bfd_link_hash_table_free): Define.
* ppcboot.c (ppcboot_bfd_link_hash_table_free): Define.
* som.c (som_bfd_link_hash_table_free): Define.
* srec.c (srec_bfd_link_hash_table_free): Define.
* tekhex.c (tekhex_bfd_link_hash_table_free): Define.
* versados.c (versados_bfd_link_hash_table_free): Define.
* vms.c (vms_bfd_link_hash_table_free): New function.
* xcofflink.c (_bfd_xcoff_bfd_link_hash_table_free): New function.
* coff-arm.c (coff_arm_link_hash_table_create): Use bfd_malloc
instead of bfd_alloc.
* coff-h8300.c (h8300_coff_link_hash_table_create): Likewise.
* coff-mcore.c (coff_mcore_link_hash_table_create): Likewise.
* coff-ppc.c (ppc_coff_link_hash_table_create): Likewise.
* cofflink.c (_bfd_coff_link_hash_table_create): Likewise.
* ecoff.c (_bfd_ecoff_bfd_link_hash_table_create): Likewise.
* elf-m10300.c (elf32_mn10300_link_hash_table_create): Likewise.
* elf.c (_bfd_elf_link_hash_table_create): Likewise.
* elf32-arm.h (elf32_arm_link_hash_table_create): Likewise.
* elf32-cris.c (elf_cris_link_hash_table_create): Likewise.
* elf32-hppa.c (elf32_hppa_link_hash_table_create): Likewise.
* elf32-i386.c (elf_i386_link_hash_table_create): Likewise.
* elf32-m68k.c (elf_m68k_link_hash_table_create): Likewise.
* elf32-s390.c (elf_s390_link_hash_table_create): Likewise.
* elf32-sh.c (sh_elf_link_hash_table_create): Likewise.
* elf64-alpha.c (elf64_alpha_bfd_link_hash_table_create): Likewise.
* elf64-ppc.c (ppc64_elf_link_hash_table_create): Likewise.
* elf64-s390.c (elf_s390_link_hash_table_create): Likewise.
* elf64-sh64.c (sh64_elf64_link_hash_table_create): Likewise.
* elf64-sparc.c (sparc64_elf_bfd_link_hash_table_create): Likewise.
* elf64-x86-64.c (elf64_x86_64_link_hash_table_create): Likewise.
* elfxx-mips.c (_bfd_mips_elf_link_hash_table_create): Likewise.
* linker.c (_bfd_generic_link_hash_table_create): Likewise.
* m68klinux.c (linux_link_hash_table_create): Likewise.
* sparclinux.c (linux_link_hash_table_create): Likewise.
* sunos.c (sunos_link_hash_table_create): Likewise.
* xcofflink.c (_bfd_xcoff_bfd_link_hash_table_create): Likewise.
* targets.c: Add _bfd_link_hash_table_free to xvec.
* bfd-in2.h: Regenerate.
* libbfd.h: Regenerate.
* libcoff.h: Regenerate.
2002-04-04 19:53:38 +00:00
Alan Modra
7b45c6e1da
comment typo fixes
2002-01-21 14:03:27 +00:00
Nick Clifton
21da9f89f2
Initialize subspace_sections.
2001-11-02 16:19:54 +00:00
Kazu Hirata
08da05b004
* aout-encap.c: Fix comment typos.
...
* aoutx.h: Likewise.
* archive.c: Likewise.
* bout.c: Likewise.
* coff64-rs6000.c: Likewise.
* coffcode.h: Likewise.
* coffgen.c: Likewise.
* cofflink.c: Likewise.
* coff-mips.c: Likewise.
* ecoff.c: Likewise.
* elf32-m32r.c: Likewise.
* libcoff-in.h: Likewise.
* libecoff.h: Likewise.
* libxcoff.h: Likewise.
* nlm32-i386.c: Likewise.
* pdp11.c: Likewise.
* section.c: Likewise.
* som.c: Likewise.
* som.h: Likewise.
* bfd-in2.h: Regenerate.
* libcoff.h: Likewise.
2001-10-10 12:08:29 +00:00
Jeff Law
1761749581
* som.h (som_exec_data): New field "version_id".
...
* som.c (som_object_setup): Record the version_id if it
exists.
(som_prep_headers): Do not initialize version_id here.
(som_finish_writing): Initialize version_id here.
2001-10-05 21:55:12 +00:00
Alan Modra
21d17a588f
* som.c (som_write_symbol_strings): Cast current_offset in
...
bfd_seek call to match param type.
2001-09-29 06:13:53 +00:00
Joel Brobecker
982cfd7867
som_write_symbol_strings: Fix incorrect type of current_offset to match
...
the function definition. Fixes a build failure on HPUX-11.00.
2001-09-28 21:35:45 +00:00
H.J. Lu
3882b01078
Locale changes from Bruno Haible <haible@clisp.cons.org>.
2001-09-19 05:33:36 +00:00
Alan Modra
dc810e3900
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 09:57:26 +00:00
H.J. Lu
60b89a1878
2001-08-23 H.J. Lu <hjl@gnu.org>
...
* syms.c (bfd_print_symbol_vandf): Add abfd to arg.
* bfd-in2.h (bfd_print_symbol_vandf): Regenerated.
* aoutx.h (NAME(aout,print_symbol)): Pass abfd to
bfd_print_symbol_vandf.
* coffgen.c (coff_print_symbol): Likewise.
* elf.c (bfd_elf_print_symbol): Likewise.
* ieee.c (ieee_print_symbol): Likewise.
* nlmcode.h (nlm_print_symbol): Likewise.
* oasys.c (oasys_print_symbol): Likewise.
* pdp11.c (NAME(aout,print_symbol)): Likewise.
* som.c (som_print_symbol): Likewise.
* srec.c (srec_print_symbol): Likewise.
* tekhex.c (tekhex_print_symbol): Likewise.
* versados.c (versados_print_symbol): Likewise.
* vms.c (vms_print_symbol): Likewise.
* elf.c (_bfd_elf_print_private_bfd_data): Replace fprintf_vma
with bfd_fprintf_vma.
(bfd_elf_print_symbol): Likewise.
* syms.c (bfd_print_symbol_vandf): Likewise.
2001-08-23 15:45:19 +00:00
Jakub Jelinek
8550eb6e64
* 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 12:23:48 +00:00
Nick Clifton
7898dedac0
Update copyright notices
2001-03-08 21:04:02 +00:00
Kazu Hirata
7eae7d229a
2001-01-04 Kazu Hirata <kazu@hxi.com>
...
* som.c: Fix formatting.
2001-01-04 23:27:08 +00:00
Kazu Hirata
6fa957a9b9
2000-12-14 Kazu Hirata <kazu@hxi.com>
...
* peigen.c: Fix formatting.
* som.c: Likewise.
* som.h: Likewise.
2000-12-14 21:38:31 +00:00
Alan Modra
6204760d74
* som.c: Include alloca-conf.h
2000-09-28 08:08:16 +00:00
Alan Modra
409141842e
Make weak symbols SS_UNIVERSAL (ie. global)
2000-09-26 01:45:26 +00:00
Jeff Law
8681fbcd21
* som.c (som_write_symbol_strings): Do not used fixed buffers,
...
use size_t as a counter.
(som_write_space_strings): Similarly.
2000-09-14 01:33:46 +00:00
Jeff Law
7dca057bba
* som.c (struct fixup_format): Constify `format'.
...
(som_hppa_howto_table): Use SOM_HOWTO macro.
(try_prev_fixup, hppa_som_reloc): Decorate unused parameter.
(som_bfd_reloc_type_lookup): Likewise.
(compare_subspaces): Remove unused `count1', `count2'.
(som_begin_writing): Remove unused `total_reloc_size'.
(som_bfd_derive_misc_symbol_info): Decorate unused parameter.
(som_print_symbol, som_bfd_is_local_label_name): Likewise.
(som_set_reloc_info): Constify `cp'. Remove unused `addend'.
(som_find_nearest_line): Decorate unused parameter(s).
(som_sizeof_headers, som_get_symbol_info, som_write_armap): Likewise.
(som_bfd_link_split_section): Likewise.
2000-08-04 15:17:37 +00:00
Catherine Moore
10febd8491
* som.c (som_decode_symclass): Recognize weak symbols.
2000-05-16 14:20:10 +00:00
Jeff Law
36e89602d2
* som.c (SOM_HOWTO): Define.
...
(som_hppa_howto_table): Use it.
2000-02-26 01:45:22 +00:00
Catherine Moore
ba20314ec2
* som.c (som_misc_symbol_info): Add field
...
secondary_def.
(som_bfd_derive_misc_symbol_info): Initialize
secondary_def.
(som_build_and_write_symbol_table): Keep track
of secondary_def field.
(som_slurp_symbol_table): Set BSF_WEAK symbol flag
if secondary_def field is set.
(som_bfd_ar_write_symbol_stuff): Initialize
secondary_def.
2000-02-24 13:41:02 +00:00
Nick Clifton
77fb9c28ac
Revert previous patch.
1999-12-10 18:51:35 +00:00
Nick Clifton
ad247e3c7d
Change AR for ELF so that common symbols are not included in archive map.
...
Change LD for ELF so that archive elements whoes archive map contains a
reference to a common symbol will get linkled in.
Add new field to bfd_target structure and initialise it for all bfd targets.
1999-12-10 01:41:22 +00:00
Jeff Law
832fc2027d
* som.c (som_fixup_formats): Improve handling of R_AUX_UNWIND,
...
R_LINETAB, R_LINETAB_ESC, and R_COMMENT.
1999-11-02 08:46:25 +00:00
Jeff Law
2667095fc0
* som.c (NO_PCREL_MODES): Define if the system does not define
...
R_SHORT_PCREL_MODE.
(hppa_som_gen_reloc_type): Handle both short and long pcrel branches.
(som_write_fixups): Eliminate redundant pcrel mode relocs. Handle
R_LONG_PCREL_MODE and R_SHORT_PCREL_MODE
* libhppa.h (dis_assemble_22): New function.
(bfd_hppa_insn2fmt): Handle long branch.
* libhppa.h (bfd_hppa_insn2fmt): Decode and handle formats found
in PA2.0.
1999-09-19 18:22:20 +00:00
Jeff Law
7da1b1756d
* som.c (som_slurp_symbol_table): Fix typo in comment.
1999-08-24 06:26:39 +00:00
Nick Clifton
c3c89269f8
Add new field to bfd_target structure.
...
Initialise this field for all known bfd targets.
Add new search function to targets.c
1999-07-19 14:55:16 +00:00
Jeff Law
c10067812f
M
...
* som.c (som_fixup_formats): Fix comments for R_SHORT_PCREL_MODE
and R_LONG_PCREL_MODE.
1999-05-03 09:12:29 +00:00
Richard Henderson
252b5132c7
19990502 sourceware import
1999-05-03 07:29:11 +00:00