Commit Graph

1090 Commits

Author SHA1 Message Date
H.J. Lu 824e2cb428 2001-07-11 H.J. Lu <hjl@gnu.org>
* elf64-alpha.c (elf64_alpha_check_relocs): Set the ALLOC|LOAD
	flags when creating the reloc section if the ALLOC flag in the
	source section is set.
2001-07-12 04:24:44 +00:00
Jim Wilson a4bd839069 sje patch for 32-bit IA-64 ELF relocs for HPUX
* reloc.c (bfd_reloc_code_type): Add IA64 relocs
	BFD_RELOC_IA64_LTOFF_FPTR32MSB and BFD_RELOC_IA64_LTOFF_FPTR32LSB
	* bfd-in2.h: Regenerate.
	* libbfd.h: Regenerate.
	* elfxx-ia64.c (ia64_howto_table): Define how to handle
	new relocations.
	(elfNN_ia64_reloc_type_lookup): Handle new relocations.
	(elfNN_ia64_check_relocs): Likewise.
	(elfNN_ia64_install_value): Likewise.
	(elfNN_ia64_relocate_section): Likewise.
2001-07-12 01:24:14 +00:00
Jakub Jelinek 20278fa326 * elf32-sparc.c (_bfd_sparc_elf_howto_table): Remove support for
R_SPARC_UA64.
	(elf32_sparc_check_relocs): Likewise.
	Only create .rela section for alloced sections in shared libraries.
	(elf32_sparc_relocate_section): Likewise.
	Remove redundant check.
	Optimize unaligned reloc usage.
	* elf64-sparc.c (sparc64_elf_relocate_section): Remove redundant
	check.

	* testsuite/gas/sparc/unalign.s: Remove .uaxword test.
	* testsuite/gas/sparc/unalign.d: Adjust accordingly.
2001-07-11 19:40:32 +00:00
H.J. Lu 067a7d17c4 2001-07-11 H.J. Lu <hjl@gnu.org>
* elf64-alpha.c (elf64_alpha_check_relocs): Only use the same
	ALLOC|LOAD flags as the source section for debugging sections
	when creating the reloc section.
2001-07-11 19:03:10 +00:00
Jim Wilson 0a2afbc13a Fix ia64-linux fortran common linking problem.
* linker.c (_bfd_generic_link_add_one_symbol, case BIG): Use
	the section of the bigger symbol.
2001-07-05 22:40:16 +00:00
Jim Wilson a78f18dc3a Fix ia64-linux binutils readelf -s testsuite failure.
* syms.c (bfd_is_local_label): Return false if BSF_SECTION_SYM.
2001-07-05 18:27:55 +00:00
Nick Clifton 0515494aac For sections containing uninitialised data, only set their size to s_paddr
if this does not reset their size to zero.  MS's latest compilers will set
s_paddr to zero.
2001-07-05 10:52:25 +00:00
H.J. Lu 5e7079af51 2001-07-04 H.J. Lu <hjl@gnu.org>
* bfd/elf32-mips.c (_bfd_mips_elf_final_write_processing):
	Handle bfd_mach_mips4400, bfd_mach_mips4600 and
	bfd_mach_mips5000.
2001-07-04 07:15:20 +00:00
Nick Clifton f47e50716b Support DJGPP COFF targets in bfd_get_sign_extend_vma() 2001-07-03 16:27:45 +00:00
Nick Clifton 440c46077c Skip section symbols from sections being discarded 2001-07-03 15:49:46 +00:00
Alan Modra 936e320bf4 * elfcore.h (elf_core_file_p): Call bfd_section_from_phdr directly
instead of _bfd_elfcore_section_from_phdr.
	* elf-bfd.h (_bfd_elfcore_section_from_phdr): Remove.
	* elf.c (_bfd_elfcore_section_from_phdr): Remove.
	(_bfd_elfcore_make_pseudosection): Expedite tail-call.
	(elfcore_grok_prstatus): Likewise.
	(elfcore_grok_lwpstatus): Likewise.
	(bfd_get_elf_phdr_upper_bound): Likewise.
	(elfcore_make_note_pseudosection): Formatting.
	(_bfd_elfcore_strndup): Formatting.
	* elf32-mips.c (mips_elf_sym_is_global): Formatting.
	(_bfd_elf32_mips_grok_prstatus): Expedite tail-call.
