Commit Graph

2882 Commits

Author SHA1 Message Date
Nick Clifton c2967539ef Bump version number 2003-05-06 16:46:30 +00:00
Alan Modra c665dbb373 daily update 2003-05-06 00:00:06 +00:00
Alan Modra 4e795f50c1 * elf32-i386.c (allocate_dynrelocs): For undef weak syms with
non-default visibility, a) don't make them dynamic, b) discard
	space for dynamic relocs.
	* elf64-x86-64.c (allocate_dynrelocs): Likewise.

	* elf32-ppc.c (allocate_dynrelocs): For undef weak syms with
	non-default visibility, a) don't allocate plt entries, b) don't
	allocate .got relocs, c) discard dyn rel space,
	(ppc_elf_relocate_section): d) don't generate .got relocs, e)
	don't generate dynamic relocs.
	* elf64-ppc.c (allocate_dynrelocs): As above.
	(ppc64_elf_relocate_section): As above.
2003-05-05 14:12:05 +00:00
Andreas Jaeger 4bc6e03a51 * elf64-x86-64.c (allocate_dynrelocs): Don't allocate dynamic
relocation entries for weak undefined symbols with non-default
	visibility.
	(elf64_x86_64_relocate_section): Initialize the GOT entries and
	skip R_386_32/R_386_PC32 for weak undefined symbols with
	non-default visibility.
2003-05-05 08:50:43 +00:00
H.J. Lu ef5aade5ac bfd/
2003-05-04  H.J. Lu <hjl@gnu.org>

	* elf32-i386.c (allocate_dynrelocs): Don't allocate dynamic
	relocation entries for weak undefined symbols with non-default
	visibility.
	(elf_i386_relocate_section): Initialize the GOT entries and
	skip R_386_32/R_386_PC32 for weak undefined symbols with
	non-default visibility.

	* elfxx-ia64.c (allocate_fptr): Don't allocate function
	descriptors for weak undefined symbols with non-default
	visibility.
	(allocate_dynrel_entries): Don't allocate relocation entries
	for symbols resolved to 0.
	(set_got_entry): Don't install dynamic relocation for weak
	undefined symbols with non-default visibility.
	(set_pltoff_entry): Likewise.

	* elflink.h (elf_fix_symbol_flags): Hide weak undefined symbols
	with non-default visibility.
	(elf_link_output_extsym): Don't make weak undefined symbols
	with non-default visibility dynamic.

ld/testsuite/

2003-05-04  H.J. Lu <hjl@gnu.org>

	* ld-elfvsb/main.c: Updated.
	* ld-elfvsb/sh1.c: Likewise.
2003-05-05 05:46:53 +00:00
H.J. Lu c424e0e973 bfd/
2003-05-04  H.J. Lu <hjl@gnu.org>

	* elflink.h (elf_merge_symbol): Correctly handle weak definiton.

ld/testsuite/

2003-05-04  H.J. Lu <hjl@gnu.org>

	* ld-elfvers/vers18.dsym: Updated for weak definiton change.
	* ld-elfvers/vers18.ver: Likewise.
	* ld-elfvers/vers19.ver: Likewise.

	* ld-elfweak/elfweak.exp: Remove xfail.
2003-05-05 03:33:09 +00:00
H.J. Lu d31e3dfee9 2003-05-04 H.J. Lu <hjl@gnu.org>
* elflink.h (elf_merge_symbol): Don't record a hidden/internal
	symbol dynamic. Check indirection when removing the old
	definition for symbols with non-default visibility.
	(elf_add_default_symbol): Skip when told by elf_merge_symbol.
2003-05-05 00:37:02 +00:00
Alan Modra 9dc0b7c704 daily update 2003-05-05 00:00:04 +00:00
Alan Modra 1fffbe2fa5 daily update 2003-05-04 00:00:06 +00:00
Alan Modra ad4543cfba daily update 2003-05-03 00:00:05 +00:00
Nick Clifton 4d2e1ff0a6 Make the R_XSTORMY16_8 and R_XSTORMY16_16 relocs detect and complain about
unsigned overflow.
2003-05-02 14:41:08 +00:00
Andreas Jaeger d40d037cac * elf64-x86-64.c (elf_x86_64_copy_indirect_symbol): Don't copy
ELF_LINK_NON_GOT_REF for weakdefs when symbol already adjusted.
	(ELIMINATE_COPY_RELOCS): Define as one.  Use throughout.
	(elf_x86_64_adjust_dynamic_symbol): For weak symbols, copy
	ELF_LINK_NON_GOT_REF from weakdef.
2003-05-02 08:19:12 +00:00
Nick Clifton c5d1701eae Fix name of --enable-install-libbfd switch. 2003-05-02 08:14:52 +00:00
Alan Modra 3a4d45ef7a daily update 2003-05-02 00:00:05 +00:00
Alan Modra 81848ca0c8 * elf32-ppc.c (ppc_elf_copy_indirect_symbol): Test whether the
weakdef sym has already been adjusted before treating it specially.
	* elf32-i386.c (elf_i386_copy_indirect_symbol): Don't copy
	ELF_LINK_NON_GOT_REF for weakdefs when symbol already adjusted.
	* elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Likewise.
	(ppc64_elf_check_relocs): Set ELF_LINK_NON_GOT_REF.
2003-05-01 10:22:46 +00:00
Alan Modra f1b7746eb0 daily update 2003-05-01 00:00:07 +00:00
Nick Clifton 03d14457a6 Do not crash when encountering relocs against the *ABS* section. 2003-04-30 12:03:58 +00:00
Alan Modra fc5b4209b2 daily update 2003-04-30 00:00:06 +00:00
H.J. Lu c7996ad628 bfd/
2003-04-28  H.J. Lu <hjl@gnu.org>

	* elfxx-ia64.c (elfNN_ia64_relax_section): Relax ldxmov during
	the relax finalize pass.

	* section.c (struct sec): Add need_finalize_relax and remove
	flag11.
	(STD_SECTION): Update struct sec initializer.
	* bfd-in2.h: Regenerated.

include/

2003-04-28  H.J. Lu <hjl@gnu.org>

	* bfdlink.h (bfd_link_info): Add relax_finalizing.

ld/

2003-04-28  H.J. Lu <hjl@gnu.org>

	* ldlang.c (lang_process): Add the relax finalize pass.

	* ldmain.c (main): Initialize link_info.relax_finalizing to
	FALSE.
2003-04-29 01:53:46 +00:00
Alan Modra 3c9dc02ab9 daily update 2003-04-29 00:00:05 +00:00
H.J. Lu f006af20ee bfd/
2003-04-28  H.J. Lu <hjl@gnu.org>

	* elflink.h (elf_merge_symbol): Call elf_backend_copy_indirect_symbol
	to copy any information related to dynamic linking when we flip
	the indirection.

ld/testsuite/

2003-04-28  H.J. Lu <hjl@gnu.org>

	* ld-elfvers/vers.exp (picflag): Set PIC flag for compiler.
	(build_vers_lib): Support PIC.
	(build_vers_lib_no_pic): New. Change all calls to build_vers_lib
	to build_vers_lib_no_pic.
	(build_vers_lib_pic): New.
	Add tests vers26a, vers26b1, vers26b2 and vers26b3 for versioned
	definition vs. normal definition in different files.

	* ld-elfvers/vers26a.c: New file.
	* ld-elfvers/vers26a.dsym: Likewise.
	* ld-elfvers/vers26a.map: Likewise.
	* ld-elfvers/vers26a.ver: Likewise.
	* ld-elfvers/vers26b.c: Likewise.

	* ld-elfvers/vers26b.dsym: New empty file.
	* ld-elfvers/vers26b.ver: Likewise.
