Commit Graph

1041 Commits

Author SHA1 Message Date
H.J. Lu 01467f2afb 2001-07-15 H.J. Lu <hjl@gnu.org>
* Makefile.am (po/SRC-POTFILES.in): Use tmp.src instead of tmp.
	(po/BLD-POTFILES.in): Use tmp.bld instead of tmp.
	* Makefile.in: Regenerate.
2001-07-15 19:33:11 +00:00
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