2001-06-30 04:05:13 +00:00
Alan Modra bb0082d686 * elf-bfd.h: Add prototypes for _bfd_elfcore_make_pseudosection
and _bfd_elfcore_strndup.
	(struct elf_backend_data): Add elf_backend_grok_prstatus
	and elf_backend_grok_psinfo.
	* elf.c (_bfd_elfcore_make_pseudosection): New function.
	(elfcore_grok_prstatus): Use it.
	(elfcore_make_note_pseudosection): Likewise.
	(elfcore_strndup):  Rename to...
	(_bfd_elfcore_strndup): Here, and make global.
	(elfcore_grok_psinfo): Use _bfd_elfcore_strndup.
	(elfcore_grok_note): Call elf_backend_grok_prstatus
	and elf_backend_grok_psinfo if available.
	* elf32-mips.c (_bfd_elf32_mips_grok_prstatus): New function.
	(_bfd_elf32_mips_grok_psinfo): New function.
	(elf_backend_grok_prstatus): Define.
	(elf_backend_grok_psinfo): Define.
	* elfxx-target.h (elf_backend_grok_prstatus): Default to NULL.
	(elf_backend_grok_psinfo): Likewise.
	(elfNN_bed): Include elf_backend_grok_prstatus and
	elf_backend_grok_psinfo.
2001-06-30 03:15:46 +00:00
H.J. Lu b64977c5ff 2001-06-29 H.J. Lu <hjl@gnu.org>
* elf32-hppa.c (elf32_hppa_finish_dynamic_sections): Check if
	hplink->sgot is NULL before filling GOT. Checck if hplink->splt
	is NULL before filling PLT.
2001-06-30 00:34:10 +00:00
Alan Modra e45bf86378 * elflink.h (elf_link_output_extsym): Revert 1999-04-10. 2001-06-29 07:00:33 +00:00
Alan Modra 446f286313 Avoid creating COPY relocs.
* elf32-hppa.c (elf32_hppa_check_relocs): Don't make syms dynamic
	here..
	(elf32_hppa_adjust_dynamic_symbol): ..nor here..
	(allocate_plt_and_got_and_discard_relocs): .. instead do so here
	after gc has run.
	* elf32-hppa.c (RELATIVE_DYNAMIC_RELOCS): Delete.
	(IS_ABSOLUTE_RELOC): Define.
	(elf32_hppa_link_hash_entry): Always include reloc_entries field.
	(hppa_link_hash_newfunc): Always init it.
	(elf32_hppa_check_relocs): Mark symbols as ELF_LINK_NON_GOT_REF to
	create COPY relocs only when the reloc is in a read-only section.
	Instead, allocate space for a dynamic reloc to reference the
	library symbol directly.  Keep track of space we allocate using
	relocs_entries.
	(hppa_discard_copies): Delete, and move code to..
	(allocate_plt_and_got): ..here.  Rename to
	allocate_plt_and_got_and_discard_relocs.  Remove unneeded dynamic
	relocs for non-shared link.
	(elf32_hppa_size_dynamic_sections): Update calls to above.
	(elf32_hppa_relocate_section): Write out the dynamic relocs used
	in lieu of COPY relocs.
2001-06-27 02:42:09 +00:00
Alan Modra 5a15f56fea * elf32-i386.c (elf_i386_check_relocs): Don't make syms dynamic
here..
	(elf_i386_adjust_dynamic_symbol): ..nor here..
	(allocate_plt_and_got_and_discard_relocs): .. instead do so here
	after gc has run.
	(elf_i386_size_dynamic_sections): Fix a comment.
	(elf_i386_relocate_section <R_386_32, R_386_PC32>): Rearrange code
	involved in writing reloc out.
2001-06-27 01:46:17 +00:00
Alan Modra 28d0b90eb7 * elf32-i386.c (elf_i386_check_relocs <R_386_32, R_386_PC32>):
Ensure syms are dynamic if we might be emitting a reloc.
	(allocate_plt_and_got_and_discard_relocs): Don't discard relocs
	for undefweak or undefined syms..
	(elf_i386_relocate_section <R_386_32, R_386_PC32>): .. and emit.
2001-06-25 08:16:44 +00:00
Alan Modra 866b34001a * elf32-i386.c (allocate_plt_and_got_and_discard_relocs): Discard
relocs without ELF_LINK_HASH_DEF_DYNAMIC set.
	(elf_i386_relocate_section <R_386_32, R_386_PC32>): Remove
	redundant bfd_link_hash_defined, bfd_link_hash_defweak test.
2001-06-25 02:40:47 +00:00
H.J. Lu 6cbac8b9dd 2001-06-24 H.J. Lu <hjl@gnu.org>
* cpu-i960.c (scan_960_mach): Don't modify const char *. Use
	strncasecmp/strcasecmp instead of strncmp/strcmp.
2001-06-24 16:06:38 +00:00
H.J. Lu 62b7d3f1f1 2001-06-23 H.J. Lu <hjl@gnu.org>
* elf32-i386.c (elf_i386_relocate_section): Check the
	ELF_LINK_HASH_DEF_DYNAMIC to see if a symbol is not defined
	in the regular object file and treat the weak definition as
	the normal one.
2001-06-24 00:36:47 +00:00
Alan Modra 8c69491410 * elf32-i386.c (elf_i386_relocate_section <R_386_GOT32>): Tighten
unresolved_reloc test to exclude cases where we use "relocation"
	before setting it to point into the .got.  Reinstate fudge for
	unresolved relocs in debugging sections.
