Commit Graph

1127 Commits

Author SHA1 Message Date
Jakub Jelinek 28cfee261d * elf64-alpha.c (elf64_alpha_relocate_section): Duplicate memory
value into R_ALPHA_RELATIVE's addend.
	(elf64_alpha_finish_dynamic_symbol): Likewise.
2001-08-31 19:20:12 +00:00
Nick Clifton 08bf74c587 amend entry to mention only if not USE_REL 2001-08-31 16:24:39 +00:00
Nick Clifton 5fb1c3f282 Do not rightshift recomputed addend during relocatable link if not USE_REL. 2001-08-31 16:23:25 +00:00
Nick Clifton 374b596dd6 Fix off-by-one error whilst sweeping vtable relocs 2001-08-31 16:16:14 +00:00
H.J. Lu 2bab97856d 2001-08-30 H.J. Lu <hjl@gnu.org>
* elf32-mips.c (mips_elf_calculate_relocation): Revert the last
	2 changes.
	(_bfd_mips_elf_adjust_dynamic_symbol): Allocate dynamic
	relocations for weak definitions.
2001-08-30 21:26:26 +00:00
H.J. Lu ee8a3a3be4 2001-08-30 H.J. Lu <hjl@gnu.org>
* Makefile.am (BFD32_BACKENDS): Add elf32-h8300.lo.
	(BFD32_BACKENDS_CFILES): Add elf32-h8300.c.
	* Makefile.in: Rebuild.
2001-08-30 16:02:40 +00:00
H.J. Lu 8eb59a907a 2001-08-30 H.J. Lu <hjl@gnu.org>
* elf32-mips.c (mips_elf_calculate_relocation): Don't create
	dynamic relocation for undefined weak symbols when creating
	executables. Check h->root.root.type, instead of h->root.type.
2001-08-30 15:24:18 +00:00
Tom Rix 8df8c6197a Fix for xty_ld symbols 2001-08-30 12:48:35 +00:00
Jeff Law f235248854 * elf32-h8300.c (h8_elf_howto_table): Add new PC relative
relocations.
	(h8_reloc_map): Similarly.
	(elf32_h8_final_link_relocate): Remove incorrect overflow tests.
	Add support for PC relative relocations.
2001-08-30 02:15:58 +00:00
Jeff Law 5e47149d10 * elf32-h8300.c: Put all prototypes together.
(elf32_h8_info_to_howto): Parameter elf_reloc is used.
        (elf32_h8_final_link_relocate): New function for linker.
        (elf32_h8_relocate_section): Similarly.
        (elf_backend_relocate_section): Define.
2001-08-30 00:08:12 +00:00
Phil Blundell d43ded80a7 2001-08-29 Joel Sherrill <joel@OARcorp.com>
* configure.tgt (i[3456]86-*-rtems*, m68*-*-rtems*): Change
	default from coff to elf.
2001-08-29 18:47:28 +00:00
Jeff Law eea78af13d Fix brown-paper-bag thinko in last change. 2001-08-29 18:45:18 +00:00
Jeff Law f18a3b8579 Fix typos in ChangeLog dates. 2001-08-29 17:24:40 +00:00
Jeff Law 0a83638b54 * cpu-h8300.c (h8300_scan, compatible): Prototype.
(h8300_scan): Handle architecture:machine encodings typically
        found in linker scripts.
        * elf.c (prep_headers): Do not try to do H8 machine recognition
        here.
        * elf32-h8300.c:  Add some missing prototypes.
        (elf32_h8_mach, elf32_h8_final_write_processing): New functions.
        (elf32_h8_object_p): Similarly.
2001-08-29 17:23:16 +00:00
Alan Modra 102ab33260 * targmatch.sed: Delete case statements.
* config.bfd <powerpc-*-aix* entry>: Select 64 bit xcoff for
	aix4.3 and above.