2003-04-28 16:58:01 +00:00
H.J. Lu 1b1fe8feb3 bfd/
2003-04-27  H.J. Lu <hjl@gnu.org>

	* elf-bfd.h (ELF_LINK_DYNAMIC_DEF): New.
	(ELF_LINK_DYNAMIC_WEAK): New.

	* elflink.h (elf_merge_symbol): Add one argument to indicate if
	a symbol should be skipped. Ignore definitions in dynamic
	objects for symbols with non-default visibility.
	(elf_add_default_symbol): Adjusted.
	(elf_link_add_object_symbols): Check if a symbol should be
	skipped. Don't merge the visibility field with the one from
	a dynamic object.
	(elf_link_check_versioned_symbol): Use undef_bfd.
	(elf_link_output_extsym): Warn if a forced local symbol is
	referenced from dynamic objects. Make non-weak undefined symbol
	with non-default visibility a fatal error.

ld/testsuite/

2003-04-27  H.J. Lu <hjl@gnu.org>

	* ld-elfvsb/elfvsb.dat: Updated.
	* ld-elfvsb/elfvsb.exp: Likewise.
	* ld-elfvsb/main.c: Likewise.
	* ld-elfvsb/sh1.c: Likewise.
	* ld-elfvsb/sh2.c: Likewise.
2003-04-28 03:31:36 +00:00
Alan Modra a81a272ddb daily update 2003-04-28 00:00:05 +00:00
Daniel Jacobowitz 052a450c47 * configure.in: Bump version on HEAD to 2.14.90.
* configure: Regenerated.
2003-04-27 19:59:10 +00:00
Stephane Carrez d204f4c0f9 PR savannah/3331:
* elf32-m68hc11.c (m68hc11_elf_relax_section): Clear prev_insn_group
	when we couldn't relax something.
	* ld-m68hc11/bug-3331.d: New test.
	* ld-m68hc11/bug-3331.s: New file.
2003-04-26 11:53:36 +00:00
Alan Modra 80d32f10a9 daily update 2003-04-26 00:00:07 +00:00
H.J. Lu 3c0a515daa 2003-04-25 Alan Modra <amodra@bigpond.net.au>
* elflink.h (elf_merge_symbol): When we find a regular definition
	for an indirect symbol, flip the indirection so that the old
	direct symbol now points to the new definition.
2003-04-25 15:17:51 +00:00
Alan Modra ce759df267 daily update 2003-04-25 00:00:06 +00:00
Roland McGrath d145330dd9 . 2003-04-24 17:19:55 +00:00
Roland McGrath 811072d851 2003-04-24 Roland McGrath <roland@redhat.com>
* elf.c (bfd_section_from_phdr): Map PT_GNU_EH_FRAME to "eh_frame_hdr".
2003-04-24 17:19:37 +00:00
Alan Modra fc0bffd6e9 * elf32-ppc.c: Formatting and comment fixes.
(ELIMINATE_COPY_RELOCS): Move before ppc_elf_copy_indirect_symbol.
	(ppc_elf_copy_indirect_symbol): Copy flags here for weakdefs.
2003-04-24 13:44:10 +00:00
Nick Clifton 8d9cd6b19b Add support for h8300hn and h8300sn 2003-04-24 12:36:08 +00:00
Kaz Kojima 267fb3c1ce * elf32-sh.c (tpoff): New.
(struct elf_sh_dyn_relocs): Remove tls_tpoff32.
	(WILL_CALL_FINISH_DYNAMIC_SYMBOL): Pass SHARED instead of INFO.
        (allocate_dynrelocs): Don't make unnecessary dynamic TLS
	relocations.  Adjust WILL_CALL_FINISH_DYNAMIC_SYMBOL uses.
        (sh_elf_relocate_section): Likewise. Remove unnecessary tests.
	(dtpoff_base): Fix wrong indentation.
	(sh_elf_check_relocs): Don't set DF_STATIC_TLS flag with non-TLS
	relocations.  Don't set tls_tpoff32 flag.  Don't make unnecessary
	R_SH_TLS_TPOFF32 relocations.

	* ld-sh/tlsbin-1.d, ld-sh/tlsbin-2.d, ld-sh/tlsbin-3.d,
	ld-sh/tlstpoff-1.d, ld-sh/tlstpoff-2.d: Update for removing
	unnecessary TLS relocs.
2003-04-24 05:19:09 +00:00
Alan Modra 0dc1c47bf6 daily update 2003-04-24 00:00:06 +00:00
Joern Rennecke ef23021837 bfd:
* archures.c (enum bfd_architecture): Amend comment to refer to SuperH.
        * cpu-sh.c: Likewise.
        * elf32-sh.c: Likewise.
        * reloc.c (bfd_reloc_code_real): Likewise.
        * elf32-sh64-com.c: Change comment to refer to SuperH.
        * elf32-sh64.c: Likewise.
        * elf64-sh64.c: Likewise.
        * bfd-in2.h (enum bfd_architecture): Regenerate.
binutils:
        * readelf.c (get_machine_name) <EM_SH>: Amend return value
        to refer to SuperH.
gas:
        * config/tc-sh.c: Amend comment to refer to SuperH.
        * config/tc-sh.h: Likewise.
        (LISTING_HEADER): Amend to refer to SuperH.
        * config/tc-sh64.c: Change comment to refer to SuperH.
        * config/tc-sh64.h (LISTING_HEADER): Change to refer to SuperH.
        * doc/as.texinfo [SH, GENERIC]: Amend / Change to refer to SuperH.
        * doc/c-sh.texi: Amend to refer to SuperH.
        Add SuperH architecture documentation references.
        * doc/c-sh64.texi: Change to refer to SuperH.
include/elf:
        * common.h (EM_SH): Amend comment to refer to SuperH.
ld/testsuite:
        * ld-sh/sh64/crange3-cmpct.rd (Machine): Change to refer to SuperH.
        * ld-sh/sh64/crange3-media.rd (Machine): Likewise.
2003-04-23 21:09:04 +00:00
Alan Modra 8c29f035d9 * elf32-i386.c (elf_i386_info_to_howto): Delete.
(elf_info_to_howto): Define as elf_i386_info_to_howto_rel.
2003-04-23 05:21:29 +00:00
Alan Modra c8977542c6 daily update 2003-04-23 00:00:06 +00:00
Nick Clifton 26597c8633 Replace references to Mitsubishi M32R with references to Renesas M32R. 2003-04-22 16:22:26 +00:00
Alan Modra 57e3e8655c daily update 2003-04-22 00:00:06 +00:00
Richard Henderson cc13e3efe3 * elf64-alpha.c (alpha_elf_dynamic_symbol_p): Return false for an
executable when a symbol is defined both regular and dynamic.
2003-04-21 22:17:12 +00:00
Stephane Carrez f5a6f91565 * Makefile.am (BFD32_BACKENDS): Add elf32-m68hc1x.lo.
(elf32-m68hc1x.lo): Update dependencies
	* configure.in: Add elf32-m68hc1x.lo.
	* configure: Rebuild.
	* Makefile.in: Rebuild.