2001-06-23 15:02:43 +00:00
Alan Modra 83be169b62 * elf32-i386.c (elf_i386_relocate_section): Replace ugly
complicated tests for unresolvable relocs with a simple direct
	scheme using "unresolved_reloc" var.
2001-06-23 11:01:44 +00:00
Alan Modra ffb2e45bfb * elf32-i386.c (struct elf_i386_pcrel_relocs_copied): Rename to
elf_i386_dyn_relocs.  Update comment.
	(struct elf_i386_link_hash_entry): Rename pcrel_relocs_copied to
	dyn_relocs.
	(elf_i386_adjust_dynamic_symbol): Remove a BFD_ASSERT, change
	others to aborts.
	(allocate_plt_and_got_and_discard_relocs): Replace BFD_ASSERT with
	abort.
	(elf_i386_size_dynamic_sections): Likewise.
	(elf_i386_finish_dynamic_symbol): Likewise.
	(elf_i386_finish_dynamic_sections): Likewise.
	(elf_i386_relocate_section): Likewise.  Tidy R_386_GOT32 and error
	handling code.
2001-06-23 10:03:53 +00:00
Alan Modra 12d0ee4aca Avoid creating COPY relocs if possible.
* elf32-i386.c (elf_i386_check_relocs): Tweak condition under
	which .got created.  Mark symbols used by R_386_32 and R_386_PC32
	relocs as ELF_LINK_NON_GOT_REF to create COPY relocs only when the
	reloc is in a read-only section.  Instead, allocate space for a
	dynamic reloc to reference the library symbol directly.  Keep
	track of space we allocate using pcrel_relocs_copied.
	(discard_copies): Delete, and move code to ..
	(allocate_plt_and_got): ..here.  Rename to
	allocate_plt_and_got_and_discard_relocs.  Remove unneeded dynamic
	relocs for non-shared link.
	(elf_i386_size_dynamic_sections): Update calls to above functions.
	(elf_i386_relocate_section): Write out the dynamic relocs.  Add
	more ugly logic to avoid "unresolvable relocation" error.  Use
	htab shortcut in place of elf_hash_table macro.
	(elf_i386_finish_dynamic_sections): Allow that dynamic .got may
	not always be created now.
2001-06-23 05:54:15 +00:00
Andreas Jaeger f631948d0b * elf64-x86-64.c (elf64_x86_64_relocate_section): Fix linking of
shared libraries.
2001-06-21 16:33:14 +00:00
Nick Clifton 89084430cd Fix typos 2001-06-21 07:44:32 +00:00
Alan Modra 68fb2e56a3 * elf32-hppa.c (elf32_hppa_size_dynamic_sections): Always
allocate local .got space.  Use shortcuts from hash table for .got
	and .plt rather than comparing section names.
	(elf32_hppa_check_relocs): Use local_plt_refcounts var rather than
	adjusting index into local_got_refcounts to document what we are
	really doing.
	(elf32_hppa_relocate_section): Similarly for local_plt_offsets.
	Tidy .got and .plt error checking.
2001-06-21 05:47:12 +00:00
Hans-Peter Nilsson d1d013c334 * bfdint.texi (BFD relocation functions) <different formats>:
Mention that the GNU linker is aware of input-output format
	restrictions when generating relocatable output.  Make new
	paragraph for final-link case.
	(BFD target vector swap): Fix typo.
2001-06-20 22:23:23 +00:00
Catherine Moore 9317eaccac * elf-bfd.h (struct elf_backend_data):
elf_backend_emit_relocs: New field: Function for emitting
        relocs.
        elf_backend_count_relocs: New field: Function for determining
        the number of relocs to be emitted.
        * elfxx-target.h: Provide default (NULL) values for
        elf_backend_emit_relocs and elf_backend_count_relocs.
        * elflink.h (elf_link_size_reloc_section): Make the hash table
        big enough to hold the relocs counted by either reloc_count or
        o->reloc_count.
        (elf_bfd_final_link) emit_relocs: New boolean, set if relocs
        should be emitted, either because of a command line option
        stored in the info structure or because the target provides a
        special reloc emitting function.
        If the target provides a reloc counting function use it,
        unless performing a relocatable link or emitting all relocs.
        Also set the SEC_RELOC flag on any output section which will
        contain relocs.
        (elf_link_input_bfd): emit_relocs: New boolean, set if relocs
        should be emitted, either because of a command line option
        stored in the info structure or because the target provides a
        special reloc emitting function.
        If the target provides a reloc emitting function, use it,
        unless performing a relocatable link or emitting all relocs.
2001-06-20 20:34:10 +00:00
H.J. Lu 161d71a639 2001-06-20 H.J. Lu <hjl@gnu.org>
* elf32-i386.c (elf_i386_size_dynamic_sections): Always
	allocate local .got space.