2001-08-29 03:39:47 +00:00
Joern Rennecke e01b0e6981 * Makefile.am (elf32-h8300.lo): New target.
* config.bfd (h8300*-*-elf): New case.
	* configure.in (bfd_elf32_h8300_vec): New case.
	* elf.c (prep_headers): Add case for bfd_arch_h8300.
	* reloc.c (BFD_RELOC_H8_DIR16A8): New relocation.
	(BFD_RELOC_H8_DIR16R8, BFD_RELOC_H8_DIR24A8): Likewise.
	(BFD_RELOC_H8_DIR24R8, BFD_RELOC_H8_DIR32A16): Likewise.
	* targets.c (bfd_target bfd_elf32_h8300_vec): New extern declaration.
	* elf32-h8300.c: New file.
	* Makefile.in, bfd-in2.h, libbfd.h, configure: Regenerated.
2001-08-29 01:33:52 +00:00
Nick Clifton 42ef282fe7 Add missing prototypes 2001-08-28 09:35:16 +00:00
Daniel Jacobowitz 2e67030cdb * elf32-i386.c: Add missing prototypes.
* elf32-ppc.c: Likewise.
        * elf32-sh-lin.c: Likewise.
        * elfarm-nabi.c: Likewise.
2001-08-27 18:04:37 +00:00
Daniel Jacobowitz c5fccbec35 * elf32-i386.c (elf_i386_grok_prstatus): New function.
(elf_i386_grok_psinfo): New function.
        (elf_backend_grok_prstatus): Define.
        (elf_backend_grok_psinfo): Likewise.
        * elf32-ppc.c (ppc_elf_grok_prstatus): New function.
        (ppc_elf_grok_psinfo): New function.
        (elf_backend_grok_prstatus): Define.
        (elf_backend_grok_psinfo): Likewise.
        * elf32-sh-lin.c (elf32_shlin_grok_prstatus): New function.
        (elf32_shlin_grok_psinfo): New function.
        (elf_backend_grok_prstatus): Define.
        (elf_backend_grok_psinfo): Likewise.
        * elfarm-nabi.c (elf32_arm_nabi_grok_prstatus): New function.
        (elf32_arm_nabi_grok_psinfo): New function.
        (elf_backend_grok_prstatus): Define.
        (elf_backend_grok_psinfo): Likewise.
2001-08-27 17:36:32 +00:00
H.J. Lu 14d5043ad0 2001-08-27 H.J. Lu <hjl@gnu.org>
* elf32-mips.c (mips_elf_create_dynamic_relocation): Add more
	sanity check.
	(mips_elf_calculate_relocation): Create dynamic relocation for
	symbols with weak definition or the ELF_LINK_HASH_DEF_REGULAR
	bit is not set.