2003-04-21 13:24:19 +00:00
Stephane Carrez 3a65329d1f * elf32-m68hc1x.c: New file (from elf32-m68hc11.c and elf32-m68hc12.c)
(m68hc11_elf_hash_table_create): New function.
	(elf32_m68hc11_link_hash_table_free): New function.
	(stub_hash_newfunc): New function.
	(m68hc11_add_stub): New function.
	(elf32_m68hc11_add_symbol_hook): New function.
	(elf32_m68hc11_setup_section_lists): New function.
	(elf32_m68hc11_next_input_section): New function.
	(elf32_m68hc11_size_stubs): New function.
	(elf32_m68hc11_build_stubs): New function.
	(m68hc11_get_relocation_value): New function.
	(elf32_m68hc11_relocate_section): Call the above to redirect
	some relocations to the trampoline code.
	(m68hc11_elf_export_one_stub): New function.
	(m68hc11_elf_set_symbol): New function.
	(elf32_m68hc11_build_stubs): Call it via bfd_hash_traverse.
	(m68hc11_elf_get_bank_parameters): Get parameters only when the info
	is not yet initialized.

	* elf32-m68hc1x.h: New file (from elf32-m68hc11.c and elf32-m68hc12.c)
	(elf32_m68hc11_stub_hash_entry): New struct.
	(m68hc11_page_info): Add trampoline handler address.
	(m68hc11_elf_link_hash_table): Add stubs generation members.
	(elf32_m68hc11_add_symbol_hook): Declare.
	(elf32_m68hc11_setup_section_lists): Declare.
	(elf32_m68hc11_size_stubs): Declare.
	(elf32_m68hc11_build_stubs): Declare.

	* elf32-m68hc11.c (m68hc11_elf_ignore_reloc): Move to elf32-m68hc1x.c.
	(elf32_m68hc11_gc_mark_hook, elf32_m68hc11_gc_sweep_hook): Likewise.
	(elf32_m68hc11_check_relocs, elf32_m68hc11_relocate_section): Ditto.
	(_bfd_m68hc11_elf_set_private_flags): Ditto.
	(_bfd_m68hc11_elf_merge_private_bfd_data): Ditto.
	(_bfd_m68hc11_elf_print_private_bfd_data): Ditto.
	(bfd_elf32_bfd_link_hash_table_create): Define.
	(elf_backend_add_symbol_hook): Define.
	(m68hc11_elf_bfd_link_hash_table_create): New function.
	(m68hc11_elf_build_one_stub): New function.
	(m68hc11_elf_size_one_stub): New function.
	(m68hc11_elf_bfd_link_hash_table_create): Install the above.
	(bfd_elf32_bfd_link_hash_table_create): Define.

	* elf32-m68hc12.c (m68hc11_elf_ignore_reloc): Remove.
	(m68hc12_addr_is_banked): Remove, use m68hc11_addr_is_banked.
	(m68hc12_phys_addr): Ditto.
	(m68hc12_phys_page): Ditto.
	(m68hc12_elf_special_reloc): Move to elf32-m68hc1x.c.
	(elf32_m68hc11_gc_mark_hook): Likewise.
	(elf32_m68hc11_gc_sweep_hook): Likewise.
	(elf32_m68hc11_check_relocs): Likewise.
	(elf32_m68hc11_relocate_section): Likewise.
	(_bfd_m68hc12_elf_set_private_flags): Likewise.
	(_bfd_m68hc12_elf_merge_private_bfd_data): Likewise.
	(_bfd_m68hc12_elf_print_private_bfd_data): Likewise.
	(m68hc12_elf_build_one_stub): New function.
	(m68hc12_elf_size_one_stub): New function.
	(m68hc12_elf_bfd_link_hash_table_create): New function, use the above.
	(elf_backend_add_symbol_hook): Define.
	(elf_m68hc11_howto_table): Use TRUE for pcrel relocs; fix masks.
2003-04-21 13:22:14 +00:00
Alan Modra 81eca1a78a daily update 2003-04-21 00:00:05 +00:00
Alan Modra 042a96132e daily update 2003-04-20 00:00:07 +00:00
Alan Modra e136427c23 daily update 2003-04-19 00:00:06 +00:00
Nick Clifton 4081944fd1 Only check associated vector if the matching_vector has been created. 2003-04-18 08:06:01 +00:00
Alan Modra ef574fb1a5 daily update 2003-04-18 00:00:06 +00:00
Alan Modra 4a2c63e9d1 daily update 2003-04-17 00:00:05 +00:00
Alexandre Oliva 060dc71d21 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Fix typo in
2003-04-09's change.
2003-04-16 00:30:24 +00:00
Alan Modra 9ba3f0f225 daily update 2003-04-16 00:00:05 +00:00
Nick Clifton a3476bef94 If a section holds uninitialized data and is from an object file or from an
executable image that has not initialized the s_size field, or if the physical
size is padded, use the virtual size (stored in s_paddr) instead.
2003-04-15 14:26:06 +00:00
Nick Clifton ca4fa240d6 Properly report filename for alignment reduction.
Add test for alignment reduction.
2003-04-15 09:38:11 +00:00
Nick Clifton c2dcd04ec8 Replace occurrances of 'Hitachi' with 'Renesas'. 2003-04-15 08:51:55 +00:00
Alan Modra 047822a581 daily update 2003-04-15 00:00:06 +00:00
Nick Clifton f7661995e8 Maintain maximum alignment for common symbols. Warn reducing alignment for
common symbols. Report old filename when symbol size changes.
2003-04-14 11:06:25 +00:00
Alan Modra 151123adc8 daily update 2003-04-14 00:00:06 +00:00
Alan Modra 003fbf3f0f daily update 2003-04-13 00:00:04 +00:00
Alexandre Oliva 93a2b7ae81 * elfxx-mips.c (mips_elf_calculate_relocation): Adjust two other
occurrences of the same test changed in the previous patch.
Optimize.
2003-04-12 08:50:28 +00:00
Alexandre Oliva 0176c794f8 * elfxx-mips.c (mips_elf_get_global_gotsym_index): New.
(mips_elf_calculate_relocation): Decay GOT_PAGE/GOT_OFST to
GOT_DISP/addend only if the symbol got a global GOT entry.
2003-04-12 00:31:42 +00:00
Alan Modra 2a8e99b308 daily update 2003-04-12 00:00:07 +00:00
Alexandre Oliva 0fdc1bf125 * elfxx-mips.c (mips_elf_calculate_relocation): Decay
GOT_PAGE/GOT_OFST referencing overridable symbol to
GOT_DISP/addend.
(_bfd_mips_elf_check_relocs): Handle GOT_PAGE referencing
global symbol as GOT_DISP.
2003-04-11 01:56:49 +00:00
Alan Modra 9f34b04bdf daily update 2003-04-11 00:00:05 +00:00
Bob Wilson 9b8c98a411 * elf32-xtensa.c (elf_xtensa_relocate_section): Don't continue to the
next relocation on an undefined symbol.
2003-04-10 19:19:02 +00:00
Alan Modra ac299f1784 daily update 2003-04-10 00:00:06 +00:00
Richard Henderson ec1659c846 * elf64-alpha.c (elf64_alpha_relocate_section) <R_ALPHA_GPREL32>:
Ignore relocations against r_symndx == 0.
2003-04-09 20:08:14 +00:00
H.J. Lu 7dfb07f7c2 2003-04-09 H.J. Lu <hjl@gnu.org>
* elf64-alpha.c (elf64_alpha_relocate_section): Don't return
	FALSE for undefined symbols.
	* elfxx-ia64.c (elfNN_ia64_relocate_section): Likewise.