2001-06-20 18:54:52 +00:00
Andreas Jaeger fd8ab9e538 (elf64_x86_64_relocate_section): Fix creation of dynamic symbols. 2001-06-19 13:30:40 +00:00
Hans-Peter Nilsson 99293407a5 * elflink.h (struct elf_assign_sym_version_info): Remove member
export_dynamic.  All users changed to use info member.
	NAME(bfd_elf,size_dynamic_sections)): Remove parameter
	export_dynamic, instead use member in parameter info.
	* bfd-in.h (bfd_elf32_size_dynamic_sections,
	bfd_elf64_size_dynamic_sections): Update prototype.
	* bfd-in2.h: Regenerate.
2001-06-18 22:05:10 +00:00
H.J. Lu bc2b6df7ca 2001-06-18 H.J. Lu <hjl@gnu.org>
* elflink.h (elf_info_failed): Add a new field, verdefs.
	(NAME(bfd_elf,size_dynamic_sections): Pass verdefs to
	elf_export_symbol.
	(elf_export_symbol): Check eif->verdefs to decide if a symbol
	should be exported.
2001-06-18 18:57:06 +00:00
H.J. Lu 4391705434 2001-06-17 H.J. Lu <hjl@gnu.org>
* elf32-mips.c (mips_elf_link_hash_entry): Add a new field,
	readonly_reloc, to record if a relocation in the .rel.dyn
	section is against a read-only section.
	(mips_elf_link_hash_newfunc): Initialize the readonly_reloc
	field to false.
	(_bfd_mips_elf_check_relocs): Record if there is a relocation
	in the .rel.dyn section against a read-only section by setting
	DF_TEXTREL or readonly_reloc.
	(_bfd_mips_elf_copy_indirect_symbol): Copy readonly_reloc if
	it is true.
	(_bfd_mips_elf_adjust_dynamic_symbol): Record DF_TEXTREL if
	there is a relocation in the .rel.dyn section against a
	read-only section.
	(_bfd_mips_elf_size_dynamic_sections): Set DT_TEXTREL if
	DF_TEXTREL is set.
2001-06-17 16:14:42 +00:00
Nick Clifton 7c8ca0e488 Chnage styp_flags_to_sec_flags() to a boolean function 2001-06-15 09:03:14 +00:00
Nick Clifton dee0a8f47f Only pad the tesxt section if the data section is going to follow it. 2001-06-13 07:58:05 +00:00
Catherine Moore 0d1ea5c088 * elflink.h (elf_gc_propagate_vtable_entries): Replace FILE_ALIGN
with the file_align entry from elf_backend_data.
        (elf_gc_smash_unused_vtentry_relocs): Likewise.
        (elf_gc_record_vtentry): Likewise.
2001-06-12 17:44:38 +00:00
Alan Modra 4e8a9624b8 * elflink.h: Whitespace changes.
(elf_link_read_relocs_from_section): Use "unsigned int" iterator
	rather than "unsigned char".
	(elf_link_output_relocs): Likewise.
	(elf_link_input_bfd): Likewise.
	(elf_reloc_link_order): LIkewise.
	* elf.c: s/CONST/const/.  Whitespace changes.
	* elf32-mips.c: Formatting fix.

	* Makefile.am (SOURCE_HFILES): Include xcoff-target.h, remove xcoff.h.
	* Makefile.in: Regenerate.
	* po/Make-in: Remove trailing tab.
2001-06-10 05:21:00 +00:00
Phil Blundell 7a25cd3e1a 2001-06-09 Philip Blundell <philb@gnu.org>
* elf32-arm.h (elf32_arm_plt0_entry): Correct error in last
	change.
	(elf32_arm_plt_entry): Likewise.
2001-06-09 20:19:29 +00:00
H.J. Lu 3f5a136d64 2001-06-08 H.J. Lu <hjl@gnu.org>
* elf.c (swap_out_syms): Keep names for global section symbols.
2001-06-08 15:30:52 +00:00
H.J. Lu d8fe1fed28 2001-06-07 H.J. Lu <hjl@gnu.org>
* config.bfd: Put back ecoff for Linux/mips. Firmwares on some
	MIPS-based machines need it.
2001-06-08 06:21:29 +00:00
H.J. Lu c36e006fbc 2001-06-07 H.J. Lu <hjl@gnu.org>
* elf32-mips.c (_bfd_mips_elf_object_p): Set the bad symtab
	for SGI only.

	* config.bfd: Remove ecoff from Linux/mips.
2001-06-07 17:31:22 +00:00
Andreas Jaeger cc78d0afbe 2001-06-07 Andreas Jaeger <aj@suse.de>
* elf64-x86-64.c (elf64_x86_64_finish_dynamic_symbol): Add an
	assertion.
	(elf64_x86_64_check_relocs): Fix VTENTRY relocation; set an
	alignment of 8 for .rela sections; handle further relocations.
2001-06-07 14:45:36 +00:00
Nick Clifton 879db8be1a Remove warnings building z8k port.
Fix ld -r behaviour
2001-06-06 17:01:35 +00:00
Nick Clifton cbb1fd5052 Add mips64*-*-linux host 2001-06-05 07:35:10 +00:00
Alan Modra 6725bdbfa9 * elf32-i386.c (elf_i386_discard_copies): Rename to
discard_copies, and use elf_link_hash_entry arg rather than
	elf_i386_link_hash_entry.
	(elf_i386_link_hash_traverse): Delete.
	(elf_i386_size_dynamic_sections): Adjust call to discard_copies.
	Tidy sizing of dynamic sections.
	(elf_i386_check_relocs <R_386_32, R_386_PC32>): Reference count
	possible .plt entries.
	(elf_i386_gc_sweep_hook): Likewise.
	(elf_i386_adjust_dynamic_symbol): Discard .plt entries for
	everything with plt.refcount <= 0.

	* elf32-i386.c (elf_i386_check_relocs): Don't allocate .got and
	.relgot space here.
	(elf_i386_gc_sweep_hook): ..and no need to deallocate here..
	(elf32_hppa_adjust_dynamic_symbol): ..and don't allocate .plt and
	.rel.plt here..
	(allocate_plt_and_got): ..instead do it all here.  New function.
	(elf_i386_size_dynamic_sections): Allocate local .got space and
	call allocate_plt_and_got.  No need to zap .relgot if not dynamic.
	(bfd_elf32_bfd_final_link): Delete.  (ie. use regular final link
	rather than gc variety).
	(WILL_CALL_FINISH_DYNAMIC_SYMBOL): Define.
	(elf_i386_relocate_section): Use it here and correct handling of
	R_386_GOT32.  Provide section and offset for "unresolvable
	relocation" error message.
	(elf_i386_finish_dynamic_symbol): Correct handling of R_386_GOT32.

	* elf32-i386.c (struct elf_i386_link_hash_table): Add sgot,
	sgotplt, srelgot, splt, srelplt, sdynbss, srelbss fields.
	(elf_i386_link_hash_table_create): Init them.
	(create_got_section): New function.
	(elf_i386_create_dynamic_sections): New function.
	(elf_backend_create_dynamic_sections): Set to above.
	(elf_i386_check_relocs): Use shortcuts from hash table rather than
	calling bfd_get_section_by_name.
	(elf_i386_gc_sweep_hook): Likewise.
	(elf_i386_adjust_dynamic_symbol): Likewise.
	(elf_i386_size_dynamic_sections): Likewise.
	(elf_i386_relocate_section): Likewise.
	(elf_i386_finish_dynamic_sections): Likewise.
2001-06-05 05:51:55 +00:00
Alan Modra 73a74a624e * elf32-hppa.c (allocate_plt_and_got): Skip indirect and warning syms. 2001-06-05 04:39:31 +00:00
H.J. Lu 24a5e75166 2001-06-02 H.J. Lu <hjl@gnu.org>
* elf32-hppa.c (elf32_hppa_object_p): Check ELFOSABI_LINUX
	and ELFOSABI_HPUX.
	* elf64-hppa.c (elf64_hppa_object_p): Likewise.
2001-06-03 02:41:58 +00:00
H.J. Lu 1510318892 2001-06-02 H.J. Lu <hjl@gnu.org>
* aout-cris.c (MACHTYPE_OK): New. Defined.
2001-06-02 19:42:40 +00:00
Hans-Peter Nilsson 2f484710e6 * section.c (_bfd_strip_section_from_output): Handle NULL
output_section.
2001-06-02 19:05:34 +00:00
H.J. Lu a5ac692bb5 2001-06-02 H.J. Lu <hjl@gnu.org>
* config.bfd (powerpc-*-aix*, powerpc-*-beos*, rs6000-*-*): Add
	rs6000coff64_vec only if BFD64 is defined.
	(powerpc64-*-aix*): Enable only if BFD64 is defined.
2001-06-02 17:32:09 +00:00
H.J. Lu 27e530993c 2001-06-02 H.J. Lu <hjl@gnu.org>
* coff-ia64.c (ia64coff_object_p): Rewrite with
	external_PEI_DOS_hdr and external_PEI_IMAGE_hdr.
2001-06-02 15:46:43 +00:00
Andreas Jaeger 80643fbcda * elf64-x86-64.c (elf64_x86_64_relocate_section): Add PC8
relocation, small reformatting.
2001-06-01 11:52:11 +00:00
Andreas Jaeger 6b3db54654 * elf64-x86-64.c (elf64_x86_64_check_relocs): Handle R_X86_64_64.
(elf64_x86_64_relocate_section): Likewise.
2001-05-30 18:44:46 +00:00
Alan Modra 4dc8668677 * elf32-hppa.c (elf32_hppa_check_relocs): Don't NEED_PLT for
millicode.  Don't allocate .got and .rela.got space here..
	(elf32_hppa_gc_sweep_hook): ..and no need to deallocate here..
	(elf32_hppa_adjust_dynamic_symbol): ..and don't allocate .plt and
	.rela.plt here..
	(hppa_handle_PIC_calls): ..nor here..
	(allocate_plt_and_got): ..instead do it all here.  New function.
	(elf32_hppa_size_dynamic_sections): Allocate local .got space and
	call allocate_plt_and_got.  No need to zap .got if not dynamic.
	(elf32_hppa_final_link): Call regular bfd_final_link instead of
	gc_common_final_link.
	(WILL_CALL_FINISH_DYNAMIC_SYMBOL): Define.
	(elf32_hppa_relocate_section): Use it here.
	(elf32_hppa_finish_dynamic_symbol): Remove superfluous test of
	dynamic_sections_created.
	(hppa_type_of_stub): Don't LONG_BRANCH_VIA_PLT if millicode sym.
2001-05-30 14:30:33 +00:00
Andreas Jaeger de41dcd889 * elf64-x86-64.c (elf64_86_64_size_info): Remove, we can use the
generic version since we want a hashsize of 4.
	(elf_backend_size_info): Likewise.
2001-05-28 15:45:47 +00:00
Nick Clifton 209f668ef2 Handle MIPS64 relocs which use a non-1 valued int_rels_per_ext_rel 2001-05-28 11:57:54 +00:00
Nick Clifton f7a74f8c82 Support big endian PLT entries. 2001-05-28 10:50:31 +00:00
Alan Modra 8dea12685e * elf32-hppa.c (elf32_hppa_relocate_section): Set up .plt entries
for symbols forced local that need plabels.
	(elf32_hppa_adjust_dynamic_symbol): Don't allocate space in
	.plt.rela for local syms if non-shared.
	(hppa_build_one_stub): Mask lsb of plt.offset.
	(elf32_hppa_finish_dynamic_symbol): Abort if lsb of plt.offset set.
	(clobber_millicode_symbols): Correct comment.
	(elf32_hppa_relocate_section): Likewise.
	(elf32_hppa_finish_dynamic_symbol): Likewise.
2001-05-28 10:12:04 +00:00
Nick Clifton 0f2712edc9 Add support for .uahword, .uaword and .uaxword pseudo ops 2001-05-28 09:23:54 +00:00
H.J. Lu 6768c14a4f 2001-05-25 H.J. Lu <hjl@gnu.org>
* Makefile.am (BFD32_BACKENDS): Remove coff-pmac.lo.
	(BFD32_BACKENDS_CFILES): Remove coff-pmac.c.
	(coff-rs6000.lo): Remove the old dependency.
	* Makefile.in: Rebuild.

	* configure.in (pmac_xcoff_vec): Replace coff-pmac.lo with
	coff-rs6000.lo.
2001-05-25 22:50:27 +00:00
H.J. Lu b55039f458 2001-05-25 H.J. Lu <hjl@gnu.org>
* coff-rs6000.c (rs6000coff_vec): Use rs6000coff_core_p,
	rs6000coff_core_file_matches_executable_p,
	rs6000coff_core_file_failing_command and
	rs6000coff_core_file_failing_signal only if AIX_CORE is
	defined.
	(pmac_xcoff_vec): Likewise.
	* coff64-rs6000.c (rs6000coff64_vec): Likewise.
2001-05-25 21:23:48 +00:00
Timothy Wall 64e9ece0ca monterey updates 2001-05-25 12:42:28 +00:00
H.J. Lu f34d8777dd 2001-05-25 H.J. Lu <hjl@gnu.org>
* bfd-in2.h: Regenerated.
	* libcoff.h: Likewise.
2001-05-25 06:29:21 +00:00
Alan Modra 49e9d0d3b6 * elf32-hppa.c (elf32_hppa_relocate_section): Don't allow
undefined millicode syms in shared libs.
	(hppa_build_one_stub): Turn BFD_ASSERTs into aborts.
	(elf32_hppa_check_relocs): Likewise.
	(elf32_hppa_adjust_dynamic_symbol): Likewise.
	(elf32_hppa_size_dynamic_sections): Likewise.
	(elf32_hppa_relocate_section): Likewise.
	(elf32_hppa_finish_dynamic_symbol): Likewise.
	(elf32_hppa_finish_dynamic_sections): Likewise.
2001-05-25 03:46:49 +00:00
Tom Rix beb1bf64d0 Support for xcoff64 2001-05-24 20:50:50 +00:00
Alexandre Oliva e90fdc1abd * elf64-sparc.c (sparc64_elf_slurp_reloc_table): Fix typo
s/ENTIRES/ENTRIES/.
2001-05-23 23:56:22 +00:00
Nick Clifton c2feb66418 Add MIPS ELF64 relocs 2001-05-23 17:36:38 +00:00
Nick Clifton d1cf510e5e Add MIPS r12k support 2001-05-23 17:26:40 +00:00
Nick Clifton 6c426cf36e Change PLT code to avoid using r2 - it used by GCC to return large startures 2001-05-23 16:38:36 +00:00
Nick Clifton d9bc7a4499 Replace sh_size/sh_entsize with NUM_SHDR_ENTRIES 2001-05-23 08:23:27 +00:00
Andreas Jaeger f5198f610d * dwarf2.c (decode_line_info): Fix error message.
(read_abbrevs): Fix test for offset as suggested by Alan Modra and
	adjust error message.
2001-05-21 11:52:42 +00:00
Alexandre Oliva 6be7c12c05 * ltconfig, ltmain.sh, libtool.m4, ltcf-c.sh, ltcf-cxx.sh,
ltcf-gcj.sh: Upgraded to libtool 1.4a 1.641.2.254.  Rebuilt a number
of subdir/configure scripts to use the new libtool.m4.
2001-05-20 19:02:56 +00:00
H.J. Lu 7913c838b3 2001-05-18 H.J. Lu <hjl@gnu.org>
* elflink.h (elf_link_add_object_symbols): Revert the last
	change.
2001-05-18 16:06:43 +00:00
Alan Modra e0522e891a * elf32-hppa.c (clobber_millicode_symbols): Temporarily set
ELF_LINK_FORCED_LOCAL to suit 2001-04-30 change.
	(hppa_build_one_stub): Add an assert to check plt.offset.
2001-05-18 03:11:13 +00:00
H.J. Lu 96fd004e0e 2001-05-17 H.J. Lu <hjl@gnu.org>
* elflink.h (NAME(bfd_elf,size_dynamic_sections)): Set the
	version definition to basename of the output filename.
2001-05-18 01:20:02 +00:00
H.J. Lu f3876d8bc6 2001-05-17 H.J. Lu <hjl@gnu.org>
* elflink.h (elf_link_add_object_symbols): Set DT_NEEDED to
	basename of the bfd filename.
2001-05-17 19:08:46 +00:00
Alan Modra d1778b88f8 Add a flag to asection, linker_has_input, and use it to reliably
determine whether an input section is the first one assigned to
an output section.
2001-05-17 03:58:45 +00:00
Alexandre Oliva 2a0fa9433c * elf-m10300.c (mn10300_elf_relax_section): Don't relax
negative 32-bit operands to 16 operands when the operand is
going to be zero-extended by the modified opcode.
2001-05-16 01:48:13 +00:00
Alan Modra bcee8eb8ca Peter Targett's backwards compatibility and other arc fixes. 2001-05-12 15:14:53 +00:00
Jakub Jelinek 579f31ac74 * elfxx-ia64.c (is_unwind_section_name): Consider linkonce unwind
sections as well.
	(elfNN_ia64_final_write_processing): Map .gnu.linkonce.ia64unw.FOO
	to .gnu.linkonce.t.FOO text section.

	* readelf.c (process_unwind): Print all unwind sections, not just
	one.

	* config/tc-ia64.c (special_linkonce_name): New.
	(make_unw_section): Map .gnu.linkonce.t.FOO text section into
	.gnu.linkonce.ia64unw{,i}.FOO.
	(ia64_elf_section_type): Handle .gnu.linkonce.ia64unw{,i}.FOO.
	(dot_endp): Add comment about it.

	* elf/ia64.h (ELF_STRING_ia64_unwind_once): Define.
	(ELF_STRING_ia64_unwind_info_once): Define.

	* emulparams/elf64_ia64.sh (OTHER_READONLY_SECTIONS): Put
	.gnu.linkonce.ia64unw{,i} sections into corresponding .IA_64.unwind*
	output sections.
	* emulparams/elf64_aix.sh (OTHER_READONLY_SECTIONS): Likewise.
2001-05-11 12:36:47 +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 1548c54f2e Change type of 'addr' to be unsigned long, in order to match its use. 2001-05-11 09:55:02 +00:00
H.J. Lu 689effed70 2001-05-10 H.J. Lu <hjl@gnu.org>
* linker.c (_bfd_generic_link_add_one_symbol): Check loop on
	indirect symbols.
2001-05-10 22:59:29 +00:00
H.J. Lu 6e5222be78 2001-05-09 H.J. Lu <hjl@gnu.org>
* elflink.h (elf_link_add_object_symbols): Fix a typo. Allocate
	versymhdr->sh_size bytes for extversym instead of hdr->sh_size.
	Remove the unused veriable `dynver'.
2001-05-09 22:34:30 +00:00
Ian Lance Taylor 8e191bd38c * coff-i386.c (coff_i386_reloc): Don't dump core if output_bfd is
NULL or is not COFF.
	(coff_i386_rtype_to_howto): Don't dump core if output section
	owner is not COFF.
2001-05-08 17:44:00 +00:00
Ian Lance Taylor efcbd82c36 Remove extraneous character in first line. 2001-05-08 17:14:35 +00:00
Alan Modra 062e23589d * ecoff.c (bfd_debug_section): Fix initialization.
* elf.c (_bfd_elf_slurp_version_tables): Change maxidx to unsigned, it
	is always a positive integer. Cast away sign mismatch.
	* elf32-mips.c: Fix misleading comment and typo.
	(_bfd_mips_elf_section_from_bfd_section): Remove unused attribute, use
	correct data type.
	* elflink.c: Fix typo.
	(_bfd_elf_create_dynamic_sections): Remove superfluous initialization.
	* ecoffswap.h (ecoff_swap_fdr_in): Cast away sign mismatch.
2001-05-07 09:15:26 +00:00
Richard Henderson 16b65e4ea2 * elf64-alpha.c (SREL16, SREL32, SREL64): Set pcrel_offset true. 2001-05-04 23:22:31 +00:00
Nick Clifton cac1532771 Set EF_ARM_HASENTRY if the start address is set. 2001-05-04 08:32:21 +00:00
Nick Clifton 966b3e0b90 Compute value of _bfd_target_vector_entries based on the size of
_bfd_target_vector and not bfd_target_vector.
2001-05-03 17:49:49 +00:00
H.J. Lu 210ba1e83d 2001-05-03 H.J. Lu <hjl@gnu.org>
* elfcode.h: Include "libiberty.h".

	* elflink.h (elf_link_add_object_symbols): Set
	elf_dt_name (abfd) to basename of the bfd filename.
	(NAME(bfd_elf,size_dynamic_sections)): Set vn_file to basename
	of the bfd filename.
2001-05-03 06:18:09 +00:00
Andreas Jaeger b274749094 * coff-alpha.c (reloc_nil): Likewise.
(alpha_ecoff_bad_format_hook): Likewise.
        (alpha_adjust_reloc_out): Likewise.
        (alpha_bfd_reloc_type_lookup): Likewise.
        (alpha_convert_external_reloc): Likewise.
2001-05-03 05:08:17 +00:00
Andreas Jaeger 56fc028eb1 * elf64-gen.c (elf_generic_info_to_howto): Add unused attribute.
(elf_generic_info_to_howto_rel): Likewise.
	* coff-alpha.c (reloc_nil): Likewise.
	(alpha_ecoff_bad_format_hook): Likewise.
	(alpha_adjust_reloc_out): Likewise.
	(alpha_bfd_reloc_type_lookup): Likewise.
	(alpha_convert_external_reloc): Likewise.
	* elf64-alpha.c (elf64_alpha_reloc_nil): Likewise.
	(elf64_alpha_reloc_bad): Likewise.
	(elf64_alpha_reloc_gpdisp): Likewise.
	(elf64_alpha_bfd_reloc_type_lookup): Likewise.
	(elf64_alpha_info_to_howto): Likewise.
	(elf64_alpha_add_symbol_hook): Likewise.
	(elf64_alpha_create_got_section): Likewise.
	(elf64_alpha_is_local_label_name): Likewise.
	(elf64_alpha_merge_ind_symbols): Likewise.
	* elf64-mips.c (mips_elf64_reloc_type_lookup): Likewise.
	(mips_elf64_get_reloc_upper_bound): Likewise.
	* nlm32-alpha.c (nlm_alpha_mangle_relocs): Likewise.
	(nlm_alpha_get_public_offset): Likewise.
2001-05-03 04:46:27 +00:00
Nick Clifton c7e4034828 Add gas and ld support for openrisc 2001-05-02 18:14:31 +00:00
H.J. Lu 5fba655aed 2000-04-27 H.J. Lu <hjl@gnu.org>
* elf.c (_bfd_elf_link_hash_hide_symbol): Set dynindx to -1
	only for ELF_LINK_FORCED_LOCAL.
	* elf32-hppa.c (elf32_hppa_hide_symbol): Likewise.
	* elf32-mips.c (_bfd_mips_elf_hide_symbol): Likewise.
	* elfxx-ia64.c (elfNN_ia64_hash_hide_symbol): Likewise.

	* elflink.h (elf_fix_symbol_flags): Set ELF_LINK_FORCED_LOCAL
	if the symbol has hidden or internal visibility.
2001-04-30 16:13:26 +00:00
Alan Modra db20fd7654 * elf32-hppa.c (final_link_relocate): Branch to .+8 for
calls to undefined weak symbols.
2001-04-30 13:34:41 +00:00
Andreas Jaeger 6a2bda3fa0 * elf64-x86-64.c (elf64_x86_64_relocate_section): Correct test for
R_X86_64_GOTPCREL, don't use assignments instead of comparisons.
2001-04-30 10:30:05 +00:00
Andreas Jaeger 053579d754 * elf64-x86-64.c (elf64_x86_64_finish_dynamic_sections): Only swap
out handled entries.
	(elf64_x86_64_finish_dynamic_symbol): Set up GOT entries.
	(elf64_x86_64_relocate_section): Fix GOTPCREL calculation.
	(elf64_x86_64_relocate_section): Merge entries for GOTPCREL and
	GOT32.
2001-04-29 13:42:45 +00:00
H.J. Lu 37c9e45c89 Revert the last change on aclocal.m4. 2001-04-27 21:25:04 +00:00