2001-08-27 15:40:38 +00:00
H.J. Lu 9e80ff3a40 2001-08-27 H.J. Lu <hjl@gnu.org>
* elf32-mips.c (_bfd_mips_elf_hide_symbol): Add prototype.
	(_bfd_mips_elf_copy_indirect_symbol): Likewise.
	(_bfd_elf32_mips_grok_prstatus): Likewise.
	(_bfd_elf32_mips_grok_psinfo): Likewise.
	(_bfd_mips_elf_hide_symbol): Make it static and cast to
	`struct mips_elf_link_hash_entry *'.
	(_bfd_mips_elf_copy_indirect_symbol): Make it static.
2001-08-27 14:47:33 +00:00
Nick Clifton e4b172749c Add missing prototypes 2001-08-27 10:35:20 +00:00
Alan Modra 5bd4f1692e * config.bfd: Add powerpc64 target. Add powerpc64 vectors to
targ64_selvecs for 32 bit powerpc targets.
	* Makefile.am (BFD64_BACKENDS): Add elf64-ppc.lo.
	(BFD64_BACKENDS_CFILES): Add elf64-ppc.c.
	Run "make dep-am".
	* Makefile.in: Regenerate.
	* configure.in: Add elf64_powerpc vecs.
	* configure: Regenerate.
	* cpu-powerpc.c: Default to bfd_mach_ppc_620 entry for 64 bit.
	* elf.c (prep_headers): EM_PPC64 for 64 bit ppc elf target.
	* targets.c: Add bfd_elf64_powerpc_vec and bfd_elf64_powerpcle_vec.
	* elf64-ppc.c: New file.
	* reloc.c: Add powerpc64 relocs.
	* libbfd.h: Regenerate.
	* bfd-in2.h: Regenerate.
2001-08-27 10:22:03 +00:00
Andreas Schwab aa91b392b3 * elf32-m68k.c (elf32_m68k_check_relocs): Set DF_TEXTREL if the
reloc is against read-only section.
	(elf32_m68k_size_dynamic_sections): Use DF_TEXTREL flag instead of
	looking up section names for DT_TEXTREL.
	(elf32_m68k_reloc_type_class): New function.
	(elf_backend_reloc_type_class): Define.
2001-08-27 09:16:10 +00:00
Andreas Jaeger 29c2fb7c2b * elf64-s390.c (elf_s390_check_relocs): Set DF_TEXTREL if the
reloc is against read-only section.
	(elf_s390_size_dynamic_sections): Use DF_TEXTREL flag instead of
	looking up section names for DT_TEXTREL.
	(elf_s390_reloc_type_class): New.
	(elf_backend_reloc_type_class): Define.

	* elf32-s390.c (elf_s390_check_relocs): Set DF_TEXTREL if the
	reloc is against read-only section.
	(elf_s390_size_dynamic_sections): Use DF_TEXTREL flag instead of
	looking up section names for DT_TEXTREL.
	(elf_s390_reloc_type_class): New.
	(elf_backend_reloc_type_class): Define.

	* elf32-ppc.c (ppc_elf_check_relocs): Set DF_TEXTREL if the reloc
	is against read-only section.
	(ppc_elf_size_dynamic_sections): Use DF_TEXTREL flag instead of
	looking up section names for DT_TEXTREL.
	(ppc_elf_reloc_type_class): New.
	(elf_backend_reloc_type_class): Define.
2001-08-27 08:59:08 +00:00
Andreas Jaeger 99e4ae17b9 * elf32-cris.c (cris_elf_check_relocs): Set DF_TEXTREL if the
reloc is against read-only section.
	(elf_cris_size_dynamic_sections): Use DF_TEXTREL flag instead of
	looking up section names for DT_TEXTREL.
	(elf_cris_reloc_type_class): New.
	(elf_backend_reloc_type_class): Define.

	* elf32-sh.c (sh_elf_check_relocs): Set DF_TEXTREL if the reloc is
	against read-only section.
	(elf_backend_reloc_type_class): Define.
	(sh_elf_reloc_type_class): New.
	(sh_elf_size_dynamic_sections): Use DF_TEXTREL flag instead of
	looking up section names for DT_TEXTREL.

	* elf32-arm.h (elf32_arm_check_relocs): Set DF_TEXTREL if the
	reloc is against read-only section.
	(elf32_arm_size_dynamic_sections): Use DF_TEXTREL flag instead of
	looking up section names for DT_TEXTREL.
	(elf32_arm_reloc_type_class): New.
2001-08-26 18:03:19 +00:00
Andreas Jaeger 24a35864ab * oasys.c: Add missing prototypes.
* elf64-alpha.c (elf64_alpha_size_dynamic_sections): Add unused
	attribute for parameter.
	* elf.c (_bfd_elf_reloc_type_class): Likewise.

	* versados.c (get_4): Make static.
	(get_10): Make static.
	Add missing prototypes.
	(process_esd): Fix call to versados_new_symbol.
2001-08-26 11:46:04 +00:00
Nick Clifton 917583ad77 Add missing prototypes 2001-08-25 09:49:44 +00:00
Thiemo Seufer aee61b1396 * elf32-mips.c (elf_mips_abi_name): Return the right ABI string for
E_MIPS_ABI_O64 and E_MIPS_ABI_EABI64
2001-08-25 01:27:54 +00:00
H.J. Lu b0f35f365d 2001-08-24 H.J. Lu <hjl@gnu.org>
* elf.c (_bfd_elf_merge_sections): Fail if not using an ELF
	hash structure.
2001-08-24 20:10:25 +00:00
Nick Clifton 8ea2e4bd70 Apply H.J.'s patch to revert change to elfxx-target.h
Apply my patch to allow SREC as output format.
2001-08-24 16:36:04 +00:00
Alexandre Oliva 8c98ec7dcc * bfd.c (bfd_alt_mach_code): New function.
* bfd-in2.h: Rebuilt.
2001-08-24 13:55:55 +00:00
Alexandre Oliva 17ea634937 * elf-m10300.c (mn10300_elf_relocate_section): Test the right
`type' field in the hash entry when deciding whether to follow a
link.
2001-08-24 13:14:46 +00:00
Jakub Jelinek fcfbdf319e * elflink.h (elf_link_sort_cmp1): Sort RELATIVE relocs first, not
last.
	(elf_link_sort_relocs): Adjust accordingly.

	* elf64-alpha.c (struct alpha_elf_link_hash_entry): Add reltext flag.
	(elf64_alpha_check_relocs): Set it if section this reloc is against
	is read-only.  Set DF_TEXTREL if a RELATIVE reloc is needed against
	read-only section.
	(elf64_alpha_calc_dynrel_sizes): Set DF_TEXTREL flag if relocation
	is is against read-only section.
	(elf64_alpha_size_dynamic_sections): Use DF_TEXTREL flag, don't
	check section names.
	(elf64_alpha_reloc_type_class): New.
	(elf_backend_reloc_type_class): Define.