2003-04-09 16:19:53 +00:00
Alexandre Oliva a3805e4e10 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Try DWARF3-standard
and IRIX-specific shift-to-64-bit 4-byte lengths before following
addr_size.
2003-04-09 09:56:17 +00:00
Alexandre Oliva 69931e6013 * elf32-mips.c (bfd_elf32_bfd_reloc_type_lookup): Detect (ctor)
pointer size from ABI, not arch_bits_per_address.
2003-04-09 02:55:40 +00:00
Alan Modra 7a3d2ef920 daily update 2003-04-09 00:00:05 +00:00
Alan Modra 07d5e0b978 daily update 2003-04-08 00:00:06 +00:00
Kevin Buettner 59a8c196af * elfn32-mips.c (elf32_mips_grok_prstatus): Adjust core file related
constants for n32 ABI.
2003-04-07 20:08:10 +00:00
Alan Modra 53b063522f daily update 2003-04-07 00:00:05 +00:00
Nick Clifton 8e16317ca5 (bfd_simple_get_relocated_section_contents): Disable free that leads to GDB
vs BFD memory corruption.
2003-04-06 08:15:58 +00:00
Alan Modra d1c6921f66 daily update 2003-04-06 00:00:06 +00:00
Alan Modra 1ec9c9cf1f daily update 2003-04-05 00:00:05 +00:00
Stephane Carrez 196486bed9 * elf32-m68hc11.c (m68hc11_elf_relax_delete_bytes): Also adjust
symbols that mark the end of the section.
	(m68hc11_elf_relax_section): Use R_M68HC11_PCREL_8 relocs when
	converting to a relative branch so that the offset is computed after
	the relaxation; also relocate a jsr into a bsr if possible but don't
	relax them if they are to a far symbol as we need to call the
	trampoline code.
	(elf_m68hc11_howto_table): Set pcrel_offset to true.
2003-04-04 21:17:06 +00:00
Svein Seldal be33c5dd4d Namespace cleanup for the tic4x target. Replace s/c4x/tic4x/ and s/c3x/tic3x/. 2003 copyright update 2003-04-04 08:15:15 +00:00
Alan Modra 8bacb1607c daily update 2003-04-04 00:00:06 +00:00
Nick Clifton ff0c9faf3b (_bfd_XXi_swap_scnhdr_out): Compute ps and ss differently for object files and
executables.
(coff_swap_scnhdr_in): Only set the s_size field for object files or for
  executables who have not already initialised the field.
(bfd_pe_executable_p): New macro.  Return true if the PE format bfd is an
  executable.
2003-04-03 11:13:27 +00:00
Alan Modra c8b21ee577 * elf32-ppc.c (SYMBOL_REFERENCES_LOCAL): Expand comment. 2003-04-03 04:02:02 +00:00
Alan Modra 2b98e6c032 * elf32-ppc.c (ppc_elf_check_relocs): Don't use SYMBOL_REFERENCES_LOCAL
here as it's too early to reliably determine locality.
	(ppc_elf_gc_sweep_hook): Likewise.
2003-04-03 02:54:52 +00:00
Alan Modra 03189cd937 daily update 2003-04-03 00:00:05 +00:00
Bob Wilson 9240357975 * xtensa-modules.c: Remove comment indicating that this is a
generated file.
2003-04-02 16:53:44 +00:00
Alan Modra 5eb7f2340a daily update 2003-04-02 00:00:05 +00:00
Alan Modra c45a316a0b * elfxx-mips.c (_bfd_mips_elf_hide_symbol): Test for NULL dynobj. 2003-04-01 23:44:45 +00:00
Nick Clifton e0001a05d2 Add Xtensa port 2003-04-01 15:50:31 +00:00
Nick Clifton 5a6c681789 Fixes for iWMMXt contribution. 2003-04-01 13:08:06 +00:00
Ben Elliston 0cc1cf992d * dwarf2.c (read_attribute_value): Correct typo in comment. 2003-04-01 10:49:02 +00:00
Nick Clifton d63fd5d103 Make add_line_info() take a copy of the filename. 2003-04-01 10:31:34 +00:00
Nick Clifton af3ef9fe5c Remove use of concat() inside concat_filename() 2003-04-01 10:18:54 +00:00
Daniel Jacobowitz 6e84a90684 * simple.c (bfd_simple_get_relocated_section_contents): Add
parameter symbol_table.  Optionally use it instead of the symbol
	table from the bfd.  Save and restore output offsets and output
	sections  around bfd_get_relocated_section_contents.  Fix a memory
	leak.
	(simple_save_output_info, simple_restore_output_info): New
	functions.
	* bfd-in2.h: Regenerate.
	* dwarf2.c (read_abbrevs): Use
	bfd_simple_get_relocated_section_contents instead of
	bfd_get_section_contents.
	(decode_line_info): Likewise.
	(_bfd_dwarf2_find_nearest_line): Likewise.  Don't call
	find_rela_addend.
	(find_rela_addend): Remove.
	* elfxx-ia64.c (elfNN_ia64_reloc): Weaken sanity check for
	debugging sections.
	(elfNN_ia64_hash_table_create): Create the hash table with malloc,
	not bfd_zalloc.
2003-04-01 00:12:12 +00:00
Alan Modra 8f3c2f1544 daily update 2003-04-01 00:00:17 +00:00
Nick Clifton 5ed6aba41c Fix memory leaks 2003-03-31 18:13:25 +00:00
Alan Modra 915003af10 daily update 2003-03-31 00:00:06 +00:00
Alan Modra 07f9a27db4 daily update 2003-03-30 00:00:05 +00:00
H.J. Lu 5941afc105 2003-03-28 H.J. Lu <hjl@gnu.org>
* elflink.h (elf_link_add_object_symbols): Correctly combine
	visibilities.