2001-08-24 11:17:30 +00:00
Thiemo Seufer f6be24f9a4 * linker.c (_bfd_generic_link_add_archive_symbols): Replace alloca()
by bfd_malloc().
2001-08-24 03:56:28 +00:00
Andreas Jaeger 8df9fc9d6a * elf64-x86-64.c (elf64_x86_64_check_relocs): Set DF_TEXTREL if
the reloc is against read-only section.
	(elf64_x86_64_size_dynamic_sections): Use DF_TEXTREL flag instead
	of looking up section names for DT_TEXTREL.
	(elf64_x86_64_reloc_type_class): New.
	(elf_backend_reloc_type_class): Define.
2001-08-23 18:14:29 +00:00
Nick Clifton f4ffd77818 Add more missing prototypes 2001-08-23 17:05:52 +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
Nick Clifton 67a374a5f1 Add missing prototypes for bout.c 2001-08-23 15:30:34 +00:00
Jakub Jelinek db6751f2e7 * elf-bfd.h (enum elf_reloc_type_class): New.
(struct elf_backend_data): Add elf_backend_reloc_type_class.
	(_bfd_elf_reloc_type_class): New.
	* elfxx-target.h (elf_backend_reloc_type_class): Define.
	(elfNN_bed): Add elf_backend_reloc_type_class.
	* elf.c (_bfd_elf_reloc_type_class): New.
	* elf32-i386.c (elf_i386_check_relocs): Set DF_TEXTREL if the reloc
	is against read-only section.
	(elf_i386_size_dynamic_sections): Use DF_TEXTREL flag instead of
	looking up section names for DT_TEXTREL.
	(elf_i386_reloc_type_class): New.
	(elf_backend_reloc_type_class): Define.
	* elf32-sparc.c (elf32_sparc_check_relocs): Set DF_TEXTREL if the
	reloc is against read-only section.
	(elf32_sparc_size_dynamic_sections): Use DF_TEXTREL flag instead of
	looking up section names for DT_TEXTREL.
	(elf32_sparc_reloc_type_class): New.
	(elf_backend_reloc_type_class): Define.
	* elf64-sparc.c (sparc64_elf_check_relocs): Set DF_TEXTREL if the
	reloc is against read-only section.
	(sparc64_elf_size_dynamic_sections): Use DF_TEXTREL flag instead of
	looking up section names for DT_TEXTREL.
	(sparc64_elf_reloc_type_class): New.
	(elf_backend_reloc_type_class): Define.
	* elfxx-ia64.c (struct elfNN_ia64_link_hash_table): Add reltext field.
	(elfNN_ia64_hash_table_create): Clear ia64_info.
	(get_reloc_section): Set DF_TEXTREL if the reloc is against read-only
	section.
	(elfNN_ia64_size_dynamic_sections): Use ia64_info->reltext flag
	instead of looking up section names for DT_TEXTREL.
	(elfNN_ia64_reloc_type_class): New.
	(elf_backend_reloc_type_class): Define.
	* elflink.h (size_dynamic_sections): Add spare DT_NULL tags.
	(struct elf_link_sort_rela): New.
	(elf_link_sort_cmp1, elf_link_sort_cmp2, elf_link_sort_relocs): New.
	(elf_bfd_final_link): Call elf_link_sort_relocs.
	Convert one spare DT_NULL into DT_RELCOUNT resp. DT_RELACOUNT if
	necessary.

	* bfdlink.h (struct bfd_link_info): Add combreloc and
	spare_dynamic_tags fields.

	* emultempl/elf32.em (place_orphan): Place orphan .rel* sections
	into .rel.dyn resp. .rela.dyn if combreloc.
	(get_script): If .x linker script is equal to .xn, only put it
	once into the binary.
	Add .xc and .xsc scripts.
	(parse_args): Handle -z combreloc and -z nocombreloc.
	* scripttempl/elf.sc (.rela.sbss): Fix a typo.
	For .xc and .xsc scripts put all .rel* or .rela* input sections
	but .rel*.plt and PLT-like sections into .rel.dyn resp. .rela.dyn.
	* genscripts.sh (GENERATE_COMBRELOC_SCRIPT): Set if SCRIPT_NAME
	is elf.
	Strip trailing whitespace from script.
	Generate .xc and .xsc scripts if requested.
	* ldmain.c (main): Initialize link_info.combreloc and
	link_info.spare_dynamic_tags.
	* lexsup.c (OPTION_SPARE_DYNAMIC_TAGS): Define.
	(ld_options): Add --spare-dynamic-tags option.
	(parse_args): Likewise.
	* ld.texinfo: Document -z combreloc and -z nocombreloc.
	* ldint.texinfo: Document .xc and .xsc linker scripts.
	* NEWS: Add notes about -z combreloc and SHF_MERGE.
2001-08-23 15:14:18 +00:00
Nick Clifton 7e3b3466d0 No corefile support for x86-bsdi systems 2001-08-23 14:33:50 +00:00
Nick Clifton 26cd54bf89 Add missing comma 2001-08-22 08:43:00 +00:00
DJ Delorie 4f6fbb1acd * coff-go32.c: Set the alignment of dwarf2 linkonce sections to 0.
* coff-stgo32.c: Likewise.
2001-08-21 22:39:47 +00:00
DJ Delorie a7bda527f6 * coff-go32.c: Make DWARF2 sections use an alignment of 0.
* coff-sto32.c: Likewise.
2001-08-21 20:23:38 +00:00
Andreas Jaeger 5a65713f64 * coff-sparc.c: Add missing prototypes.
* elf32-s390.c: Likewise.
	* elf32-i960.c: Likewise.
	* aout-target.h: Likewise.
2001-08-21 08:40:23 +00:00
H.J. Lu 4e89ac30f3 2001-08-20 H.J. Lu <hjl@gnu.org>
* elf-bfd.h (elf_obj_tdata): Add num_section_syms.
	(elf_num_section_syms): New for num_section_syms.

	* elf.c (elf_map_symbols): Set num_section_syms.
	(_bfd_elf_symbol_from_bfd_symbol): Check num_section_syms for
	the section symbol index.
2001-08-21 01:02:41 +00:00
Nick Clifton 28db233b6c Never select the generic has table creator. All elf backends need elf specific
fields in the hash table.
2001-08-20 14:28:46 +00:00
Alan Modra ba3ef70e78 * archive.c (offsetof): Remove define.
* elf.c: Likewise.
	* oasys.c: Likewise
	* sysdep.h (offsetof): Define.
2001-08-19 23:42:47 +00:00
Alan Modra c0846b2397 * bfd.c (bfd_get_gp_size): Return an unsigned int.
(bfd_set_gp_size): Make param unsigned.
	* bfd-in2.h: Regenerate.
	* elf32-ppc.c (ppc_elf_add_symbol_hook): Use elf_gp_size rather
	than calling bfd_get_gp_size.
	* elf64-alpha.c (elf64_alpha_add_symbol_hook): Likewise.
	* elfxx-ia64.c (elfNN_ia64_add_symbol_hook): Likewise.
2001-08-17 15:56:58 +00:00
Alan Modra 0ac450b689 * linker.c (default_fill_link_order): Handle four byte fill value. 2001-08-17 09:50:05 +00:00