2003-03-29 01:26:33 +00:00
Alan Modra 8f974ed6fc daily update 2003-03-28 23:00:06 +00:00
Alan Modra 74391df5aa daily update 2003-03-27 23:00:04 +00:00
Jakub Jelinek 9d73f260a7 * elfxx-ia64.c (elfNN_ia64_relax_section): Reset self_dtpmod_offset
to -1 before recomputing got offsets.
2003-03-27 22:52:12 +00:00
Alan Modra 7f77cadd2a daily update 2003-03-26 23:00:04 +00:00
Andreas Schwab a5ad465acc * elf32-m68k.c (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Define.
(elf_m68k_relocate_section): Use it to correctly handle symbols
	forced to be local.
	(elf_m68k_finish_dynamic_symbol): Emit RELATIVE reloc for got
	entries for symbols that are forced to be local.
2003-03-26 14:20:14 +00:00
Alexandre Oliva d06471104a * elfxx-mips.c (_bfd_mips_relax_section): New function.
* elfxx-mips.h (_bfd_mips_relax_section): Declare.
* elfn32-mips.c, elf64-mips.c: Use it.
2003-03-26 01:04:22 +00:00
Alan Modra 6850776429 daily update 2003-03-25 23:00:05 +00:00
Nick Clifton e16bb312f5 Add iWMMXt support 2003-03-25 20:56:01 +00:00
Alan Modra 10c139a8c4 daily update 2003-03-24 23:00:05 +00:00
Alan Modra 31f5fa55c7 daily update 2003-03-23 23:00:04 +00:00
Alan Modra 39a204f8bb daily update 2003-03-21 23:00:05 +00:00
DJ Delorie 25f14c34bd * elf32-xstormy16.c (elf32_xstormy16_relocate_section): Call
_bfd_elf_rela_local_sym.
2003-03-21 19:49:11 +00:00
Alan Modra a53a0369d7 daily update 2003-03-20 23:00:05 +00:00
H.J. Lu 04b3329bce 2003-03-20 H.J. Lu <hjl@gnu.org>
* elfxx-ia64.c (elfNN_ia64_relax_section): Don't try relax for
	non-ELF outputs.
2003-03-20 16:04:18 +00:00
Nick Clifton c25cfdf8a2 Initialise $idata2 and $idata5 in case bfd_coff_final_link is not called. 2003-03-20 09:02:09 +00:00
Alan Modra 1548bd26cd daily update 2003-03-19 23:00:06 +00:00
Jakub Jelinek 3e1d7f19ec * elf64-sparc.c (struct sparc64_elf_section_data): Add reloc_count
field.
	(canon_reloc_count): Define.
	(sparc64_elf_slurp_one_reloc_table, sparc64_elf_slurp_reloc_table,
	sparc64_elf_canonicalize_dynamic_reloc): Use it instead of
	reloc_count.
	(sparc64_elf_canonicalize_reloc): New routine.
	(bfd_elf64_canonicalize_reloc): Define.
2003-03-19 09:26:51 +00:00
Jakub Jelinek 3fa1d9175d * elfxx-ia64.c (elfNN_ia64_relax_section): Handle relaxation
againt mergeable sections.  Take r_addend into account when caching
	trampolines.
2003-03-18 23:14:35 +00:00
Alan Modra 19a0fc411b daily update 2003-03-18 23:00:06 +00:00
Richard Henderson f86b235ae5 * elfxx-ia64.c (get_dyn_sym_info): Return NULL gracefully for
local symbols that have no dyninfo.
2003-03-18 18:57:40 +00:00
Alan Modra 80cb56ee7a daily update 2003-03-17 23:00:05 +00:00
Alan Modra 4b0cad56a6 daily update 2003-03-16 23:00:07 +00:00
Alan Modra a385d74e74 daily update 2003-03-15 23:00:06 +00:00
Alan Modra 9ff70bd912 daily update 2003-03-14 23:00:05 +00:00
Nick Clifton 49ae03bff7 (ieee_write_expression): Handle the case where symbol is NULL. 2003-03-14 12:47:20 +00:00
Alan Modra 98a1f36f23 daily update 2003-03-13 23:00:05 +00:00
Nick Clifton 6a457e5c38 Add New Chinese (simplified) PO file. 2003-03-13 15:09:29 +00:00
Nick Clifton 93516ec3e0 (BYTES_IN_WORD): Don't define. 2003-03-13 09:28:49 +00:00
Alexandre Oliva 0b25d3e680 * Reverted 2003-03-02's patch. 2003-03-12 23:06:08 +00:00
Alan Modra b4b0f020bf daily update 2003-03-12 23:00:06 +00:00
Alexandre Oliva fee24f1c5b * elfxx-target.h (bfd_elfNN_canonicalize_reloc): Make it
overridable.
* elf64-mips.c (mips_elf64_canonicalize_reloc,
mips_elf64_get_dynamic_reloc_upper_bound,
mips_elf64_canonicalize_dynamic_reloc): New, adapted from elf.c.
(bfd_elf64_get_canonicalize_reloc,
bfd_elf64_get_dynamic_reloc_upper_bound,
bfd_elf64_canonicalize_dynamic_reloc): Define.
(mips_elf64_slurp_reloc_table): Support dynamic.
(mips_elf64_slurp_one_reloc_table): Adjust.
2003-03-12 22:52:12 +00:00
Nick Clifton 64fb183974 Rename 'index' to 'offset' 2003-03-12 09:59:52 +00:00
Alan Modra 5acd598562 daily update 2003-03-11 23:00:07 +00:00
Alexandre Oliva 908488f19e * elfxx-mips.c (mips_elf_create_dynamic_relocation): Do not create
dynamic relocations pointing to local or section symbols, use the
NULL symbol instead.  Document the choice to not emit an
additional R_MIPS_64 relocation.
2003-03-11 19:11:38 +00:00
Alan Modra e515b05172 * elf32-ppc.c (ppc_elf_relocate_section): Subtract tls seg vma from
zero index dynamic tls relocs generated for the GOT.  Tidy code.
	Set "relocation" to 1 on DTPMOD32 relocs.  Optimize HA adjustment.
	* elf64-ppc.c (ppc64_elf_relocate_section): Likewise.

	* ld-powerpc/tlsso.r: Adjust for corrected zero symbol index relocs.
	* ld-powerpc/tlsso32.r: Likewise.
2003-03-10 23:25:13 +00:00
Alan Modra 8c87bc2296 daily update 2003-03-10 23:00:05 +00:00
Alan Modra c0f69a30e3 daily update 2003-03-09 23:00:05 +00:00
Alan Modra caf1733912 daily update 2003-03-08 23:00:06 +00:00
Alan Modra 0c6c1cc544 daily update 2003-03-07 23:00:06 +00:00
Alan Modra 87d243f1ce * elf32-ppc.c (ppc_elf_relocate_section): Don't look for a nop after
a tls_get_addr call.
2003-03-07 01:09:01 +00:00
Alan Modra a23b68450a * elf32-ppc.c (ELIMINATE_COPY_RELOCS): Define as one.
(ppc_elf_adjust_dynamic_symbol): For weak symbols, copy
	ELF_LINK_NON_GOT_REF from weakdef.
	* elf64-ppc.c (ELIMINATE_COPY_RELOCS): Define as one.
	(ppc64_elf_adjust_dynamic_symbol): For weak symbols, copy
	ELF_LINK_NON_GOT_REF from weakdef.
	* elf32-i386.c (ELIMINATE_COPY_RELOCS): Define as one.  Use throughout.
	(elf_i386_adjust_dynamic_symbol): For weak symbols, copy
	ELF_LINK_NON_GOT_REF from weakdef.
2003-03-06 23:26:20 +00:00
Alan Modra 9ad120e985 daily update 2003-03-06 23:00:04 +00:00
Andrew Haley 2d36fe5f1f 2003-03-06 Jakub Jelinek <jakub@redhat.com>
Andrew Haley  <aph@redhat.com>

        * elflink.h (elf_bfd_discard_info): Don't process eh frames if
        output is relocateable.
2003-03-06 15:47:23 +00:00
Nick Clifton 34f304a773 (som_fixup_formats): Correct formats for R_AUX_UNWIND and R_COMMENT. 2003-03-06 12:29:04 +00:00
Alan Modra 7b609f53e8 * elf32-ppc.c (ppc_elf_create_linker_section): Don't capitalize
error messages.
	(ELIMINATE_COPY_RELOCS): Define to zero.
	(ppc_elf_relocate_section): Don't deref htab->tls_sec when calculating
	TLSLD relocs.  Report reloc types on a number of errors.  Optimize
	LOCAL24PC check for non-local syms.  Don't capitalize error messages.
	* elf64-ppc.c (ELIMINATE_COPY_RELOCS): Define to zero.
	(ppc64_elf_relocate_section): Don't deref htab->tls_sec when
	calculating TLSLD relocs.  Report reloc types on a number of errors.
	Don't capitalize error messages.
2003-03-06 11:32:43 +00:00
Alan Modra 77bc0b710e daily update 2003-03-05 23:00:06 +00:00
Alan Modra 0142110d79 daily update 2003-03-04 23:00:05 +00:00
H.J. Lu 6a0fb18653 2003-03-03 H.J. Lu <hjl@gnu.org>
* elfxx-ia64.c (USE_BRL): Removed.
	(oor_ip): Removed.
2003-03-03 23:19:19 +00:00
Alan Modra ae6572b921 daily update 2003-03-03 23:00:06 +00:00
Joern Rennecke bdfaef528f Fix sh-elf linker relaxation:
gcc:
	* config/sh/sh.h (EXTRA_SPECS): Add subtarget_asm_relax_spec and
	subtarget_asm_isa_spec.
	(SUBTARGET_ASM_RELAX_SPEC, SUBTARGET_ASM_ISA_SPEC): Define.
	(ASM_SPEC): Define as SH_ASM_SPEC.
	(SH_ASM_SPEC): New; take the role of ASM_SPEC, but safe from svr4.h.
	Use subtarget_asm_relax_spec and subtarget_asm_isa_spec.
	* config/sh/elf.h (ASM_SPEC): Use SH_ASM_SPEC.
	(SUBTARGET_ASM_ISA_SPEC): Undef / define.
gcc/testsuite:
	gcc.dg/sh-relax.c: New test.

include/elf:
	* sh.h (EF_SH_MERGE_MACH): Make sure SH2E & SH3/SH3E merge to SH3E,
	and SH2E & SH4 merge to SH4, not SH2E.

gas:
	* config/tc-sh.c (sh_dsp): Replace with preset_target_arch.
	(md_begin): Use preset_target_arch.
	(md_longopts): Make isa option unconditional.
	(md_parse_option): Make OPTION_DSP and OPTION_ISA sh4 / any
	set preset_target_arch.
	(md_apply_fix3): If BFD_ASSEMBLER, adjust SWITCH_TABLE fixups
	by -S_GET_VALUE  (fixP->fx_subsy).
	(tc_gen_reloc): For SWITCH_TABLE fixups, the symbol is fixp->fx_subsy,
	and the addend is 0.
	Adjust addend of R_SH_IND12W relocations by fixp->fx_offset - 4.
	* config/tc-sh.h (TC_FORCE_RELOCATION_SUB_LOCAL): Define.

bfd:
	elf32-sh.c (sh_elf_howto_tab): Make R_SH_IND12W into an ordinary
	relocation (no special function), and make it non-partial_inplace.
	(sh_elf_relax_section): When creating a bsr, use a consistent value
	no matter if the symbol is extern or not;  set addend to -4.
	Don't swap load / non-load instructions for SH4.
	(sh_elf_relax_delete_bytes): In R_SH_IND12W case, check the offset
	rather than if the symbol is external to determine if adjusting the
	offset makes sense.  Adjust the addend too if appropriate.
	(sh_elf_relocate_section): In R_SH_IND12W, don't fiddle with the
	relocation.
2003-03-03 21:04:01 +00:00
Nick Clifton a9d68a1ea5 Installed latest Danish translation. 2003-03-03 10:08:02 +00:00
Alan Modra 79ba9c9faf daily update 2003-03-02 23:00:05 +00:00
Thiemo Seufer 7c2be35cae * elf32-mips.c (elf_mips_howto_table_rel): Change definition of
R_MIPS_PC16 to rightshift 2.
	(elf_reloc_map mips_reloc_map): Map to rightshifted BFD reloc.
	(bfd_elf32_bfd_reloc_type_lookup): Support
	BFD_RELOC_MIPSEMB_16_PCREL_S2.
	* elf64-mips.c (mips_elf64_howto_table_rel): Change definition of
	R_MIPS_PC16 to rightshift 2.
	(mips_elf64_howto_table_rela): Likewise.
	(mips_reloc_map): Map to rightshifted BFD reloc.
	* elfn32-mips.c: The same as in elf64-mips.c.
	* elfxx-mips.c (mips_elf_got_for_ibfd): Typo in comment.
	(mips_elf_calculate_relocation): Handle rightshifted addends for
	R_MIPS_PC16.
	* reloc.c (BFD_RELOC_MIPSEMB_16_PCREL_S2): New BFD relocation for
	MIPS Embedded PIC. Remove superfluous empty COMMENT.
	* libbfd.h: Regenerate.
	* bfd-in2.h: Regenerate.
	* config/tc-mips.c (append_insn): Add handling of
	BFD_RELOC_MIPSEMB_16_PCREL_S2. Avoid emitting unneeded
	BFD_RELOC_16_PCREL_S2 relocs and add earlier warnings about
	misaligned address and reange overflow.
	(macro_build): Add handling of BFD_RELOC_MIPSEMB_16_PCREL_S2. Add
	earlier warnings about misaligned address and reange overflow.
	(mips_ip): Add handling of BFD_RELOC_MIPSEMB_16_PCREL_S2.
	(md_apply_fix): Likewise. Fix warning output.
	(tc_gen_reloc): Add handling of BFD_RELOC_MIPSEMB_16_PCREL_S2.
	Allow BFD_RELOC_16_PCREL_S2 for all ABIs.
	(md_convert_frag): Add handling of BFD_RELOC_MIPSEMB_16_PCREL_S2.
	* gas/mips/bge.d: Reactivate external branch tests.
	* gas/mips/bge.s: Likewise.
	* gas/mips/bgeu.d: Likewise.
	* gas/mips/bgeu.s: Likewise.
	* gas/mips/blt.d: Likewise.
	* gas/mips/blt.s: Likewise.
	* gas/mips/bltu.d: Likewise.
	* gas/mips/bltu.s: Likewise.
	* gas/mips/branch-misc-2.d: New File.
	* gas/mips/branch-misc-2.l: Remove.
	* gas/mips/mips.exp: Adjust branch-misc-2 test.
2003-03-02 21:30:15 +00:00
Alan Modra 13101e749e daily update 2003-03-01 23:00:05 +00:00
Richard Henderson 484a4f9ca6 * elfxx-ia64.c (elfNN_ia64_relax_section): Correct bounds
for ltoff22x relaxation.
2003-03-01 02:44:45 +00:00
Alan Modra 2ce40c65db * bfd-in.h (_bfd): Don't define.
* bfd.c: Rename occurrences of "struct _bfd" to "struct bfd".
	* syms.c: Likewise.
	* bfd-in2.h: Regenerate.
2003-02-28 23:43:35 +00:00
Alan Modra c30b8939c6 daily update 2003-02-28 23:00:04 +00:00
Richard Henderson 2c4c2bc0a5 * elfxx-ia64.c (struct elfNN_ia64_dyn_sym_info): Add want_gotx;
(elfNN_ia64_check_relocs): Set it.
        (allocate_global_data_got): Check it.
        (allocate_local_got): Likewise.
        (allocate_dynrel_entries): Likewise.
        (elfNN_ia64_relax_ldxmov): New.
        (elfNN_ia64_relax_section): Handle LTOFF22X, LDXMOV.
        (elfNN_ia64_choose_gp): Split out from ...
        (elfNN_ia64_final_link): ... here.
2003-02-28 00:22:46 +00:00
Alan Modra 56b49d2030 daily update 2003-02-27 23:00:05 +00:00
Andrew Cagney c2852e886c 2003-02-27 Andrew Cagney <cagney@redhat.com>
* bfd.c (struct bfd): Rename "struct _bfd".
	* bfd-in.h: Update copyright.
	(struct bfd): Rename "struct _bfd".
	(_bfd): Define for backward compatibility.
	* bfd-in2.h: Regenerate.
2003-02-27 21:24:36 +00:00
Alan Modra 5d1a8fc95a daily update 2003-02-26 23:00:15 +00:00
Alan Modra d8ff4336c6 daily update 2003-02-25 23:00:05 +00:00
Alan Modra 4fabe71ea9 * elflink.h (elf_link_read_relocs_from_section): Don't abort with
wrong reloc sizes.
2003-02-25 04:39:32 +00:00
Alan Modra 3f9a32bd0b * elflink.h (elf_bfd_final_link): Apportion reloc counts to rel_hdr
and rel_hdr2 when initially counting input relocs rather than after
	creating output reloc sections.
2003-02-25 04:14:38 +00:00
Alan Modra 3f87cb706e Regenerate dependencies. 2003-02-25 03:44:46 +00:00
Alan Modra c8d6825d9a daily update 2003-02-24 23:00:06 +00:00
Nick Clifton 07c6e93658 Add support for QNX style core files. 2003-02-24 18:07:22 +00:00
Alan Modra aad5d35016 * elflink.c (_bfd_elf_create_got_section): Check existing .got
section flags before concluding that we've already been called.
	Don't use register keyword.
	(_bfd_elf_create_dynamic_sections): Don't use register keyword.
	(_bfd_elf_create_linker_section): Formatting.
2003-02-24 04:50:04 +00:00
Alan Modra cc13e15a3b daily update 2003-02-23 23:00:05 +00:00
Alan Modra eabce1b6d0 daily update 2003-02-22 23:00:05 +00:00
Alan Modra 718bcd5a2b daily update 2003-02-21 23:00:05 +00:00
Alan Modra 29767ab128 daily update 2003-02-20 23:00:05 +00:00
Nick Clifton 2ab1486e70 Fix typo: intial -> initial. 2003-02-20 18:59:32 +00:00
Alan Modra 70bccea4c6 * elf32-ppc.c: Formatting.
(allocate_dynrelocs): LD and GD relocs against the same sym need
	separate GOT entries.
	(ppc_elf_relocate_section): Correct GOT handling for multiple GOT
	entries per symbol.
2003-02-20 09:10:18 +00:00
Alan Modra 1185e3dde6 daily update 2003-02-19 23:00:06 +00:00
Alan Modra 26e415943a * elf32-hppa.c (elf32_hppa_gc_sweep_hook): Simplify dynamic reloc
removal.  Localize vars.  Remove unnecessary dynobj test.
	* elf32-i386 (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Pass SHARED instead
	of INFO.
	(allocate_dynrelocs): Adjust WILL_CALL_FINISH_DYNAMIC_SYMBOL uses,
	and optimize.
	(elf_i386_relocate_section): Likewise.
	(elf_i386_gc_sweep_hook): Simplify dyn reloc removal.  Localize vars.
	* elf32-s390.c (elf_s390_gc_sweep_hook): Likewise.
	* elf32-sh.c (sh_elf_gc_sweep_hook): Likewise.
	* elf64-s390.c (elf_s390_gc_sweep_hook): Likewise.
	* elf64-x86-64.c (elf64_x86_64_gc_sweep_hook): Likewise.
	* elf32-sparc.c (elf32_sparc_gc_sweep_hook): Likewise.  Remove
	local_dynrel for section too.  Don't touch HIPLT22, LOPLT10, PCPLT32
	or PCPLT10 relocs.  Don't subtract twice on PLT32 relocs.
	Formatting.
2003-02-19 14:14:16 +00:00
Alan Modra f4656909e9 * elf64-ppc.c (ELIMINATE_COPY_RELOCS): Define.
(ppc64_elf_check_relocs): Use it.  Correct comment.  Move SEC_ALLOC
	test.
	(ppc64_elf_adjust_dynamic_symbol): Use ELIMINATE_COPY_RELOCS.
	(WILL_CALL_FINISH_DYNAMIC_SYMBOL): Pass SHARED instead of INFO.
	(allocate_dynrelocs): Adjust WILL_CALL_FINISH_DYNAMIC_SYMBOL uses,
	and optimize.  Use ELIMINATE_COPY_RELOCS.
	(ppc64_elf_relocate_section): Likewise.
2003-02-19 11:44:15 +00:00
Alan Modra ee05f2fe2f * elf32-ppc.c (struct ppc_elf_dyn_relocs): Add pc_count field.
(ppc_elf_copy_indirect_symbol): Copy pc_count field.
	(ELIMINATE_COPY_RELOCS): Define.
	(ppc_elf_adjust_dynamic_symbol): Convert copy relocs to dynamic.
	(WILL_CALL_FINISH_DYNAMIC_SYMBOL): Pass SHARED instead of INFO.
	(MUST_BE_DYN_RELOC): Define.
	(allocate_dynrelocs): Adjust WILL_CALL_FINISH_DYNAMIC_SYMBOL uses,
	and optimize.  Trim dyn_relocs.
	(ppc_elf_check_relocs): Don't generate dyn_relocs when we know they'll
	not be used.  Do generate dyn_relocs for copy reloc avoidance.  Keep
	track of pc_rel dyn relocs.
	(ppc_elf_relocate_section): Remove "will_become_local".  Adjust
	WILL_CALL_FINISH_DYNAMIC_SYMBOL use.  Trim dyn relocs as per
	allocate_dynrelocs.  Don't recalculate "sec".
2003-02-19 11:26:50 +00:00
Alan Modra 2046d4bcae daily update 2003-02-18 23:00:06 +00:00
Alan Modra d881513ac9 * elf32-ppc.c (ppc_elf_relocate_section): Remove unnecessary test.
* elf64-ppc.c (ppc64_elf_tls_optimize): Decrement tlsld_got.refcount
	on invalid LD relocs.
	(allocate_dynrelocs): Invalid LD relocs don't use tlsld_got entry.
	(ppc64_elf_relocate_section): Unify new handling of LD relocs and
	tlsld_got entry.  Use IS_PPC64_TLS_RELOC.
2003-02-18 12:54:15 +00:00
Alan Modra 7619e7c7de * elf32-ppc.h: New file.
* elf32-ppc.c: Include elf32-ppc.h.
	(NOP, CROR_151515, CROR_313131, TP_OFFSET, DTP_OFFSET): Define.
	(struct ppc_elf_link_hash_entry): Rename "root" to "elf".  Adjust uses.
	Add "tls_mask" field.
	(TLS_GD, TLS_LD, TLS_TPREL, TLS_DTPREL, TLS_TLS, TLS_TPRELGD): Define.
	(struct ppc_elf_link_hash_table): Rename "root" to "elf".  Adjust uses.
	Add got, relgot, plt, relplt, dynbss, relbss, dynsbss, relsbss,
	sdata, sdata2, tls_sec, tls_get_addr, tlsld_got fields.
	Make use of htab shortcuts throughout file.
	(ppc_elf_link_hash_newfunc): Init tls_mask field.
	(ppc_elf_link_hash_table_create): Init new fields.
	(ppc_elf_copy_indirect_symbol): Copy tls_mask.
	(ppc_elf_howto_raw): Add tls relocs.
	(ppc_elf_reloc_type_lookup): Handle them.
	(ppc_elf_unhandled_reloc): New function.
	(ppc_elf_create_got): Stash got section pointer in hash table,
	return status.  Make .rela.got too.
	(ppc_elf_create_dynamic_sections): Stash section pointers in htab.
	(ppc_elf_adjust_dynamic_symbol): Only set up copy relocs when
	NON_GOT_REF set.  Don't allocate space in .plt here..
	(allocate_dynrelocs): ..do so here instead, properly ref-counting and
	not allocating plt entries unnecessarily.  Allocate got entries here.
	(WILL_CALL_FINISH_DYNAMIC_SYMBOL): Define.
	(ppc_elf_size_dynamic_sections): Allocate local got entries.  Pass
	"info" during allocate_dynrelocs hash traversal.  Use htab section
	shortcuts rather than searching for named sections.  Get rid of
	"plt" and "strip" booleans.
	(update_local_sym_info, bad_shared_reloc): New functions.
	(ppc_elf_check_relocs): Handle TLS relocs.  Move .rela.got creation to
	ppc_elf_create_got.  Don't mark got or plt reloc syms dynamic, do so
	in allocate_dynreloc.  Use update_local_sym_info and bad_shared_reloc.
	Disallow R_PPC_EMB_RELSDA, R_PPC_EMB_NADDR32, R_PPC_EMB_NADDR16,
	R_PPC_EMB_NADDR16_LO, R_PPC_EMB_NADDR16_HI and R_PPC_EMB_NADDR16_HA
	in shared libs.  R_PPC_PLTREL32 is a plt reloc too.  Refcount all
	relocs that might use a plt entry.  Set NON_GOT_REF too.
	Enumerate all do-nothing relocs.
	(ppc_elf_gc_sweep_hook): Simplify removal of dynrelocs.  Handle
	tls relocs and all plt relocs.
	(ppc_elf_tls_setup, ppc_elf_tls_optimize): New functions.
	(ppc_elf_finish_dynamic_symbol): Don't build got entries here.
	(ppc_elf_finish_dynamic_sections): Rewrite tag code using htab
	shortcuts.
	(ppc_elf_relocate_section): Tidy.  Handle TLS relocs.  Use
	bfd_elf_local_sym_name.  Simplify unresolved reloc code.  Build got
	entries and got relocs here.  Warn on non-zero got reloc addend.
	Split out branch taken/not taken reloc code into a separate switch
	and correct offset calculation. Allow BRTAKEN/BRNTAKEN dynamic relocs.
	Split out HA reloc adjustments to separate switch statement.  Don't
	warn on reloc overflow if we've already warned about undefined.
	Don't rebuild sym name when reporting errors.  Report all possible
	errors from _bfd_final_link_relocate.
	(bfd_elf32_bfd_final_link): Don't define.
2003-02-18 06:06:17 +00:00
Alan Modra b5503a6c69 daily update 2003-02-17 23:00:05 +00:00
Alan Modra cd27b2768b * elf64-ppc.c (ppc64_elf_relocate_section): Don't init "r". Don't
rebuild sym name when reporting errors.
2003-02-17 22:57:54 +00:00
Nick Clifton ae9a127f86 Fix the behaviour of --allow-shlib-undefined, so that it does what it claims
to do.  Add an inverse switch.  Update the documentation.
2003-02-17 18:24:40 +00:00
Nick Clifton b5f852ea83 SEGMENT_OVERLAPS: Check that LMAs overlap as well. 2003-02-17 18:13:18 +00:00
Alan Modra da97039a7c daily update 2003-02-15 23:00:06 +00:00
Alan Modra 2b9583905d daily update 2003-02-14 23:00:05 +00:00
Nick Clifton ed781d5d99 Change embedded documentation to use consistent indentation and to split up
long lines.  Change informal style of description for functions lacking real
documentation.
2003-02-14 11:16:09 +00:00
Nick Clifton 21efdc8d7c (_bfd_stab_section_find_nearest_line): For line number stabs outside of
functions, treat values as absolute addresses.
2003-02-14 09:31:57 +00:00
Nick Clifton 3193e2343c (elf_core_file_p): Compare alternate machine codes for ELF backends when
checking if the generic ELF target should be used.
2003-02-14 09:21:21 +00:00
Alan Modra 58ac9f718e * elf64-ppc.c (ppc64_elf_link_hash_table_create): Init tls_get_addr.
(ppc64_elf_copy_indirect_symbol): Merge tls_mask too.
	(ppc64_elf_gc_sweep_hook): Simplify removal of dyn_relocs.
	(allocate_dynrelocs): Don't treat undefined and undefweak specially.
	(ppc_size_one_stub): Fix warning, and tighten plt entry check.
	(group_sections): Don't share a stub section if stubs are for a large
	section.  Adjust comment.
	(ppc64_elf_size_stubs): Roughly double the size left for stubs if
	!stubs_always_before_branch.
	(ppc64_elf_relocate_section): Initialize tlsld GOT entry once.  Don't
	treat undefined and undefweak specially when processing dyn relocs.
2003-02-13 23:48:31 +00:00
Alan Modra 224ec17a5e daily update 2003-02-13 23:00:06 +00:00
Jakub Jelinek 9147e853bf bfd/
* elflink.h (elf_link_add_object_symbols): Handle .symver x, x@FOO.
ld/testsuite/
	* ld-shared/shared.exp: Run on s390*-*-linux* and x86_64-*-linux* too.
	xfail tests linking non-pic code into shared libs on x86_64-*-linux*.
	* ld-elfvsb/elfvsb.exp: Likewise.
	* ld-elfvers/vers.exp: Likewise.  Add vers24a, vers24b and vers24c
	tests.
	* ld-elfvers/vers3.ver: Allow VERS_2.0 to come before GLIBC_*
	version.
	* ld-elfvers/vers19.ver: Likewise.
	* ld-elfvers/vers24a.c: New test.
	* ld-elfvers/vers24b.c: New test.
	* ld-elfvers/vers24c.c: New test.
	* ld-elfvers/vers24.map: New test.
	* ld-elfvers/vers24.rd: New test.
	* lib/ld-lib.exp (run_ld_link_tests): Add optional 7th argument
	cflags.  If source files have .c extension, compile them first.
2003-02-13 22:14:11 +00:00
Nick Clifton 427bfd905d (elf32_thumb_to_arm_stub): Include section VMAs in computation of offset to
insert into BL instruction.
2003-02-13 19:35:22 +00:00
Nick Clifton 53954f5e85 Documenation formatting improvements.
Move Gnu Free Documenation License to a seperate file.
2003-02-13 11:26:41 +00:00
Alan Modra 5b54723e51 daily update 2003-02-12 23:00:05 +00:00
Alan Modra 44aa9df053 daily update 2003-02-11 23:00:05 +00:00
Nick Clifton 42b5d0eaa9 Add support for configuring *-*-kaos targets. 2003-02-11 13:47:08 +00:00
Alan Modra a48ebf4d62 * elf64-ppc.c (ppc64_elf_check_relocs): Match versioned
.__tls_get_addr too.
	(ppc64_elf_tls_setup): Ensure cached tls_get_addr is not indirect.
2003-02-11 03:02:46 +00:00
Alan Modra 4c188e4954 daily update 2003-02-10 23:00:05 +00:00
Kaz Kojima c95b8a7ace * elf32-sh.c (elf_sh_dyn_relocs): Add tls_tpoff32 field.
(elf_sh_link_hash_entry): Remove tls_tpoff32 field.
	(sh_elf_link_hash_newfunc): Remove the initialization of
	tls_tpoff32 field.
	(allocate_dynrelocs): Keep dyn_relocs if it includes the entry
	for which tls_tpoff32 flag is set.
	(sh_elf_relocate_section): Covert to LE only if the dyn_relocs
	of the symbol includes the entry matched with the input_section
	and having tls_tpoff32 flag on.	 When linking statically, set
	symbol index of R_SH_TLS_TPOFF32 relocation to zero if the symbol
	is defined in this executable.
	(sh_elf_check_relocs): Set tls_tpoff32 flag appropriately.
2003-02-10 22:17:18 +00:00
Jakub Jelinek a779acda15 * elf32-s390.c (elf_s390_size_dynamic_sections): Set relocs to TRUE
even if there is just non-empty .rela.plt.
2003-02-10 13:22:12 +00:00
Nick Clifton c178919ba9 Add function to set machine number based on flags in header. 2003-02-10 11:21:19 +00:00
Nick Clifton fde78edd7a Add support for marking ARM ELF binaries as support the Cirrus EP9312 Maverick
floating point co-processor.
2003-02-10 10:44:48 +00:00