Commit Graph

4751 Commits

Author SHA1 Message Date
Bob Wilson dd1a320be6 * elf32-xtensa.c (bfd_elf_xtensa_reloc): Make sure that
xtensa_default_isa is initialized.
2005-05-20 19:53:18 +00:00
Alan Modra 28e99bb619 * elf32-ppc.c (allocate_dynrelocs): Correct plt offset assigned
for second and subsequent list entries.  Only allocate multiple
	glink stubs when shared or pie.
	(ppc_elf_finish_dynamic_symbol): Break out early when only one
	glink stub is needed.
2005-05-20 02:37:21 +00:00
Alan Modra ef1c2edf40 daily update 2005-05-20 00:00:07 +00:00
Zack Weinberg e3e71e27a4 * bfd/Makefile.am, binutils/Makefile.am, etc/Makefile.in
* gas/Makefile.am: Have 'all' depend on 'info'.
	* ld/Makefile.am: Have 'all' depend on 'info' and 'ld.1'.
	* bfd/Makefile.in, binutils/Makefile.in, gas/Makefile.in
	* ld/Makefile.in: Regenerate.
2005-05-19 23:49:52 +00:00
Alan Modra a6aa51957c * elf-bfd.h (struct elf_link_hash_table): Delete init_refcount and
init_offset.  Add init_got_refcount, init_plt_refcount,
	init_got_offset and init_plt_offset.
	* elf.c (_bfd_elf_link_hash_newfunc): Adjust for above change.
	(_bfd_elf_link_hash_hide_symbol): Likewise.
	(_bfd_elf_link_hash_table_init): Likewise.
	* elf32-hppa.c (elf32_hppa_hide_symbol): Likewise.
	* elf64-ppc.c (ppc64_elf_link_hash_table_create): Likewise.
	* elflink.c (_bfd_elf_adjust_dynamic_symbol): Likewise.
	(bfd_elf_size_dynamic_sections): Likewise.
	* elf32-ppc.c (GLINK_PLTRESOLVE): Now 16 insns.
	(LWZU_0_X_12, LWZ_0_4_30, LWZ_0_X_12, LWZ_11_X_11, LWZ_11_X_30,
	LWZ_12_4_12, LWZ_12_8_30, LWZ_12_X_12, SUB_11_11_30): Delete.
	(ADDIS_12_12, BCL_20_31, LWZU_0_12, LWZ_0_12, LWZ_11_11, LWZ_11_30,
	LWZ_12_12, MFLR_0, MFLR_12, MTLR_0, SUB_11_11_12): Define.
	(struct plt_entry): New.
	(ppc_elf_link_hash_table_create): Set new init_plt fields.
	(ppc_elf_copy_indirect_symbol): Handle merge of plt plist.  Don't
	use _bfd_elf_link_hash_copy_indirect.
	(update_plt_info, find_plt_ent): New functions.
	(ppc_elf_check_relocs): Handle R_PPC_PLTREL24 with non-zero addend
	and adjust for use of plt list rather than refcount.
	(ppc_elf_gc_sweep_hook): Likewise.
	(ppc_elf_tls_optimize): Likewise.
	(ppc_elf_adjust_dynamic_symbol): Likewise.
	(allocate_dynrelocs): Likewise.
	(ppc_elf_relax_section): Likewise.
	(ppc_elf_relocate_section): Likewise.  Adjust R_PPC_PLTREL24 addends
	when performing a relocatable link.
	(ppc_elf_finish_dynamic_symbol): Likewise.  Write .glink stubs here..
	(ppc_elf_finish_dynamic_sections): ..rather than here.  Use new
	pic resolver stub.
2005-05-19 08:26:56 +00:00
Alan Modra a49e53ed18 * elf.c (assign_file_positions_for_segments): Use maximum of
maxpagesize and section alignment when adjusting initial
	segment offset and section offsets.
2005-05-19 06:51:01 +00:00
Alan Modra 26c7239ab4 daily update 2005-05-19 00:00:05 +00:00
Zack Weinberg cb1afa5cf4 * bfd/elf32-arm.c: Make all #ifndef OLD_ARM_ABI blocks
unconditional.
	* include/elf/arm.h: Make all #ifndef OLD_ARM_ABI blocks
	unconditional, delete all #ifdef OLD_ARM_ABI blocks.
2005-05-18 16:48:15 +00:00
H.J. Lu 13792e9d85 2005-05-18 H.J. Lu <hongjiu.lu@intel.com>
* elf.c (group_signature): Check if the symbol table section is
	correct.
2005-05-18 13:41:59 +00:00
Zack Weinberg c19d120533 include/elf:
* arm.h: Import complete list of official relocation names
	and numbers from AAELF.  Define FAKE_RELOCs for old names.
	Remove a few old names no longer used anywhere.

bfd:
	* elf32-arm.c: Wherever possible, use official reloc names
	from AAELF.
	(elf32_arm_howto_table, elf32_arm_tls_gd32_howto)
	(elf32_arm_tls_ldo32_howto, elf32_arm_tls_ldm32_howto)
	(elf32_arm_tls_le32_howto, elf32_arm_tls_ie32_howto)
	(elf32_arm_vtinherit_howto, elf32_arm_vtentry_howto)
	(elf32_arm_pc11_howto, elf32_arm_thm_pc9_howto, elf32_arm_got_prel)
	(elf32_arm_r_howto): Replace with elf32_arm_howto_table_1,
	elf32_arm_howto_table_2, and elf32_arm_howto_table_3.
	Add many new relocations from AAELF.
	(elf32_arm_howto_from_type): Update to match.
	(elf32_arm_reloc_map): Add entries for R_ARM_THM_JUMP24,
	R_ARM_THM_JUMP11, R_ARM_THM_JUMP19, R_ARM_THM_JUMP8,
	R_ARM_THM_JUMP6, R_ARM_GNU_VTINHERIT, and R_ARM_GNU_VTENTRY.
	(elf32_arm_reloc_type_lookup): Use elf32_arm_howto_from_type.
	(elf32_arm_final_link_relocate): Add support for
	R_ARM_THM_JUMP24, R_ARM_THM_JUMP19, R_ARM_THM_JUMP6.  Remove
	case entries redundant with default.

	* reloc.c: Reorganize ARM relocations.  Add Thumb
	assembler-internal relocations BFD_RELOC_ARM_T32_OFFSET_U8,
	BFD_RELOC_ARM_T32_OFFSET_IMM, BFD_RELOC_ARM_T32_IMMEDIATE.
	Add visible relocations BFD_RELOC_THUMB_PCREL_BRANCH7,
	BFD_RELOC_THUMB_BRANCH20, BFD_RELOC_THUMB_BRANCH25.
	Delete unused relocations BFD_RELOC_ARM_GOT12, BFD_RELOC_ARM_COPY.
	* bfd-in2.h, libbfd.h: Regenerate.

opcodes:
	* arm-dis.c (thumb_opcodes): Add disassembly for V6T2 16-bit
	instructions.  Adjust disassembly of some opcodes to match
	unified syntax.
	(thumb32_opcodes): New table.
	(print_insn_thumb): Rename print_insn_thumb16; don't handle
	two-halfword branches here.
	(print_insn_thumb32): New function.
	(print_insn): Choose among print_insn_arm, print_insn_thumb16,
	and print_insn_thumb32.  Be consistent about order of
	halfwords when printing 32-bit instructions.

gas:
	* hash.c (hash_lookup): Add len parameter.  All callers changed.
	(hash_find_n): New interface.
	* hash.h: Prototype hash_find_n.
	* sb.c: Include as.h.
	(scrub_from_sb, sb_to_scrub, scrub_position): New statics.
	(sb_scrub_and_add_sb): New interface.
	* sb.h: Prototype sb_scrub_and_add_sb.
	* input-scrub.c (input_scrub_include_sb): Use sb_scrub_and_add_sb.

	* config/tc-arm.h (TC_FORCE_RELOCATION_LOCAL): Remove
	reference to BFD_RELOC_ARM_GOT12 which is never generated.
	* config/tc-arm.c: Rewrite, adding Thumb-2 support.

gas/testsuite:
	* gas/arm/arm.exp: Convert all existing "gas_test" tests to
	"run_dump_test" tests.  Run more tests unconditionally.  Run new tests.
	* gas/arm/arch4t.s, gas/arm/arch6zk.s, gas/arm/arm3.s, gas/arm/arm6.s
	* gas/arm/arm7dm.s, gas/arm/bignum1.s, gas/arm/float.s
	* gas/arm/immed.s, gas/arm/iwmmxt.s, gas/arm/offset.s, gas/arm/thumb.s:
	Adjust to work as a dump test.
	* gas/arm/arch4t.d, gas/arm/arch6zk.d, gas/arm/arm3.d, gas/arm/arm6.d
	* gas/arm/arm7dm.d, gas/arm/bignum1.d, gas/arm/float.d
	* gas/arm/immed.d, gas/arm/iwmmxt.d, gas/arm/offset.d, gas/arm/thumb.d:
	New files.

	* gas/arm/armv1-bad.l, gas/arm/armv1-bad.s: Remove tests for
	diagnostics that don't happen in the first pass anymore.

	* gas/arm/iwmmxt-bad.l, gas/arm/r15-bad.l, gas/arm/req.l
	* gas/arm/vfp-bad.l:
	Update expected diagnostics.
	* gas/arm/pic.d: Update expected reloc name.
	* gas/arm/thumbv6.d: CPY no longer appears in disassembly.
	* gas/arm/r15-bad.s: Avoid two-argument mul.
	* gas/arm/req.s: Adjust comments.
	* gas/arm/maverick.d, gas/arm/maverick.s: Avoid inappropriate
	use of PC.

	* gas/arm/macro-1.d, gas/arm/macro1.s
	* gas/arm/t16-bad.l, gas/arm/t16-bad.s
	* gas/arm/tcompat.d, gas/arm/tcompat.s
	* gas/arm/tcompat2.d, gas/arm/tcompat2.s
	* gas/arm/thumb32.d, gas/arm/thumb32.s
	New test pair.

ld/testsuite:
	* ld-arm/mixed-app.d: Adjust expected disassembly a little.
2005-05-18 05:40:12 +00:00
Alan Modra ddc06ef398 daily update 2005-05-18 00:00:05 +00:00
Daniel Jacobowitz 26ae6d5ed0 * elf.c (_bfd_elf_write_object_contents): Check for non-NULL
elf_shstrtab.
	* format.c (bfd_check_format_matches): Set output_has_begun
	for both_direction.
	* section.c (bfd_set_section_contents): Use bfd_write_p.  Remove
	special case for both_direction.
2005-05-17 19:44:55 +00:00
Nick Clifton 5982e3c7e8 (group_signature): Check for a group section which is actually a (corrupt)
symbol table section in disguise and prevent an infinite loop from occurring.
2005-05-17 18:08:08 +00:00
H.J. Lu fc3ab69909 2005-05-17 H.J. Lu <hongjiu.lu@intel.com>
* elfxx-ia64.c (elfNN_ia64_relax_brl): Undo the change made on
	2005-02-16.
2005-05-17 17:26:27 +00:00
H.J. Lu 5e27d42770 2005-05-17 H.J. Lu <hongjiu.lu@intel.com>
* elfxx-ia64.c (elfNN_ia64_relax_br): Keep the original
	predicate on slot 0 only if slot 0 isn't br.
2005-05-17 17:23:37 +00:00
H.J. Lu 75ff45898c bfd/
2005-05-17  H.J. Lu  <hongjiu.lu@intel.com>

	PR 797
	* elf32-i386.c (elf_i386_size_dynamic_sections): Also remove
	empty sdynbss section.
	* elf64-x86-64.c (elf64_x86_64_size_dynamic_sections): Likewise.

ld/

2005-05-17  H.J. Lu  <hongjiu.lu@intel.com>

	PR 797
	* ldexp.c (exp_fold_tree_1): Renamed from exp_fold_tree and
	take take a bfd_boolean, mark_used. Ignore assert failure if
	mark_used is TRUE.
	(exp_fold_tree) Call exp_fold_tree_1 with mark_used == FALSE.
	(exp_fold_tree_no_dot): Updated to take a bfd_boolean,
	mark_used and pass down.
	(fold_unary): Likewise.
	(fold_binary): Likewise.
	(fold_trinary): Likewise.
	(exp_binop): Add FALSE to call to exp_fold_tree_no_dot.
	(exp_trinop): Likewise.
	(exp_unop): Likewise.
	(exp_nameop): Likewise.
	(exp_get_vma): Likewise.
	(exp_get_fill): Likewise.
	(exp_get_abs_int): Likewise.
	(fold_name): Likewise. Set SEC_KEEP in output section flags.
	(exp_mark_used_section): New.

	* ldexp.h (exp_mark_used_section): New.

	* ldlang.c (lang_output_section_statement_lookup_1): Set the
	ignored field to FALSE.
	(lang_mark_used_section_1): New.
	(lang_mark_used_section): Call lang_mark_used_section_1.
	(strip_excluded_output_sections): Call lang_mark_used_section
	and check for unused sections.
	(lang_size_sections_1): Skip an output section if it should
	be ignored.
	(lang_do_assignments_1): Likewise.
	(lang_process): Don't call lang_mark_used_section here.

	* ldlang.h (lang_output_section_statement_type): Change
	all_input_readonly to bitfield. Add ignored.

ld/testsuite/

2005-05-17  H.J. Lu  <hongjiu.lu@intel.com>

	PR 797
	* empty-aligned.d: New file.
	* empty-aligned.exp: Likewise.
	* empty-aligned.s: Likewise.
	* empty-aligned.t: Likewise.
2005-05-17 16:43:02 +00:00
Nick Clifton 8e0ed13fa5 (bfd_section_from_shdr): Add sanity check when parsing dynamic sections. 2005-05-17 16:23:26 +00:00
Nick Clifton 10dbd1f36f ldlang.c (print_assignment): Do not rely upon a valid result having a section
associated with it.
elf32-arm.c (elf32_arm_final_link_relocate): Gracefully handle the situation
  where a symbols's section is not known but a section relative R_ARM_RELATIVE
  reloc has to be generated for the Symbian OS.
2005-05-17 14:39:18 +00:00
Alan Modra 7e8aeb9a48 * elf32-ppc.c (LIS_11. LIS_12): Define.
(LWZU_0_X_12, LWZ_0_X_12, LWZ_12_4_12, LWZ_12_X_12): Define.
	(ppc_elf_finish_dynamic_sections): Provide non-pic plt call stub
	for --data-plt when building non-pie executables.
2005-05-17 13:55:02 +00:00
Nick Clifton 641bd09305 (v850_elf_relocate_section): Move code to test for the presence of a symbol
table to just before the symbol table is actually used.
2005-05-17 10:22:40 +00:00
Alan Modra 4fae8b31ef daily update 2005-05-17 00:00:07 +00:00
H.J. Lu 83b6bd8654 2005-05-16 H.J. Lu <hongjiu.lu@intel.com>
PR 834
	* elfxx-ia64.c (elfNN_ia64_relax_br): New.
	(elfNN_ia64_relax_section): Use it.
2005-05-16 17:55:55 +00:00
Alan Modra 45cef0ad68 daily update 2005-05-16 00:00:07 +00:00
Alan Modra 13b9f10d91 daily update 2005-05-15 00:00:04 +00:00
Mark Kettenis 060848126d * elflink.c (bfd_elf_size_dynamic_sections): Use lbasename instead
of basename.
2005-05-14 13:49:42 +00:00
Alan Modra 1fe44d7986 include/elf/
* ppc.h (DT_PPC_GOT): Rename from DT_PPC_GLINK.
bfd/
	* elf32-ppc.c (ppc_elf_size_dynamic_sections): Set DT_PPC_GOT,
	not DT_PPC_GLINK.
	(ppc_elf_finish_dynamic_sections): Likewise.
binutils/
	* readelf.c (get_ppc_dynamic_type): Display DT_PPC_GOT, not
	DT_PPC_GLINK.
2005-05-14 05:07:20 +00:00
Fred Fish 2db3311b5a Fix obvious typo in comment.
2005-05-13  Fred Fish  <fnf@specifixinc.com>
	* libbfd-in.h: Fix a comment typo, 'neaderst' -> 'nearest'
	* libbfd.h: Rebuilt.
2005-05-14 01:31:32 +00:00
Bob Wilson 7db48a120a * elf32-xtensa.c (xtensa_get_property_section_name): Add missing
periods in linkonce_kind values.
2005-05-14 00:26:06 +00:00
Alan Modra 4cc18f0008 daily update 2005-05-14 00:00:05 +00:00
Alan Modra 603b6a754f daily update 2005-05-13 00:00:05 +00:00
H.J. Lu 8fe769244d 2005-05-12 H.J. Lu <hongjiu.lu@intel.com>
* elf32-i386.c (elf_i386_relocate_section): Allow R_386_GOTOFF
	against protected function when building executable.
2005-05-12 21:01:42 +00:00
Alan Modra 86b9da8823 * elf32-ppc.c (LWZU_0_X_11): Delete.
(B, LWZ_11_X_11, LWZ_11_X_30, MTCTR_11): Define.
	(ppc_elf_select_plt_layout): Set .got flags too.  Formatting.
	(ppc_elf_size_dynamic_sections): Allocate space for .glink branch
	table.
	(ppc_elf_finish_dynamic_symbol): Point .plt entries into the branch
	table.
	(ppc_elf_finish_dynamic_sections): Adjust DT_PPC_GLINK value.
	Generate .glink branch table and updated stubs.
2005-05-12 15:24:51 +00:00
Alan Modra 01db59d261 daily update 2005-05-12 00:00:05 +00:00
Alan Modra d7128ce4b1 * reloc.c (BFD_RELOC_HI16_PCREL): Define.
(BFD_RELOC_HI16_S_PCREL, BFD_RELOC_LO16_PCREL): Define.
	* elf32-ppc.c (GLINK_PLTRESOLVE, GLINK_ENTRY_SIZE): Define.
	(CROR_151515, CROR_313131): Delete.
	(ADDIS_11_11, ADDI_11_11, SUB_11_11_30, ADD_0_11_11, ADD_11_0_11,
	LWZ_0_4_30, MTCTR_0, LWZ_12_8_30, BCTR, ADDIS_11_30,
	LWZU_0_X_11): Define.
	(ppc_elf_howto_raw): Add R_PPC_REL16, R_PPC_REL16_LO, R_PPC_REL16_HI
	and R_PPC_REL16_HA entries.
	(ppc_elf_reloc_type_lookup): Convert new bfd reloc types.
	(ppc_elf_addr16_ha_reloc): Also handle R_PPC_REL16_HA.
	(struct ppc_elf_link_hash_table): Add glink, glink_pltresolve,
	new_plt, and old_plt.
	(ppc_elf_create_dynamic_sections): Create .glink section.
	(ppc_elf_check_relocs): Set new_plt and old_plt.
	(ppc_elf_select_plt_layout): New function.
	(ppc_elf_tls_setup): Set plt output section elf type and flags.
	(allocate_got): Handle differences between old and new got layout.
	(allocate_dynrelocs): Likewise for plt.
	(ppc_elf_size_dynamic_sections): Likewise.  Allocate memory for
	.glink.  Don't allocate memory for old bss .plt.  Emit DT_PPC_GLINK.
	(ppc_elf_relax_section): Rename ppc_info to htab.  Handle .glink
	destination of R_PPC_PLTREL24 relocs.
	(ppc_elf_relocate_section): Handle new relocs and changed destination
	of R_PPC_PLTREL24.
	(ppc_elf_finish_dynamic_symbol): Init new style plt and handle
	differences in layout.
	(ppc_elf_finish_dynamic_sections): Set DT_PPC_GLINK value.  Don't
	put a blrl in new got.  Write glink contents.
	* elf32-ppc.h (ppc_elf_select_plt_layout): Declare.
	* libbfd.h: Regenerate.
	* bfd-in2.h: Regenerate.
2005-05-11 14:09:43 +00:00
Andreas Schwab 4c9b0de65e * elf32-i386.c (elf_i386_finish_dynamic_sections): Fix signedness
warning.
2005-05-11 09:23:43 +00:00
H.J. Lu 3d2b39cfde 2005-05-10 H.J. Lu <hongjiu.lu@intel.com>
* elf.c (_bfd_elf_make_section_from_shdr): Only check debug
	section if SEC_ALLOC isn't set.
2005-05-11 02:15:46 +00:00
Alan Modra eb3c48e9b4 daily update 2005-05-11 00:00:05 +00:00
Kelley Cook 2ba49b590d 2005-05-09 Kelley Cook <kcook@gcc.gnu.org>
* configure.in: Replace AC_COMPILE_CHECK_SIZEOF with AC_CHECK_SIZEOF.
	* acinclude.m4: Don't sinclude accross.m4.
	* config.in, configure, Makefile.in, doc/Makefile.in: Regenerate.
2005-05-10 01:27:54 +00:00
Alan Modra 282c312b74 daily update 2005-05-10 00:00:04 +00:00
Daniel Jacobowitz dbdb27ec2d * Makefile.am: Use a temporary file to build chew.
* Makefile.in: Regenerated.
2005-05-09 21:13:56 +00:00
Alan Modra 433817ddde * elf64-ppc.c (struct ppc64_elf_obj_tdata): Add has_dotsym.
(ppc64_elf_add_symbol_hook): Set has_dotsym.
	(ppc64_elf_check_directives): Only process syms when has_dotsym.
	(func_desc_adjust): Hide fake function descriptors when function
	code entry is defined.
	(adjust_opd_syms): Adjust for deleted_section becoming union field.
2005-05-09 10:30:40 +00:00
Alan Modra 0560d0f70c * elfcode.h (elf_object_p): Add more sanity checks on elf header. 2005-05-09 03:35:38 +00:00
Alan Modra a2b9106717 daily update 2005-05-09 00:00:06 +00:00
Dave Korn 74cc7600e3 2005-05-08 Dave Korn <dave.korn@artimi.com>
* coff-tic80.c:  Undefine _CONST after system headers to prevent
	clash with tic80-specific definition in include/coff/tic80.h
2005-05-08 23:48:38 +00:00
H.J. Lu cfca085c35 2005-05-08 H.J. Lu <hongjiu.lu@intel.com>
PR 939
	* elflink.c (elf_link_output_extsym): Use output_bfd if
	h->root.u.def.section is bfd_abs_section_ptr when reporting
	error.
2005-05-08 13:43:48 +00:00
Alan Modra cd7feffd1a daily update 2005-05-08 00:00:08 +00:00
H.J. Lu 7f4d39589c 2005-05-07 H.J. Lu <hongjiu.lu@intel.com>
* elf-bfd.h (elf_backend_data): Update special_sections to
	array of pointer to bfd_elf_special_section.
	* elf.c (special_sections): Likewise.
	* elf32-arm.c (elf32_arm_symbian_special_sections): Likewise.
	* elf32-m32r.c (m32r_elf_special_sections): Likewise.
	* elf32-m68hc11.c (elf32_m68hc11_special_sections): Likewise.
	* elf32-m68hc12.c (elf32_m68hc12_special_sections): Likewise.
	* elf32-mcore.c (mcore_elf_special_sections): Likewise.
	* elf32-ppc.c (ppc_elf_special_sections): Likewise.
	* elf32-sh64.c (sh64_elf_special_sections): Likewise.
	* elf32-v850.c (v850_elf_special_sections): Likewise.
	* elf32-xtensa.c (elf_xtensa_special_sections): Likewise.
	* elf64-alpha.c (elf64_alpha_special_sections): Likewise.
	* elf64-hppa.c (elf64_hppa_special_sections): Likewise.
	* elf64-ppc.c (ppc64_elf_special_sections): Likewise.
	* elf64-sh64.c (sh64_elf64_special_sections): Likewise.
	* elfxx-ia64.c (elfNN_ia64_special_sections): Likewise.
	* elfxx-mips.c (_bfd_mips_elf_special_sections): Likewise.
	* elfxx-mips.h (_bfd_mips_elf_special_sections): Likewise.

	* elf.c (get_special_section): Updated.
2005-05-07 13:22:57 +00:00
Nick Clifton 11d02c4143 Move doc/ entries into doc/ChangeLog.
Remove duplicated ChangeLog entry.
2005-05-07 07:07:04 +00:00
Alan Modra 3b36f7e629 bfd/
* elf-bfd.h (struct elf_backend_data): Remove got_symbol_offset.
	* elfxx-target.h (elf_backend_got_symbol_offset): Delete.
	* elflink.c (_bfd_elf_create_got_section): Use zero in place of
	got_symbol_offset.
	* elf-m10300.c (_bfd_mn10300_elf_create_got_section): Likewise.
	* elf32-frv.c (_frv_create_got_section): Likewise.
	* elf32-i370.c (i370_elf_finish_dynamic_sections): Delete ppc code.
	(elf_backend_got_symbol_offset): Don't define.
	* elf64-ppc.c (elf_backend_got_symbol_offset): Don't define.
	* elf32-ppc.c (struct ppc_elf_link_hash_table): Add got_header_size
	and got_gap.
	(ppc_elf_create_got): Tidy.
	(ppc_elf_create_dynamic_sections): Don't set SEC_IN_MEMORY for .plt.
	(ppc_elf_check_relocs): Reduce string comparisons by using elf.hgot.
	(ppc_elf_gc_sweep_hook): Likewise.
	(ppc_elf_relocate_section): Likewise.
	(ppc_elf_finish_dynamic_symbol): Likewise.
	(allocate_got): New function.
	(allocate_dynrelocs): Use allocate_got.
	(ppc_elf_size_dynamic_sections): Likewise.  Delay tlsld_got allocation
	so that local got can refcount it.  Set got_header_size.
	(ppc_elf_relocate_section): Use value of elf.hgot rather than hard-
	coded 4.
	(ppc_elf_finish_dynamic_sections): Likewise.
	(elf_backend_got_symbol_offset): Don't define.
	(elf_backend_got_header_size): Ditto.
ld/testsuite/
	* ld-powerpc/tlsexe32.d: Update for changed got layout.
	* ld-powerpc/tlsexe32.g: Likewise.
	* ld-powerpc/tlsexe32.r: Likewise.
	* ld-powerpc/tlsso32.d: Likewise.
	* ld-powerpc/tlsso32.g: Likewise.
	* ld-powerpc/tlsso32.r: Likewise.
2005-05-07 02:55:55 +00:00
Alan Modra e2cb2765eb daily update 2005-05-07 00:00:07 +00:00
Daniel Jacobowitz aa7eb06d97 Correct changelog snafu. 2005-05-06 18:23:14 +00:00
Alan Modra 3eb5c50ae9 daily update 2005-05-06 00:00:06 +00:00
Jim Wilson 2e0fbf7795 Fix ia64-hpux build failure, patch from Steve Ellcey.
* configure.in (ACX_HEADER_STRING): New.
* configure: Regenerate.
* config.in: Regenerate.
* sysdep.h (STRING_WITH_STRINGS): Use.
2005-05-05 18:51:14 +00:00
H.J. Lu 6f140a15a3 2005-05-05 H.J. Lu <hongjiu.lu@intel.com>
* elf.c (_bfd_elf_close_and_cleanup): Only call
	_bfd_dwarf2_cleanup_debug_info on bfd_object.
2005-05-05 17:22:40 +00:00
H.J. Lu 01d9ad14d4 bfd/
2005-05-05  H.J. Lu  <hongjiu.lu@intel.com>

	* elflink.c (_bfd_elf_provide_section_bound_symbols): Use
	"__bss_start" instead of "_edata" as fallback.

ld/

2005-05-05  H.J. Lu  <hongjiu.lu@intel.com>

	* scripttempl/elf.sc: Document the usage of __bss_start.
2005-05-05 16:40:11 +00:00
H.J. Lu 1ec472446e 2005-05-05 H.J. Lu <hongjiu.lu@intel.com>
* Makefile.am (INCLUDES): Remove -D_GNU_SOURCE.
	* Makefile.in: Regenerate.
2005-05-05 15:36:03 +00:00
H.J. Lu b36b76cb10 2005-05-05 H.J. Lu <hongjiu.lu@intel.com>
* bfd-in2.h: Regenerated.
2005-05-05 15:19:44 +00:00
Paul Brook eac338cfd5 2005-05-05 Paul Brook <paul@codesourcery.com>
bfd/
	* config.bfd: Use bfd_elf32_i386_vxworks_vec for i?86-*-vxworks.
	* configure.in: Add bfd_elf32_i386_vxworks_vec. i386 targets need
	elf-vxworks.lo.
	* configure: Regenerate.
	* Makefile.am (BFD32_BACKENDS): Add elf-vxworks.lo.
	(BFD32_BACKENDS_CFILES): Add elf-vxworks.c.
	(elf32-i386.lo): Depend on elf-vxworks.h.
	(elf-vxworks.lo): New rule.
	* Makefile.in: Regenerate.
	* elf-bfd.h (elf_backend_data): Update type of
	elf_backend_emit_relocs.
	(_bfd_elf_link_output_relocs): Update prototype.
	* elflink.c (_bfd_elf_link_output_relocs): Always use
	bed->elf_backend_emit_relocs when outputting relocations.
	* elfxx-target.h (elf_backend_emit_relocs): Default to
	_bfd_elf_link_output_relocs.
	* targets.c (bfd_elf32_i386_vxworks_vec): Declare.
	(_bfd_target_vector): Add bfd_elf32_i386_vxworks_vec.
	* elf32-i386.c: Add elf32-i386-vxworks target BFD.
	(elf_i386_plt0_entry): Remove padding.
	(elf_i386_pic_plt0_entry): Ditto.
	(PLTRESOLVE_RELOCS_SHLIB, PLTRESOLVE_RELOCS): Define.
	(PLT_NON_JUMP_SLOT_RELOCS): Define.
	(elf_i386_link_hash_table): Add srelplt2, hgot, hplt, is_vxworks and
	plt0_pad_byte fields.
	(elf_i386_link_hash_table_create): Zero them.
	(elf_i386_create_dynamic_sections): Create static relocation section.
	(allocate_dynrelocs): Allocate space for static PLT relocations.
	(elf_i386_size_dynamic_sections): Save shortcuts to PLT and GOT
	symbols.  Give PLT symbols function type.  Don't strip PLT sections
	if we have exported symbols from them.
	(elf_i386_finish_dynamic_symbol): Fill in VxWorks PLT static
	relocation section.  Don't mark _GLOBAL_OFFSET_TABLE_ as absolute on
	VxWorks.
	(elf_i386_finish_dynamic_sections): Allow different pad bytes.
	Add relocation for GOT location.  Fill in PLT static relocations.
	(elf_i386_vxworks_link_hash_table_create): New function.
	(elf_i386_vxworks_link_output_symbol_hook): New function.
	* elf-vxworks.h: New file.
gas/
	* config/tc-i386.h (ELF_TARGET_FORMAT): Define for TE_VXWORKS.
gas/testsuite/
	* gas/i386/i386.exp: Don't run divide test on vxworks.
ld/
	* Makefile.am: Add eelf_i386_vxworks.
	* Makefile.in: Regenerate.
	* configure.tgt: Make i?86-*-vxworks use targ_emul=elf_i386_vxworks.
	* emulparams/elf_i386_vxworks.sh: New file.
	* emulparams/vxworks.sh: New file.
	* scripttempl/elf.sc: Add DATA_END_SYMBOLS and ETEXT_NAME.
2005-05-05 14:37:27 +00:00
H.J. Lu 3496cb2af4 2005-05-05 H.J. Lu <hongjiu.lu@intel.com>
* section.c (bfd_make_section_anyway_with_flags): New.
	(bfd_make_section_anyway): Call bfd_make_section_anyway_with_flags,
	(bfd_make_section_with_flags): New.
	(bfd_make_section): Call bfd_make_section_with_flags.

	* elf-m10300.c (_bfd_mn10300_elf_create_got_section): Call
	bfd_make_section_with_flags/bfd_make_section_anyway_with_flags
	instead of bfd_make_section/bfd_make_section and don't call
	bfd_set_section_flags.
	(mn10300_elf_check_relocs): Likewise.
	(_bfd_mn10300_elf_create_dynamic_sections): Likewise.
	* elf32-arm.c (create_got_section): Likewise.
	(bfd_elf32_arm_add_glue_sections_to_bfd): Likewise.
	(elf32_arm_check_relocs): Likewise.
	* elf32-cris.c (cris_elf_check_relocs): Likewise.
	* elf32-frv.c (elf32_frv_add_symbol_hook): Likewise.
	(_frv_create_got_section): Likewise.
	(elf32_frvfdpic_create_dynamic_sections): Likewise.
	* elf32-hppa.c (elf32_hppa_create_dynamic_sections): Likewise.
	(elf32_hppa_check_relocs): Likewise.
	* elf32-i370.c (i370_elf_create_dynamic_sections): Likewise.
	(i370_elf_check_relocs): Likewise.
	* elf32-i386.c (create_got_section): Likewise.
	(elf_i386_check_relocs): Likewise.
	* elf32-m32r.c (m32r_elf_add_symbol_hook): Likewise.
	(create_got_section): Likewise.
	(m32r_elf_create_dynamic_sections): Likewise.
	(m32r_elf_check_relocs): Likewise.
	* elf32-m68k.c (elf_m68k_check_relocs): Likewise.
	* elf32-ppc.c (ppc_elf_create_got): Likewise.
	(ppc_elf_create_dynamic_sections): Likewise.
	(ppc_elf_add_symbol_hook): Likewise.
	(ppc_elf_check_relocs): Likewise.
	* elf32-s390.c (create_got_section): Likewise.
	(elf_s390_check_relocs): Likewise.
	* elf32-sh.c (create_got_section): Likewise.
	(sh_elf_create_dynamic_sections): Likewise.
	(sh_elf_check_relocs): Likewise.
	* elf32-vax.c (elf_vax_check_relocs): Likewise.
	* elf32-xstormy16.c (xstormy16_elf_check_relocs): Likewise.
	* elf32-xtensa.c (elf_xtensa_create_dynamic_sections): Likewise.
	(add_extra_plt_sections): Likewise.
	* elf64-alpha.c (elf64_alpha_add_symbol_hook): Likewise.
	(elf64_alpha_create_got_section): Likewise.
	(elf64_alpha_create_dynamic_sections): Likewise.
	(elf64_alpha_check_relocs): Likewise.
	* elf64-hppa.c (get_reloc_section): Likewise.
	(get_opd): Likewise.
	(get_plt): Likewise.
	(get_dlt): Likewise.
	(get_stub): Likewise.
	(elf64_hppa_create_dynamic_sectionso): Likewise.
	* elf64-mmix.c (mmix_elf_check_common_relocs): Likewise.
	* elf64-ppc.c (create_linkage_sections): Likewise.
	(ppc64_elf_check_relocs): Likewise.
	* elf64-s390.c (create_got_section): Likewise.
	(elf_s390_check_relocs): Likewise.
	* elf64-sh64.c (sh_elf64_check_relocs): Likewise.
	(sh64_elf64_create_dynamic_sections): Likewise.
	* elf64-x86-64.c (create_got_section): Likewise.
	(elf64_x86_64_check_relocs): Likewise.
	* elflink.c (_bfd_elf_create_got_section): Likewise.
	(_bfd_elf_link_create_dynamic_sections): Likewise.
	(elf_link_add_object_symbols): Likewise.
	* elfxx-ia64.c (elfNN_ia64_add_symbol_hook): Likewise.
	(elfNN_ia64_create_dynamic_sections): Likewise.
	(get_fptr): Likewise.
	(get_pltoff): Likewise.
	(get_reloc_section): Likewise.
	(elfNN_ia64_object_p): Likewise.
	* elfxx-mips.c (mips_elf_rel_dyn_section): Likewise.
	(mips_elf_create_compact_rel_section): Likewise.
	(mips_elf_create_got_section): Likewise.
	(_bfd_mips_elf_create_dynamic_sections): Likewise.
	* elfxx-sparc.c (create_got_section): Likewise.
	(_bfd_sparc_elf_check_relocs): Likewise.

	* elf.c (_bfd_elf_new_section_hook): Call _bfd_elf_get_sec_type_attr
	on linker created sections.
2005-05-05 14:34:04 +00:00
H.J. Lu 59fef9e758 2005-05-05 H.J. Lu <hongjiu.lu@intel.com>
PR 882
	* elflink.c (_bfd_elf_link_assign_sym_version): Allow version
	script on executable.
2005-05-05 14:30:04 +00:00
Nick Clifton 35330cce1a * dwarf2.c (read_abbrevs): If bfd_realloc fails, free currently allocated memory
before returning.
  (decode_line_info): Likewise.
  (_bfd_dwarf2_cleanup_debug_info): New function:  Frees memory	allocated by
  functions in this file.
* elf-bfd.h (_bfd_dwarf2_cleanup_debug_info): Prototype.
* elf.c (bfd_elf_close_and_cleanup): Call _bfd_dwarf2_cleanup_debug_info.
2005-05-05 14:25:23 +00:00
Hans-Peter Nilsson 4a2a268674 * Makefile.am (INCLUDES): Don't -D_GNU_SOURCE here.
* configure.in: Call AC_GNU_SOURCE here, after AC_PROG_CC.
	* configure, config.in, Makefile.in: Regenerate.
	* sysdep.h (stpcpy): Revert last change.
2005-05-05 03:42:02 +00:00
Alan Modra 76856a408b daily update 2005-05-05 00:46:49 +00:00
Hans-Peter Nilsson 0baace3504 * sysdep.h (stpcpy): Wrap declaration in parentheses. 2005-05-04 23:25:47 +00:00
H.J. Lu 5a260b6644 2005-05-04 H.J. Lu <hongjiu.lu@intel.com>
* elfxx-ia64.c (ARCH_SIZE): New.
	(LOG_SECTION_ALIGN): Likewise.
	(elfNN_ia64_create_dynamic_sections): Use LOG_SECTION_ALIGN to
	align relocation sections.
	(get_fptr): Likewise.
	(get_reloc_section): Likewise.
	(elfNN_ia64_tprel_base): Likewise.
	(elfNN_ia64_check_relocs): Support 32bit relocations.
	(allocate_global_fptr_got): Likewise.
	(allocate_dynrel_entries): Likewise.
	(set_got_entry): Likewise.
	(set_pltoff_entry): Likewise.
	(elfNN_ia64_relocate_section): Likewise.
2005-05-04 22:20:25 +00:00
H.J. Lu be5cacdb6d 2005-05-04 H.J. Lu <hongjiu.lu@intel.com>
* configure.in: Add AC_CHECK_DECLS(stpcpy).
	* configure: Regenerated.
	* config.in: Likewise.

	* sysdep.h (stpcpy): New.
2005-05-04 22:15:30 +00:00
Nick Clifton 3e11053365 Update the address and phone number of the FSF organization in the GPL notices 2005-05-04 15:53:43 +00:00
H.J. Lu f652615e8c bfd/
2005-05-04  H.J. Lu  <hongjiu.lu@intel.com>

	* bfd-in.h (_bfd_elf_provide_section_bound_symbols): New.
	* bfd-in2.h: Regenerated.

	* elflink.c (bfd_elf_set_symbol): New.
	(_bfd_elf_provide_symbol): Call it.
	(_bfd_elf_provide_section_bound_symbols): New.

ld/

2005-05-04  H.J. Lu  <hongjiu.lu@intel.com>

	* emultempl/elf32.em (gld${EMULATION_NAME}_provide_bound_symbols):
	Call _bfd_elf_provide_section_bound_symbols.
2005-05-04 13:19:02 +00:00
H.J. Lu c5e2ceadb7 2005-05-04 H.J. Lu <hongjiu.lu@intel.com>
* elflink.c (_bfd_elf_merge_symbol): Only skip weak definitions
	at the end, if a strong definition has already been seen.
2005-05-04 13:13:22 +00:00
Alan Modra 8423293d34 bfd/
* section.c (struct bfd_section): Replace link_order_head and
	link_order_tail with map_head and map_tail union.
	(STD_SECTION): Update.
	(_bfd_strip_section_from_output): Delete.
	* aoutx.h: Update throughout for above changes.
	* coff-ppc.c: Likewise.
	* cofflink.c: Likewise.
	* ecoff.c: Likewise.
	* elf-eh-frame.c: Likewise.
	* elf-m10300.c: Likewise.
	* elf.c: Likewise.
	* elf32-arm.c: Likewise.
	* elf32-cris.c: Likewise.
	* elf32-hppa.c: Likewise.
	* elf32-i386.c: Likewise.
	* elf32-m32r.c: Likewise.
	* elf32-m68hc1x.c: Likewise.
	* elf32-m68k.c: Likewise.
	* elf32-ppc.c: Likewise.
	* elf32-s390.c: Likewise.
	* elf32-sh.c: Likewise.
	* elf32-vax.c: Likewise.
	* elf32-xtensa.c: Likewise.
	* elf64-alpha.c: Likewise.
	* elf64-hppa.c: Likewise.
	* elf64-ppc.c: Likewise.
	* elf64-s390.c: Likewise.
	* elf64-sh64.c: Likewise.
	* elf64-x86-64.c: Likewise.
	* elflink.c: Likewise.
	* elfxx-ia64.c: Likewise.
	* elfxx-mips.c: Likewise.
	* elfxx-sparc.c: Likewise.
	* linker.c: Likewise.
	* merge.c: Likewise.
	* pdp11.c: Likewise.
	* xcofflink.c: Likewise.
	* elflink.c (bfd_boolean bfd_elf_size_dynsym_hash_dynstr): Split
	out from bfd_elf_size_dynamic_sections.
	* bfd-in.h (bfd_boolean bfd_elf_size_dynsym_hash_dynstr): Declare.
	* bfd-in2.h: Regenerate.
ld/
	* ldemul.c: Include bfdlink.h.
	(ldemul_before_allocation): Assume before_allocation is non-zero.
	(before_allocation_default): Call strip_excluded_output_sections.
	* ldlang.c (stripped_excluded_sections): New variable.
	(lang_add_section): Build input section list for each output
	section, attached via map_head and map_tail pointers.
	(strip_excluded_output_sections): Make global.  Traverse the
	input section lists to find which output sections can go.  Clear
	link_order pointers and set stripped_excluded_sections.
	(lang_process): Call strip_excluded_output_sections.
	* ldlang.h (strip_excluded_output_sections): Declare.
	* ldwrite.c: Update throuhout for link_order_head -> map_head change.
	* emultempl/aix.em (before_allocation): Call
	strip_excluded_output_sections.
	* emultempl/armcoff.em (before_allocation): Likewise.
	* emultempl/beos.em (before_allocation): Likewise.
	* emultempl/linux.em (before_allocation): Likewise.
	* emultempl/pe.em (before_allocation): Likewise.
	* emultempl/sunos.em (before_allocation): Likewise.
	* emultempl/elf32.em (before_allocation): Likewise.  Call
	bfd_elf_size_dynsym_hash_dynstr too.
	* emultempl/lnk960.em (lnk960_before_allocation): Delete.
	(ld_lnk960): Use before_allocation_default.
2005-05-04 11:00:28 +00:00
Nick Clifton 53e09e0aaf Update the FSF address in the copyright/GPL notice 2005-05-04 07:19:45 +00:00
Alan Modra ba53456e12 daily update 2005-05-04 00:00:06 +00:00
Alan Modra 04dd166740 * section.c (bfd_section_list_remove): Don't clear s->next.
(bfd_section_list_append): Always init s->prev.
	(bfd_section_list_prepend): Define.
	(bfd_section_list_insert_after): Minor optimization.
	(bfd_section_removed_from_list): Rewrite.
	* elf.c (assign_section_numbers): Simplify list traversal now that
	bfd_section_list_remove doesn't destroy removed section next ptr.
	* sunos.c (sunos_add_dynamic_symbols): Likewise.
	* elfxx-ia64.c (elfNN_ia64_object_p): Use bfd_section_list_prepend.
	* xcofflink.c (_bfd_xcoff_bfd_final_link): Simplify list traversal.
	* bfd-in2.h: Regenerate.
2005-05-03 17:05:51 +00:00
H.J. Lu e02b83d7f4 Regenerated. 2005-05-03 01:09:45 +00:00
H.J. Lu 5daa8fe797 bfd/
2005-05-02  H.J. Lu  <hongjiu.lu@intel.com>

	* bfd.c (bfd): Remove section_tail and add section_last.
	(bfd_preserve): Likewise.
	(bfd_preserve_save): Likewise.
	(bfd_preserve_restore): Likewise.
	* opncls.c (_bfd_new_bfd): Likewise.

	* coffcode.h (coff_compute_section_file_positions): Updated.
	(coff_compute_section_file_positions): Likewise.
	* elf.c (assign_section_numbers): Likewise.
	* elf32-i370.c (i370_elf_size_dynamic_sections): Likewise.
	* elf64-mmix.c (mmix_elf_final_link): Likewise.
	* elfxx-ia64.c (elfNN_ia64_object_p): Likewise.
	* elfxx-mips.c (_bfd_mips_elf_link_hash_table_create): Likewise.
	* sunos.c (sunos_add_dynamic_symbols): Likewise.
	* xcofflink.c (_bfd_xcoff_bfd_final_link): Likewise.

	* ecoff.c (bfd_debug_section): Initialize prev.

	* section.c (bfd_section): Add prev.
	(bfd_section_list_remove): Updated.
	(bfd_section_list_append): New.
	(bfd_section_list_insert_after): New.
	(bfd_section_list_insert_before): New.
	(bfd_section_list_insert): Removed.
	(bfd_section_removed_from_list): Updated.
	(STD_SECTION): Initialize prev.
	(bfd_section_init): Updated.
	(bfd_section_list_clear): Updated.

	* bfd-in2.h: Regenerated.

gas/

2005-05-02  H.J. Lu  <hongjiu.lu@intel.com>

	* write.c (write_object_file): Use bfd_section_double_list_remove
	to remove sections.

ld/

2005-05-02  H.J. Lu  <hongjiu.lu@intel.com>

	* emultempl/elf32.em (gld${EMULATION_NAME}_strip_empty_section):
	Updated for bfd_section_list_remove change.
	* ldlang.c (lang_insert_orphan): Likewise.
	(strip_excluded_output_sections): Likewise.
	(sort_sections_by_lma): New.
	(lang_check_section_addresses): Sort the sections before
	checking addresses.
2005-05-03 01:05:03 +00:00
Alan Modra b7be4033a1 daily update 2005-05-03 00:00:05 +00:00
H.J. Lu a31501e943 2005-05-02 H.J. Lu <hongjiu.lu@intel.com>
* elf.c (_bfd_elf_new_section_hook): Don't call
	_bfd_elf_get_sec_type_attr on sections from input files.
2005-05-02 14:00:16 +00:00
H.J. Lu d05da6a8c2 2005-05-02 H.J. Lu <hongjiu.lu@intel.com>
* merge.c (sec_merge_init): Call bfd_hash_table_init_n with
	hash table size 16699 instead of bfd_hash_table_init.
2005-05-02 13:59:16 +00:00
Paul Brook a67b080b92 2005-05-01 Paul Brook <paul@codesourcery.com>
* elflink.c (_bfd_elf_merge_symbol): Skip weak definitions if a strong
	definition has already been seen.
2005-05-02 03:12:21 +00:00
Alan Modra f341cbc179 daily update 2005-05-02 00:00:05 +00:00
Paul Brook c6596c5ecb 2005-05-01 Paul Brook <paul@codesourcery.com>
* elf32-arm.c (bfd_elf32_arm_process_before_allocation): Treat
	R_ARM_PLT32 the same as R_ARM_PC24.
	(arm_add_to_rel): Ditto.
2005-05-01 23:57:21 +00:00
Alan Modra 2c13bff76d daily update 2005-05-01 00:00:06 +00:00
Alan Modra 7b51f1082c daily update 2005-04-30 00:00:07 +00:00
Daniel Jacobowitz 9a813b7a53 * config.bfd: Add h8300*-*-rtemscoff.
Switch h8300*-*-rtems* to elf.
2005-04-29 18:41:45 +00:00
Daniel Jacobowitz b8c449bfd0 bfd/
* doc/Makefile.am: Remove stamp rules.  Depend on chew.c
	instead of $(MKDOC).
	* aclocal.m4, Makefile.in, doc/Makefile.in: Regnerated.
gas/
	* doc/Makefile.am (gasver.texi): Depend on bfd/configure instead
	of Makefile.
	(DISTCLEANFILES): Remove.
	(MAINTAINERCLEANFILES): Add asconfig.texi.
	* doc/Makefile.in: Regenerated.
2005-04-29 14:03:55 +00:00
Alan Modra c7f05afbc5 daily update 2005-04-29 00:00:06 +00:00
Paul Brook fa0d1caba9 2005-04-28 Paul Brook <paul@codesourcery.com>
Merge changes only applied to Makefile.in.
	* Makefile.am (BFD32_BACKENDS): Add elfxx-sparc.lo
	(BFD32_BACKENDS_CFILES): Add elfxx-sparc.c
	(elfxx-sparc.lo): New rule.
	(elf32-sparc.lo): Add elfxx-sparc.h dependency.
	(elf64-sparc.lo): Likewise.
2005-04-28 23:02:05 +00:00
Nick Clifton 0291d2913e Applied this patch for Julian Brown <julian@codesourcery.com>
* elflink.c (_bfd_elf_provide_symbol): Provide symbol for weak import.
2005-04-28 10:31:24 +00:00
H.J. Lu 0002be373a Set BFD_VERSION_DATE to 20050428. 2005-04-28 02:42:22 +00:00
H.J. Lu 26c61ae50b 2005-04-27 H.J. Lu <hongjiu.lu@intel.com>
* elf-bfd.h (bfd_elf_sym_name): Also take "asection *".

	* elf.c (bfd_elf_sym_name): Updated.
	(group_signature): Likewise.
	* elf32-ppc.c (ppc_elf_relocate_section): Likewise.
	* elf64-ppc.c (ppc64_elf_edit_opd): Likewise.
	(ppc64_elf_edit_toc): Likewise.
	(ppc64_elf_relocate_section): Likewise.
	* elfcode.h (elf_slurp_symbol_table): Likewise.
	* elflink.c (elf_link_input_bfd): Likewise.

	* elfxx-ia64.c (elfNN_ia64_relocate_section): Call
	bfd_elf_sym_name to get local symbol name when reporting errors.
2005-04-27 20:16:08 +00:00
Nick Clifton dce669a1fd Remove spurious spaces added by previous delta 2005-04-27 16:46:23 +00:00
H.J. Lu 6fe7699b81 Set BFD_VERSION_DATE to 20050427. 2005-04-27 14:23:48 +00:00
Nick Clifton 8c19749adc (elf_link_input_bfd): Handle the case where a badly formatted input file results
in a reloc which has no associated global symbol
2005-04-27 10:09:43 +00:00
H.J. Lu 6156ef10ad Update BFD_VERSION_DATE to 20050426. 2005-04-26 16:08:31 +00:00
Jerome Guitton 8e5b6e16ee * bfd.m4 (BFD_NEED_DECLARATION): Restore. 2005-04-26 09:43:17 +00:00
David S. Miller e459dc7b30 * elfxx-sparc.c (sparc_elf_append_rela_64): Add BFD64 protection.
(sparc_elf_r_info_64, _bfd_sparc_elf_finish_dynamic_symbol,
	sparc64_finish_dyn, _bfd_sparc_elf_finish_dynamic_sections):
	Likewise.
2005-04-25 21:53:38 +00:00
H.J. Lu 6d633fd282 bfd/
2005-04-25  H.J. Lu  <hongjiu.lu@intel.com>

	PR 858
	* elflink.c (elf_link_input_bfd): Make non-debugging reference
	to discarded section an error.

ld/testsuite/

2005-04-25  H.J. Lu  <hongjiu.lu@intel.com>

	* ld-discard/extern.d: Expect error.
	* ld-discard/start.d: Likewise.
	* ld-discard/static.d: Likewise.
2005-04-25 14:59:09 +00:00
Jerome Guitton d34a2b1dc9 * configure.in: Replace BFD_NEED_DECLARATION checks by the
corresponding AC_CHECK_DECLS.
	* sysdep.h: Replace NEED_DECLARATION_* checks by the corresponding
	HAVE_DECL_*.
	* bfd.m4 (BFD_NEED_DECLARATION): Remove, obsolete.
	* configure: Regenerate.
	* config.in: Ditto.
2005-04-22 13:58:14 +00:00
H.J. Lu 34f3e815d1 2005-04-21 H.J. Lu <hongjiu.lu@intel.com>
* Makefile.am (INCLUDES): New. Add -D_GNU_SOURCE.
	(chew.o): Use it.
	* Makefile.in: Regenerate.
2005-04-22 05:21:49 +00:00
Alan Modra 533edbe2ca daily update 2005-04-22 00:00:05 +00:00
Andreas Schwab c2e70a82ce * elfxx-sparc.h (struct _bfd_sparc_elf_link_hash_table): Remove
unsigned from type of dynamic_interpreter.
	* elfxx-sparc.c (_bfd_sparc_elf_link_hash_table_create): Remove
	casts again.
2005-04-21 12:19:55 +00:00
Andreas Schwab ff01938b1a * elf.c (assign_section_numbers): Fix comment. 2005-04-21 12:13:37 +00:00
Jerome Guitton 0858d3ec47 * som.c (som_bfd_print_private_bfd_data): Add explicit cast to long
for struct som_exec_auxhdr fields.
2005-04-21 10:47:49 +00:00
Nick Clifton 7920ce38c3 Update to ISO-C90 and fix formatting 2005-04-21 07:45:39 +00:00
Alan Modra 20b26460df daily update 2005-04-21 00:00:07 +00:00
David S. Miller e8be8da4fb * elfxx-sparc.c (sparc_elf_r_symndx_64): Fix compiler warning.
(_bfd_sparc_elf_link_hash_table_create): Likewise.
	(allocate_dynrelocs): Likewise.
2005-04-20 18:39:26 +00:00
Jerome Guitton ec7b76fec3 * configure.in: Fix the check for basename declaration. Add check
for declarations of ftello, ftello64, fseeko, fseeko64.
	* configure: Regenerate.
	* config.in: Ditto.
	* sysdep.h: If needed, declare ftello, ftello64, fseeko, fseeko64.
2005-04-20 15:00:15 +00:00
Alan Modra 06897b50b3 daily update 2005-04-20 00:00:06 +00:00
David S. Miller 22b75d0ae6 * elfxx-sparc.c: New file.
* elfxx-sparc.h: New file.
	* Makefile.in (BFD32_BACKENDS): Add elfxx-sparc.lo
	(BFD32_BACKENDS_CFILES): Add elfxx-sparc.c
	(elfxx-sparc.lo): New rule.
	(elf32-sparc.lo): Add elfxx-sparc.h dependency.
	(elf64-sparc.lo): Likewise.
	* configure.in (bfd_elf32_sparc_vec): Add elfxx-sparc.lo
	(bfd_elf64_sparc_vec): Likewise.
	* configure: Regenerate.
	* elf32-sparc.c: Remove common code now in elfxx-sparc.c
	* elf64-sparc.c: Likewise, also use elf64_sparc_*() naming
	which is more consistent with elf32-sparc.c
2005-04-19 21:26:30 +00:00
Daniel Jacobowitz a008ac0314 * elfxx-mips.c (struct mips_elf_link_hash_entry): Update comment.
(mips_elf_create_local_got_entry): Check h->root.forced_local.
2005-04-19 18:33:20 +00:00
Alan Modra c87b5a93b2 bfd/
* elf32-ppc.c (ppc_elf_check_relocs): Don't bother with
	dynamic relocs in non-SEC_ALLOC sections.
	(ppc_elf_gc_sweep_hook): Likewise.
	(ppc_elf_relax_section): Likewise.
	(ppc_elf_relocate_section): Likewise.
ld/testsuite/
	* ld-powerpc/reloc.d: Update to suit removal of non-alloc relocs.
2005-04-19 05:44:55 +00:00
Alan Modra d959e1a193 daily update 2005-04-19 00:00:06 +00:00
Nick Clifton 7cefacd397 (xcoff64_core_p): Fix compile time warning assigning a value to return_value. 2005-04-18 12:10:57 +00:00
H.J. Lu 278d8f3760 2005-04-17 H.J. Lu <hongjiu.lu@intel.com>
PR 855
	* elf.c (_bfd_elf_copy_private_section_data): Don't copy linker
	created group data.
2005-04-18 03:13:49 +00:00
H.J. Lu 20dbb49d3c 2005-04-17 H.J. Lu <hongjiu.lu@intel.com>
PR 855
	* elf.c (setup_group): Properly handle zero group count.
2005-04-18 03:12:51 +00:00
Alan Modra a3b8c86ce6 daily update 2005-04-18 00:00:04 +00:00
Mark Kettenis 6a808a40ca * som.c (hppa_som_reloc, som_mkobject, som_is_space)
(som_is_subspace, compare_subspaces, som_compute_checksum)
(som_build_and_write_symbol_table, som_slurp_symbol_table): New
protoypes.
(hppa_som_reloc, compare_syms, compare_subspaces)
(som_print_symbol, som_get_section_contents)
(som_set_section_contents): Remove space after 'void *'.
(som_bfd_print_private_bfd_data): Use %lx to print longs.
(som_bfd_merge_private_bfd_data)
(som_bfd_copy_private_header_data, som_bfd_set_private_flags): New
defines.
2005-04-17 12:45:30 +00:00
Alan Modra 62310a091f daily update 2005-04-17 00:00:05 +00:00
Alan Modra cae4cddaa3 daily update 2005-04-16 00:00:06 +00:00
Julian Brown 33bfe77466 * bfd/bfd-in.h (bfd_elf32_arm_set_target_relocs): Update prototype.
* bfd/bfd-in2.h: Regenerate.
	* bfd/elf32-arm.c (elf32_arm_link_hash_table): New field, 'use_blx'.
	(elf32_arm_link_hash_table_create): Initialise fix_v4bx, use_blx.
	(bfd_elf32_arm_set_target_relocs): Handle use_blx.
	(elf32_arm_final_link_relocate): Use Thumb BLX for R_ARM_THM_PC22
	relocations if requested to.
	(allocate_dynrelocs): Don't count size of omitted Thumb stubs based on
	use_blx rather than symbian_p.
	(elf32_arm_finish_dynamic_symbol): Don't output Thumb PLT stubs if
	use_blx is in effect.
	(elf32_arm_symbian_link_hash_table_create): Enable use_blx by default
	for SymbianOS.
	* ld/ld.texinfo: Document --use-blx.
	* ld/emultempl/armelf.em (use_blx): New variable.
	(arm_elf_create_output_section_statements): Communicate value of
	use_blx to bfd.
	(PARSE_AND_LIST_PROLOGUE): Add OPTION_USE_BLX.
	(PARSE_AND_LIST_OPTIONS): Add --use-blx option.
	(PARSE_AND_LIST_ARGS_CASES): Add OPTION_USE_BLX case.
2005-04-15 16:37:47 +00:00
Nick Clifton 745c12f87d Use fprintf_vma to print vma values. 2005-04-15 11:47:47 +00:00
Alan Modra 2e8b3a6111 PR ld/815
* elflink.c (elf_smash_syms): Clear undef.next if it's not being
	used as a list pointer.
2005-04-15 03:42:46 +00:00
Alan Modra 813ec89bc0 daily update 2005-04-15 00:00:05 +00:00
Alan Modra 9e9b66a956 bfd/
* Makefile.am (NO_WERROR): Define.
	* warning.m4: New file
	* acinclude.m4: Include warning.m4.
	* configure.in: Invoke AM_BINUTILS_WARNINGS.
	* Makefile.in: Regenerate.
	* configure: Regenerate.
bfd/doc/
	* Makefile.in: Regenerate.
binutils/
	* Makefile.am (NO_WERROR): Define.  Use instead of -Wno-error.
	* configure.in: Include ../bfd/warning.m4 contents.
	* Makefile.in: Regenerate.
	* configure: Regenerate.
	* doc/Makefile.in: Regenerate.
gas/
	* Makefile.am (NO_WERROR): Define.  Use instead of -Wno-error.
	* acinclude.m4: Include ../bfd/warning.m4.
	* configure.in: Invoke AM_BINUTILS_WARNINGS.
	* Makefile.in: Regenerate.
	* configure: Regenerate.
	* doc/Makefile.in: Regenerate.
gprof/
	* Makefile.am (NO_WERROR): Define.
	* acinclude.m4: Include ../bfd/warning.m4.
	* configure.in: Invoke AM_BINUTILS_WARNINGS.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
ld/
	* Makefile.am (NO_WERROR): Define.  Use instead of -Wno-error.
	* configure.in: Include ../bfd/warning.m4 contents.
	* Makefile.in: Regenerate.
	* configure: Regenerate.
opcodes/
	* Makefile.am (NO_WERROR): Define.
	* configure.in: Invoke AM_BINUTILS_WARNINGS.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
2005-04-14 05:26:44 +00:00
Alan Modra 92ceba1e4f * merge.c (sec_merge_emit): Tidy. Check for bfd_zmalloc errors.
Write trailing padding.
2005-04-14 02:27:56 +00:00
Alan Modra 8699aa54a2 * merge.c (merge_strings): Round up section size for alignment. 2005-04-14 00:27:20 +00:00
Alan Modra ee9d5ee534 daily update 2005-04-14 00:00:04 +00:00
Jakub Jelinek 40937810e1 2005-04-14 David S. Miller <davem@davemloft.net>
bfd/
	Add TLS support for 64-bit Sparc ELF.
	*  elf64-sparc.c (sparc64_elf_dyn_relocs,
	sparc64_elf_link_hash_entry, sparc64_elf_obj_tdata): New structs.
	(GOT_UNKNOWN, GOT_NORMAL, GOT_TLD_GD, GOT_TLD_IE,
	sparc64_elf_hash_entry, sparc64_elf_tdata,
	sparc64_elf_local_got_tls_type): New defines.
	(sparc64_elf_mkobject): New function.
	(sparc64_elf_link_hash_table): Add members for dynamic linker
	sections PLT, RELPLT, DYNBSS, and RELBSS.  Add tls_ldm_got
	uion to track TLS GOT references.  Add sym_sec to cache
	mappings from local sym to section.
	(link_hash_newfunc): New function.
	(sparc64_elf_bfd_link_hash_table_create): Rename to
	sparc64_elf_link_hash_table_create for consistency.
	Pass link_hash_newfunc to _bfd_elf_link_hash_table_init.
	(sparc64_elf_create_dynamic_sections): Initialize new section
	members of sparc64_elf_link_hash_table.  Only init srelbss
	if not-shared.
	(sparc64_elf_copy_indirect_symbol, sparc64_elf_tls_transition):
	New functions.
	(SPARC_NOP): Define.
	(sparc64_elf_build_plt, sparc64_elf_plt_entry_offset,
	sparc64_elf_plt_ptr_offset): Delete.
	(sparc64_plt_entry_build): New function to build PLT entries
	gradually instread of all at once at the end of linking.
	(sparc64_elf_check_relocs): Delete dynobj, sgot, and srelgot
	local vars.  Get them from sparc64_elf_hash_table instead.
	Check early on if r_symndx is in bounds.  Handle TLS transitions.
	Account for TLS GOT references and DF_STATIC_TLS, as needed.
	For TLS relocs, record the tls_type in either
	sparc64_elf_local_got_tls_type or sparc64_elf_hash_entry as
	appropriate.  For R_SPARC_TLS_{GD,LDM}_CALL, emit a reference
	to the __tls_get_addr symbol.  For PLT relocs, track references
	via h->plt.refcount.  When R_SPARC_{PC10,PC22,PC_HH22,PC_HM10,
	PC_LM22} and h not-NULL, set h->non_got_ref.  For global data
	symbol references, count the number of relocations needed for
	that symbol.  For default switch case, don't error, this lets
	the TLS relocs not explicitly handled by this function get
	accepted.
	(sparc64_elf_gc_mark_hook, sparc64_gc_sweep_hook): New functions.
	(sparc64_elf_adjust_dynamic_symbol): Remove dynobj local var, get
	it from sparc64_elf_hash_table.  Store the real PLT offset
	in h->plt.offset, and build PLT entries one at a time.  Also
	get .dynbss section pointer from htab.
	(allocate_dynrelocs, readonly_dynrelocs,
	sparc64_omit_section_dynsym): New functions.
	(sparc64_elf_omit_section_dynsym): Use these new functions as
	helpers.
	(dtpoff_base, tpoff): New functions.
	(sparc64_elf_relocate_section): Kill dynobj, sgot, and splt
	locals, get them from sparc64_elf_hash_table.  Handle TLS
	relocations and refcounting in main relocation loop.
	(sparc64_elf_finish_dynamic_symbol): Use
	sparc64_elf_link_hash_table.  Build PLT entries as we see
	them.  Handle TLS GOT relocations.
	(sparc64_elf_finish_dynamic_sections): Get sgot and dynobj
	from sparc64_elf_hash_table.  Initialize only PLT header
	not all entries since we not build PLT entries one by one.
	(elf_backend_copy_indirect_symbol, bfd_elf64_mkobject,
	elf_backend_gc_mark_hook, elf_backend_gc_sweep_hook,
	elf_backend_can_gc_sections, elf_backend_can_refcount): Define.
ld/testsuite/
	* ld-selective/sel-dump.exp: Do not exclude sparc64-*.
	* ld-selective/selective.exp: Likewise.
	* ld-sparc/sparc.exp: Add {32,64}-bit prefix to test
	names so we know which one is failing.  Run sparc64 TLS
	tests on multi-arch sparc platforms.
	* ld-sparc/tls64.sd, ld-sparc/tlssunbin64.dd,
	ld-sparc/tlssunbin64.rd, ld/testsuite/ld-sparc/tlssunbin64.sd,
	ld-sparc/tlssunbin64.td, ld-sparc/tlssunnopic64.dd,
	ld-sparc/tlssunnopic64.rd, ld-sparc/tlssunnopic64.sd,
	ld-sparc/tlssunpic64.dd, ld-sparc/tlssunpic64.rd,
	ld-sparc/tlssunpic64.sd, ld-sparc/tlssunpic64.td): Update now
	that sparc64 ELF does support TLS.
2005-04-13 22:29:36 +00:00
H.J. Lu e75a280b02 bfd/
2005-04-13  Daniel Jacobowitz  <dan@codesourcery.com>

	* elflink.c (elf_link_input_bfd): Update check for removed
	sections.

ld/testsuite/

2005-04-13  H.J. Lu  <hongjiu.lu@intel.com>

	* ld-elf/empty.d: New file.
	* ld-elf/empty.s: Likewise.
2005-04-13 16:44:08 +00:00
Alan Modra 85f347f77d daily update 2005-04-13 00:00:07 +00:00
Alan Modra ceae3e339f bfd/
* Makefile.am: Run "make dep-am".
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* libcoff.h: Regenerate.
bfd/doc/
	* Makefile.in: Regenerate.
binutils/
	* Makefile.am: Run "make dep-am".
	(syslex.o, sysinfo.o, arparse.o, arlex.o): Add -Wno-error to command.
	(sysroff.o, defparse.o, deflex.o): Likewise.
	(nlmheader.o, rcparse.o, rclex.o): Likewise.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* config.in: Regenerate.
	* configure: Regenerate.
gas/
	* Makefile.am: Run "make dep-am".
	* Makefile.in: Regenerate.
ld/
	* Makefile.am: Run "make dep-am".
	(ldgram.o, ldlex.o, deffilep.o): Add -Wno-error to command.
	* Makefile.in: Regenerate.
	* config.in: Regenerate.
2005-04-12 02:50:28 +00:00
Alan Modra 8e29614e7e daily update 2005-04-12 00:00:05 +00:00
H.J. Lu ab82c5b97f 2005-04-11 H.J. Lu <hongjiu.lu@intel.com>
* linker.c (_bfd_generic_link_output_symbols): Also check if
	the output section of an input section has been removed from
	the output file.

	* section.c (bfd_section_list_remove): Clear the next field
	of the removed section.
	(bfd_section_removed_from_list): New.
	* bfd-in2.h: Regenerated.
2005-04-11 22:21:23 +00:00
Jakub Jelinek bd695bcc90 2005-04-11 David S. Miller <davem@davemloft.net>
* elf32-sparc.c (elf32_sparc_relocate_section,
	R_SPARC_TLS_LDO_{HIX22,LOX10}): When not shared, transition to
	R_SPARC_TLS_LE_{HIX22,LOX10}.
	(elf32_sparc_relocate_section, R_SPARC_TLS_{LDO,LE}_HIX22): Only
	xor relocation with 0xffffffff if R_SPARC_TLS_LE_HIX22.
	(elf32_sparc_relocate_section, R_SPARC_TLS_{LDO,LE}_LOX10): Only
	or 0x1c00 into relocation if R_SPARC_TLS_LE_HIX22.

	* ld-sparc/tlssunbin32.dd: Update for TLS relocation fixes.
	* ld-sparc/tlssunbin32.rd: Likewise.
	* ld-sparc/tlssunbin32.sd: Likewise.
	* ld-sparc/tlssunpic32.dd: Likewise.
2005-04-11 22:13:28 +00:00
H.J. Lu b5b2699cd6 2005-04-11 H.J. Lu <hongjiu.lu@intel.com>
* coffcode.h (STRING_SIZE_SIZE): Updated to match libcoff-in.h.
2005-04-11 16:55:48 +00:00
Nick Clifton 116c20d240 Convert to ISO C90 formatting 2005-04-11 08:23:05 +00:00
Alan Modra c84d9728ba daily update 2005-04-11 00:00:10 +00:00
Alan Modra f65a6fe0b4 daily update 2005-04-10 00:00:04 +00:00
Alan Modra a5fb67e34a daily update 2005-04-09 00:00:09 +00:00
Paul Brook 8f6277f5c0 2005-04-08 Paul Brook <paul@codesourcery.com>
* elf32-arm.c (ARM2THUMB_GLUE_SIZE): Rename...
	(ARM2THUMB_STATIC_GLUE_SIZE): ... to this.
	(ARM2THUMB_PIC_GLUE_SIZE): Define.
	(a2t1p_ldr_insn, a2t2p_add_pc_insn, a2t3p_bx_r12_insn): Add.
	(elf32_arm_to_thumb_stub): Create PIC stubs.
	(record_arm_to_thumb_glue): Use different stub size for relocatable
	images.
2005-04-08 11:47:59 +00:00
Alan Modra f8569bd74f daily update 2005-04-08 00:00:06 +00:00
Alan Modra 23a64347c9 daily update 2005-04-07 00:00:06 +00:00
Alan Modra 7a481748b8 daily update 2005-04-06 00:00:08 +00:00
Alan Modra 8c1d1bb8a2 * elf64-ppc.c (dec_dynrel_count): New function split out from
ppc64_elf_edit_toc, with additional code from ppc64_elf_edit_opd.
	(ppc64_elf_edit_toc, ppc64_elf_edit_opd): Use it.
	(ppc64_elf_tls_optimize): Likewise.
2005-04-05 12:16:38 +00:00
Nick Clifton 8c1017202f Provide .wcookie section for OpenBSD/sparc64. 2005-04-05 08:01:18 +00:00
Nick Clifton 429cc0ae05 New translation: Kinyarwanda 2005-04-05 07:58:41 +00:00
Richard Sandiford cc2e31b90b * elfxx-mips.c (MIPS_ELF_OPTIONS_SECTION_NAME_P): New macro.
(_bfd_mips_elf_section_from_shdr): Use it to check for recognized
	SHT_MIPS_OPTIONS names.  Allow all sections with unrecognised
	section flags.
	(_bfd_mips_elf_fake_sections): Use MIPS_ELF_OPTIONS_SECTION_NAME_P
	to check for SHT_MIPS_OPTIONS sections.
	(_bfd_mips_elf_set_section_contents): Likewise.
2005-04-05 07:35:12 +00:00
Eric Christopher 8236346f46 2005-04-04 Eric Christopher <echristo@redhat.com>
* elfxx-mips.c (_bfd_elf_mips_get_relocated_section_contents):
	Clean up gp handling code.
2005-04-05 06:58:46 +00:00
H.J. Lu da9f89d4e2 bfd/
2005-04-04  H.J. Lu  <hongjiu.lu@intel.com>

	* elf.c (bfd_elf_set_group_contents): Ignore linker created
	group section.
	(assign_section_numbers): Accept link_info. Check SHT_GROUP
	sections for relocatable files only. Remove the linker created
	group sections.
	(_bfd_elf_compute_section_file_positions): Pass link_info to
	assign_section_numbers.

	* elfxx-ia64.c (elfNN_ia64_object_p): New.
	(elf_backend_object_p): Defined.

gas/

2005-04-04  H.J. Lu  <hongjiu.lu@intel.com>

	* config/tc-ia64.c (start_unwind_section): Undo the change
	of 2004-08-18.
	(generate_unwind_image, dot_endp): Likewise.
2005-04-05 04:01:12 +00:00
H.J. Lu 7e4111adb2 2005-04-04 H.J. Lu <hongjiu.lu@intel.com>
* elf.c (bfd_elf_set_group_contents): Ignore linker created
	group section.
2005-04-05 02:47:18 +00:00
Alan Modra 794406d6bf daily update 2005-04-05 00:00:05 +00:00
H.J. Lu 96982dc91f 2005-04-04 H.J. Lu <hongjiu.lu@intel.com>
* elf-bfd.h (elf_section_data): Use (sec) instead of sec.
2005-04-04 16:11:02 +00:00
Alan Modra ec74bb7502 daily update 2005-04-04 00:00:05 +00:00
Fred Fish a13afe8eb5 Apply patch for binutils bug 806, approved by nickc@redhat.com.
2005-04-03  Fred Fish  <fnf@specifixinc.com>
	* dwarf2.c (struct dwarf2_debug): Add dwarf_ranges_buffer and
	dwarf_ranges_size members.
	(struct comp_unit): Add base_address member.
	(struct funcinfo): Replace low/high members with an arange.
	(arange_add): Replace incoming "unit" parameter with "abfd" and
	"first_arange" pointers.  Reorganize/rewrite function body.
	(decode_line_info): Change arange_add call to pass bfd and arange
	pointers.
	(lookup_address_in_line_info_table): Use arange list instead of
	individual low/high members.  Walk function's arange list to find
	lowest PC in list, to test for overlapping functions.
	(read_debug_ranges): New function, reads the debug_ranges section.
	(lookup_address_in_function_table): Use arange list instead of
	individual low/high members.  Rewrite to find smallest range that
	matches.
	(read_rangelist): Read a given rangelist from debug_ranges.
	(scan_unit_for_functions): Use arange list instead of individual
	low/high members.  Handle a DW_AT_ranges attribute.
	(parse_comp_unit): Use arange list instead of individual low/high
	members.  Save comp unit base address.  Handle a DW_AT_ranges
	attribute.
2005-04-03 20:36:37 +00:00
Alan Modra 26dae57f14 daily update 2005-04-03 00:00:05 +00:00
Alan Modra 301e5c4a6a daily update 2005-04-02 00:00:09 +00:00
H.J. Lu 2796fd96ba 2005-04-01 H.J. Lu <hongjiu.lu@intel.com>
* elf.c (assign_section_numbers): Really use the kept section.
2005-04-01 20:52:24 +00:00
H.J. Lu 01b3c8abd1 2005-03-31 H.J. Lu <hongjiu.lu@intel.com>
* elf-bfd.h (_bfd_elf_check_kept_section): New.

	* elf.c (assign_section_numbers): When sh_link points to a
	discarded section, call _bfd_elf_check_kept_section to see if
	the kept section can be used. Otherwise reject sh_link
	pointing to discarded section.

	* elflink.c (_bfd_elf_check_kept_section): New.
	(elf_link_input_bfd): Use it.
2005-04-01 03:49:46 +00:00
Alan Modra 3509047186 * elf64-ppc.c (ppc64_elf_edit_toc): Account for dynamic relocs
that we no longer need.
2005-04-01 02:50:15 +00:00
Alan Modra 77623a344f (ppc64_elf_check_relocs): Remove unnecessary SEC_ALLOC check. 2005-04-01 02:40:35 +00:00
Alan Modra 7356fed57f * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Return -1 on errors
rather than 0.
2005-04-01 02:35:41 +00:00
H.J. Lu 28b1374403 2005-03-31 H.J. Lu <hongjiu.lu@intel.com>
* elf.c (assign_section_numbers): Fix a typo.
2005-04-01 00:30:49 +00:00
Alan Modra dca8d0afa1 daily update 2005-04-01 00:00:05 +00:00
H.J. Lu c93625e2d2 2005-03-31 H.J. Lu <hongjiu.lu@intel.com>
* elflink.c (elf_link_input_bfd): Remove the extra `\n' in
	error message.
	(_bfd_elf_section_already_linked): Likewise.
2005-03-31 23:45:30 +00:00
Jerome Guitton fddc4048e5 * bfd/config.in: Regenerate. 2005-03-31 16:09:03 +00:00
Jerome Guitton 2e9ebff5c7 * bfd/config.in (HAVE_DECL_BASENAME): New configure macro.
* bfd/configure.in: Check for basename.
	* bfd/configure: Regenerate.
2005-03-31 15:35:38 +00:00
Alan Modra 0f2d00bca8 daily update 2005-03-31 00:00:05 +00:00
Julian Brown 05ea83ed21 * bfd/bfd-in.h (bfd_is_arm_mapping_symbol_name): Rename from
bfd_elf32_is_arm_mapping_symbol_name.
	* bfd/bfd-in2.h: Regenerate.
	* bfd/cpu-arm.c (bfd_is_arm_mapping_symbol_name): Rename from
	bfd_elf32_is_arm_mapping_symbol_name.
	* bfd/elf32-arm.c (elf32_arm_is_target_special_symbol): Rename
	bfd_elf32_is_arm_mapping_symbol_name to bfd_is_arm_mapping_symbol_name.
	(arm_elf_find_function): Likewise.
	(elf32_arm_output_symbol_hook): Likewise.
	* gas/config/tc-arm.c (arm_adjust_symtab): Likewise.
2005-03-30 17:19:29 +00:00
Julian Brown 9d2da7ca8d * bfd/bfd-in.h (bfd_elf32_is_arm_mapping_symbol_name): Add prototype.
* bfd/bfd-in2.h: Regenerate.
	* bfd/elf32-arm.c (elf32_arm_is_target_special_symbol): Rename call to
	bfd_elf32_is_arm_mapping_symbol_name.
	(elf32_arm_output_symbol_hook): Likewise.
	(arm_elf_find_function): Likewise, and include STT_NOTYPE in test for
	mapping symbols.
	(is_arm_mapping_symbol_name): Function moved from here...
	* bfd/cpu-arm.c (bfd_elf32_is_arm_mapping_symbol_name): ...to here,
	renamed and made global.
	* gas/config/tc-arm.c (mapping_state): Change documentation in function
	comment to cross-reference spec instead. Change type of mapping symbols
	to BSF_NO_TYPE.
	(arm_adjust_symtab): Don't change type of mapping symbols here.
	* gas/testsuite/gas/arm/mapping.d: Update expected output.
	* ld/testsuite/ld-arm/arm-app-abs32.d: Likewise.
	* ld/testsuite/ld-arm/arm-app.d: Likewise.
	* ld/testsuite/ld-arm/mixed-app.d: Likewise.
2005-03-30 16:22:07 +00:00
Aaron W. LaFramboise efa9bda482 * configure.in: Check for ffs decl and alphabetize.
* config.in: Regenerate.
	* configure: Regenerate.
	* sysdep.h [NEED_DECLARATION_FFS] (ffs): Prototype and
	alphabetize.
2005-03-30 02:46:25 +00:00
Alan Modra 491c40da28 daily update 2005-03-30 00:00:05 +00:00
Fred Fish 09a9d560e1 Approved by nickc@redhat.com
2005-03-29  Fred Fish  <fnf@specifixinc.com>
	* dwarf2.c (struct comp_unit): Fix typo.
	(scan_unit_for_functions): Remove unused local variable "name"
	and dead code that set it.
2005-03-29 20:10:42 +00:00
Daniel Jacobowitz ba93b8aced bfd/
* bfd-in2.h, libbfd.h: Regenerated.
	* reloc.c: Add ARM TLS relocations.
	* elf32-arm.c (elf32_arm_howto_table): Add dynamic TLS
	relocations.
	(elf32_arm_tls_gd32_howto, elf32_arm_tls_ldo32_howto)
	(elf32_arm_tls_ldm32_howto, elf32_arm_tls_le32_howto)
	(elf32_arm_tls_ie32_howto): New.
	(elf32_arm_howto_from_type): Support TLS relocations.
	(elf32_arm_reloc_map): Likewise.
	(elf32_arm_reloc_type_lookup): Likewise.
	(TCB_SIZE): Define.
	(struct elf32_arm_obj_tdata): New.
	(elf32_arm_tdata, elf32_arm_local_got_tls_type): Define.
	(elf32_arm_mkobject): New function.
	(struct elf32_arm_relocs_copied): Add pc_count.
	(elf32_arm_hash_entry, GOT_UNKNOWN, GOT_NORMAL, GOT_TLS_GD)
	(GOT_TLS_IE): Define.
	(struct elf32_arm_link_hash_table): Add tls_ldm_got.
	(elf32_arm_link_hash_newfunc): Initialize tls_type.
	(elf32_arm_copy_indirect_symbol): Copy pc_count and tls_type.
	(elf32_arm_link_hash_table_create): Initialize tls_ldm_got.
	(dtpoff_base, tpoff): New functions.
	(elf32_arm_final_link_relocate): Handle TLS relocations.
	(IS_ARM_TLS_RELOC): Define.
	(elf32_arm_relocate_section): Warn about TLS mismatches.
	(elf32_arm_gc_sweep_hook): Handle TLS relocations and pc_count.
	(elf32_arm_check_relocs): Detect invalid symbol indexes.  Handle
	TLS relocations and pc_count.
	(elf32_arm_adjust_dynamic_symbol): Check non_got_ref.
	(allocate_dynrelocs): Handle TLS.  Bind REL32 relocs to local
	calls.
	(elf32_arm_size_dynamic_sections): Handle TLS.
	(elf32_arm_finish_dynamic_symbol): Likewise.
	(bfd_elf32_mkobject): Define.
gas/
	* config/tc-arm.c (arm_parse_reloc): Add TLS relocations.
	(md_apply_fix3): Mark TLS symbols.
	(tc_gen_reloc): Handle TLS relocations.
	(arm_fix_adjustable): Ignore TLS relocations.
	(s_arm_elf_cons): Support expressions after decorated symbols.
gas/testuite/
	* gas/arm/tls.s, gas/arm/tls.d: New files.
	* gas/arm/arm.exp: Run TLS test.
include/elf/
	* arm.h: Add TLS relocations.
ld/testsuite/
	* ld-arm/tls-lib.s, ld-arm/tls-lib.d, ld-arm/tls-lib.r,
	ld-arm/tls-app.s, ld-arm/tls-app.d, ld-arm/tls-app.r: New files.
	* ld-arm/arm-lib.ld, ld-arm/arm-dyn.ld: Increase data segment
	alignment.
	* ld-arm/arm-elf.exp: Run TLS tests.
2005-03-29 16:54:22 +00:00
Daniel Jacobowitz 71a976dd82 * elf32-arm.c (elf32_arm_check_relocs): Increment count for all
relocation types.  Don't count relocations which will use a PLT.
2005-03-29 16:39:51 +00:00
Joel Brobecker 7e7353ed54 * elf.c (elfcore_grok_nto_status): Print tid as long.
(elfcore_grok_nto_regs): Likewise.
2005-03-29 08:51:59 +00:00
Joel Brobecker 166856d77d * irix-core.c: Remove some unnecessary prototypes. 2005-03-29 08:34:48 +00:00
Joel Brobecker 40f8590059 * irix-core.c: Convert to ISO C. 2005-03-29 04:48:45 +00:00
Joel Brobecker aa2e06ba60 * irix-core.c (do_sections): Replace + by | in expression.
(irix_core_core_file_matches_executable_p): Add ATTRIBUTE_UNUSED
        to unused parameters to avoid a compiler warning.
2005-03-29 04:19:34 +00:00
Alan Modra b05fa4991a daily update 2005-03-29 00:00:05 +00:00
Mark Kettenis 832bc18607 * netbsd-core.c: Convert to ISO C. Fix formatting. 2005-03-28 14:18:55 +00:00
H.J. Lu 8e80a8ad6b Update BFD_VERSION_DATE to 20050327 by hand. 2005-03-27 18:57:08 +00:00
Eric Christopher 82f0cfbdcc 2005-03-24 Eric Christopher <echristo@redhat.com>
* elfxx-mips.c: Revert previous patch.

2005-03-24  Eric Christopher  <echristo@redhat.com>

	* ld-mips-elf/rel32-n32.d: Revert changes.
	* ld-mips-elf/rel32-o32.d: Ditto.
	* ld-mips-elf/rel64.d: Ditto.
2005-03-24 22:47:52 +00:00
Nick Clifton d7b9976fce (_bfd_target_vector): Only include the bfd_elf32_ia64_hpux_big_vec vector
when building a 64-bit BFD with	all targets enabled.
2005-03-24 21:02:19 +00:00
Nick Clifton 074d327a4c (BFD32_BACKENDS): Delete elf32-ia64.lo.
(BFD64_BACKENDS): Add elf32-ia64.lo.
2005-03-24 09:26:27 +00:00
Eric Christopher cc27e1dc44 bfd/ChangeLog:
2005-03-23  Eric Christopher  <echristo@redhat.com>

	* elfxx-mips.c (MIPS_ELF_READONLY_SECTION): New.
	(mips_elf_calculate_relocation): Use. Define DF_TEXTREL
	after emitting relocation.
	(_bfd_mips_elf_adjust_dynamic_symbol): Ditto.
	(_bfd_mips_elf_check_relocs): Remove code to set DF_TEXTREL
	and readonly_reloc.

ld/testsuite/ChangeLog:

2005-03-23  Eric Christopher  <echristo@redhat.com>

	* ld-mips-elf/textrel-1.s, ld-mips-elf/textrel-1.d: New
	test.
	* ld-mips-elf/mips-elf.exp: Call it.
	* ld-mips-elf/rel32-n32.d: Update for DF_TEXTREL removal.
	* ld-mips-elf/rel32-o32.d: Ditto.
	* ld-mips-elf/rel64.d: Ditto.
2005-03-24 01:30:47 +00:00
Nick Clifton ed84e69560 Accept any C library to accompany a GNU Linux implementation, not just the GNU
C library.
2005-03-23 15:35:50 +00:00
H.J. Lu 81e1b023da bfd/
2005-03-22  H.J. Lu  <hongjiu.lu@intel.com>

	* bfd-in.h (_bfd_elf_provide_symbol): New.
	* bfd-in2.h: Regenerated.

	* elf32-ppc.c (set_linker_sym): Moved to elflink.c.
	(ppc_elf_set_sdata_syms): Call _bfd_elf_provide_symbol instead
	of set_linker_sym.

	* elflink.c (_bfd_elf_provide_symbol): New. Moved and renamed
	from elf32-ppc.c.

ld/

2005-03-22  H.J. Lu  <hongjiu.lu@intel.com>

	* emultempl/elf32.em (gld${EMULATION_NAME}_provide_bound_symbols): New
	(gld${EMULATION_NAME}_finish): Call
	gld${EMULATION_NAME}_provide_bound_symbols to provide
	__preinit_array_start, __preinit_array_end, __init_array_start,
	__init_array_end, __fini_array_start and __fini_array_end.

	* scripttempl/elf.sc: Don't provide __preinit_array_start,
	__preinit_array_end, __init_array_start, __init_array_end,
	__fini_array_start nor __fini_array_end.
2005-03-23 04:14:46 +00:00
Alan Modra 8d29b8fc1b daily update 2005-03-22 23:00:05 +00:00
Hans-Peter Nilsson 672c2d7e52 * hash.c (strtab_hash_newfunc): Fix typo in allocated size. 2005-03-22 21:52:52 +00:00
Bob Wilson 1fbc7e7aee include ChangeLog
* xtensa-isa.h: Update a comment and whitespace.
bfd ChangeLog
	* xtensa-isa.c (xtensa_opcode_lookup, xtensa_state_lookup,
	xtensa_sysreg_lookup_name, xtensa_interface_lookup,
	xtensa_funcUnit_lookup): Skip bsearch call if count is zero.
	(xtensa_opcode_decode): Rearrange code.
2005-03-22 19:31:28 +00:00
Nick Clifton afe94956ca Oops - fix typo in ISO-C90ifcation 2005-03-22 18:43:09 +00:00
Nick Clifton 46e94266ae Oops - fix typos and finish of ISO-C90'fication of ieee.c 2005-03-22 18:03:26 +00:00
Nick Clifton c8e7bf0d21 Convert to ISO C90 formatting. 2005-03-22 16:14:43 +00:00
Daniel Jacobowitz 28a094c2cc * elf32-arm.c (elf32_arm_final_link_relocate): Don't fail for
unresolved symbols in R_ARM_NONE relocations.
2005-03-22 15:39:32 +00:00
Daniel Jacobowitz 0945cdfd61 * elf32-arm.c (elf32_arm_final_link_relocate): Add
UNRESOLVED_RELOC_P argument.  Set it appropriately.
	(elf32_arm_relocate_section): Update call to
	elf32_arm_final_link_relocate.  Don't clobber RELOCATION; use
	unresolved_reloc instead.
2005-03-22 15:39:08 +00:00
Alan Modra 11d2f718eb bfd/
* elflink.c (elf_link_add_object_symbols): Set SEC_EXCLUDE on
	.gnu.warning.* sections.
ld/
	* emultempl/elf32.em (gld${EMULATION_NAME}_before_allocation): Set
	SEC_EXCLUDE on .gnu.warning sections.
2005-03-22 14:49:16 +00:00
Alan Modra 76750a2f8d * elf32-ppc.c (elf_linker_section_pointers_t): Remove
written_address_p.
	(ppc_elf_create_linker_section): Don't try to reuse existing section.
	(elf_create_pointer_linker_section): Delete info parm.  Don't make
	h dynamic.  Don't set written_address_p.
	(ppc_elf_check_relocs): Adjust ppc_elf_create_linker_section calls.
	(bfd_put_ptr): Delete.
	(elf_finish_pointer_linker_section): Remove output_bfd and info parms.
	Always write section contents.  Assert global sym is def_regular.
	Use offset bottom bit as a written flag.
	(ppc_elf_relocate_section): Adjust elf_finish_pointer_linker_section
	calls.
2005-03-22 13:32:57 +00:00
Alan Modra f85f57adbc * elf32-ppc.c (ppc_elf_set_sdata_syms): New function, extracted from..
(ppc_elf_set_sdata_syms): ..here.  Expand comment.  Set .sbss start
	and end syms.
2005-03-22 03:23:51 +00:00
Alan Modra cc42d39760 daily update 2005-03-21 23:00:05 +00:00
Nick Clifton 2dc773a026 (coff_link_hash_entry): Only define for non WINCE targets.
(t2a1_bx_pc_insn): Likewise.
(t2a2_noop_insn): Likewise.
(t2a3_b_insn): Likewise.
(t2a1_push_insn): Likewise.
(t2a2_ldr_insn): Likewise.
(t2a3_mov_insn): Likewise.
(t2a4_bx_insn): Likewise.
(t2a5_pop_insn): Likewise.
(t2a6_bx_insn): Likewise.
(coff_arm_relocate_section): Only declare the high_address variable for non
WINCE targets.
2005-03-21 15:43:38 +00:00
Alan Modra 644285efef bfd/
* elf32-ppc.c (ppc_elf_add_symbol_hook): Make htab->sbss
	SEC_LINKER_CREATED.  Attach to dynobj.
	(ppc_elf_size_dynamic_sections): Strip htab->sbss if zero size.
ld/
	* scripttempl/elf.sc (SBSS): Don't provide sbss start and end syms.
ld/testsuite/
	* ld-powerpc/tlsexe32.r: Update.
	* ld-powerpc/tlsso32.d: Update.
	* ld-powerpc/tlsso32.g: Update.
	* ld-powerpc/tlsso32.r: Update.
2005-03-21 13:56:57 +00:00
Alan Modra c9a2f3330b bfd/
* elf32-ppc.c (struct elf_linker_section): Remove sym_hash and
	sym_offset.  Add name, bss_name, sym_name, sym_val.
	(struct ppc_elf_link_hash_table): Remove sdata and sdata2 pointers.
	Add sdata array of elf_linker_section_t.
	(ppc_elf_link_hash_table_create): Set name, sym_name, and bss_name.
	(enum elf_linker_section_enum): Delete.
	(ppc_elf_create_linker_section): Rewrite.  Don't create syms here.
	(ppc_elf_check_relocs): Delay ppc_elf_create_linker_section until
	the special sections are needed.  Adjust htab->sdata refs.
	Ensure dynobj is set in sreloc code.
	(ppc_elf_size_dynamic_sections): Strip sdata sections.
	(ppc_elf_set_sdata_syms): New function.
	(elf_finish_pointer_linker_section): Use 0x8000 for sym_offset.
	(ppc_elf_relocate_section): Adjust references to htab->sdata.  Use
	sym_val instead of sym_hash.
	* elf32-ppc.h (ppc_elf_set_sdata_syms): Declare.
ld/
	* emultempl/ppc32elf.em (gld${EMULATION_NAME}_after_allocation): New
	function.
	(LDEMUL_AFTER_ALLOCATION): Define.
2005-03-21 13:23:15 +00:00
Alan Modra 8853c3d336 * elf32-ppc.c (is_ppc_elf_target): Move to linker part of file.
(ppc_elf_merge_private_bfd_data): Likewise.
2005-03-21 12:24:10 +00:00
Alan Modra 2bb04cf221 * elf32-ppc.c (struct elf_linker_section): Remove rel_section.
(ppc_elf_create_linker_section): Don't create rel_section.
	(elf_create_pointer_linker_section): Don't size relocs.
	(elf_finish_pointer_linker_section): Remove relative_reloc parm.
	Don't generate relocs.
	(ppc_elf_relocate_section): Adjust calls to
	elf_finish_pointer_linker_section.
2005-03-21 12:09:13 +00:00
Alan Modra d2663f46ec * elf32-ppc.c (is_ppc_elf_target): New function.
(ppc_elf_merge_private_bfd_data): Use it rather than just testing
	for bfd_target_elf_flavour.  Do this test before endian check.
	(ppc_elf_add_symbol_hook): Use is_pcc_elf_target.
	(ppc_elf_size_dynamic_sections): Likewise.
2005-03-21 11:22:24 +00:00
H.J. Lu 6dc132d920 2005-03-20 H.J. Lu <hongjiu.lu@intel.com>
* elf-bfd.h (elf_backend_data): Add int to
	elf_backend_section_from_shdr.
	(bfd_elf_section_data): Update comment for this_idx.
	(_bfd_elf_make_section_from_shdr): Add int.
	* elfxx-mips.h (_bfd_mips_elf_section_from_shdr): Likewise.

	* elf.c (_bfd_elf_make_section_from_shdr): Take section index
	and use it to set this_idx in bfd_elf_section_data.
	(bfd_section_from_shdr): Pass shindex to
	_bfd_elf_make_section_from_shdr.
	(_bfd_elf_section_from_bfd_section): Use this_idx in
	bfd_elf_section_data to find section index.

	* elf32-arm.c (elf32_arm_section_from_shdr): Take section
	index and pass it to _bfd_elf_make_section_from_shdr.
	* elf32-i370.c(i370_elf_section_from_shdr): Likewise.
	* elf32-ppc.c (ppc_elf_section_from_shdr): Likewise.
	* elf32-sh64.c (sh64_backend_section_from_shdr): Likewise.
	* elf32-v850.c (v850_elf_section_from_shdr): Likewise.
	* elf64-alpha.c (elf64_alpha_section_from_shdr): Likewise.
	* elf64-hppa.c (elf64_hppa_section_from_shdr): Likewise.
	* elf64-x86-64.c (elf64_x86_64_section_from_shdr): Likewise.
	* elfxx-ia64.c (elfNN_ia64_section_from_shdr): Likewise.
	* elfxx-mips.c (_bfd_mips_elf_section_from_shdr): Likewise.
2005-03-20 23:36:19 +00:00
Alan Modra a4cd38bc61 daily update 2005-03-20 23:00:04 +00:00
Alan Modra b33015791c daily update 2005-03-19 23:00:06 +00:00
Danny Smith cabd4ccc81 * peicode.h (pe_ILF_build_a_bfd): Strip only one prefix
character in IMPORT_NAME_UNDECORATE and IMPORT_NAME_NOPREFIX
	cases.  Add comment.
2005-03-19 06:48:31 +00:00
H.J. Lu 7451fd8967 2005-03-18 H.J. Lu <hongjiu.lu@intel.com>
* elflink.c (elf_mark_used_section): Remove check for special
	sections.
2005-03-18 23:51:21 +00:00
Alan Modra d40e2883cc daily update 2005-03-18 23:00:05 +00:00
Andreas Schwab b4677f0316 * elfxx-ia64.c (elfNN_ia64_install_value): Change type of insn
from bfd_vma to ia64_insn, remove broken cast.
2005-03-18 21:31:31 +00:00
Nick Clifton 238d258f72 Add support for generating PLT lookups for the ColdFire. 2005-03-18 17:20:33 +00:00
Mark Mitchell b294bdf8d0 * elf32-arm.c (elf32_arm_modify_segment_map): New function.
(elf32_arm_additional_program_headers): Likewise.
	(elf_backend_modify_segment_map): Define.
	(elf_backend_additional_program_headers): Likewise.
	(elf32_arm_symbian_modify_segment_map): Use
	elf32_arm_modify_segment_map.

	* binutils/readelf.c (get_arm_segment_type): New function.
	(get_segment_type): Use it.

	* arm.h (PT_ARM_EXIDX): Define.
2005-03-18 17:06:16 +00:00
H.J. Lu 257a482034 2005-03-18 H.J. Lu <hongjiu.lu@intel.com>
* elflink.c (elf_mark_used_section): Check bfd_is_const_section
	for special sections.
2005-03-18 15:46:25 +00:00
Alan Modra 554220db5b * elf-bfd.h (_bfd_elf_link_renumber_dynsyms): Delete.
* elflink.c (_bfd_elf_link_renumber_dynsyms): Make static, add
	section_sym_count param, and return number of section symbols.
	(bfd_elf_size_dynamic_sections): Clear section symbol area of
	.dynsym contents.  Don't bother calling swap_symbol_out on the
	first all-zero dynsym.
	(elf_mark_used_section): Formatting.  Avoid twiddling flags in
	special sections like bfd_abs_section.
	(bfd_elf_gc_sections): Spelling fix.
2005-03-18 13:21:11 +00:00
Alan Modra 315adc8917 daily update 2005-03-17 23:00:05 +00:00
Nick Clifton 36868d45f8 (read_indirect_string): Fix apparent typo, check dwarf_str_buffer allocation,
not dwarf_abbrev_buffer.
2005-03-17 08:24:28 +00:00
Alan Modra 9050699f3f daily update 2005-03-16 23:00:06 +00:00
H.J. Lu 57316bff0a bfd/
2005-03-16  H.J. Lu  <hongjiu.lu@intel.com>

	* elflink.c (elf_mark_used_section): New.
	(bfd_elf_gc_sections): Call elf_gc_mark_section for
	non-relocatable link if we don't do GC.

include/

2005-03-16  H.J. Lu  <hongjiu.lu@intel.com>

	* bfdlink.h (bfd_link_info): Add gc_sections.

ld/

2005-03-16  H.J. Lu  <hongjiu.lu@intel.com>

	* emultempl/elf32.em (gld${EMULATION_NAME}_finish): Remove
	unused empty output sections for non-relocatable link.

	* ld.h (args_type): Remove gc_sections.

	* ldlang.c (lang_mark_used_section): New.
	(lang_gc_sections): Use link_info.gc_sections instead of
	command_line.gc_sections.
	* ldmain.c (main): Likewise.
	* lexsup.c (parse_args): Likewise.
	* ldlang.c (lang_process): Call lang_mark_used_section.

	* ldmain.c (main): Initialize link_info.gc_sections to FALSE.

ld/testsuite/

2005-03-16  H.J. Lu  <hongjiu.lu@intel.com>

	* ld-alpha/tlsbin.rd: Updated for empty section removal.
	* ld-alpha/tlsbinr.rd: Likewise.
	* ld-alpha/tlspic.rd: Likewise.
	* ld-arm/mixed-lib.sym: Likewise.
	* ld-i386/tlsbin.rd: Likewise.
	* ld-i386/tlsnopic.rd: Likewise.
	* ld-i386/tlspic.rd: Likewise.
	* ld-ia64/tlsbin.rd: Likewise.
	* ld-ia64/tlspic.rd: Likewise.
	* ld-powerpc/apuinfo.rd: Likewise.
	* ld-powerpc/powerpc.exp: Likewise.
	* ld-powerpc/tlsexe32.r: Likewise.
	* ld-s390/tlsbin.rd: Likewise.
	* ld-s390/tlsbin_64.rd: Likewise.
	* ld-s390/tlspic.rd: Likewise.
	* ld-s390/tlspic_64.rd: Likewise.
	* ld-sh/tlsbin-2.d: Likewise.
	* ld-sh/tlspic-2.d: Likewise.
	* ld-sparc/tlssunbin32.rd: Likewise.
	* ld-sparc/tlssunnopic32.rd: Likewise.
	* ld-sparc/tlssunpic32.rd: Likewise.
	* ld-x86-64/tlsbin.rd: Likewise.
	* ld-x86-64/tlspic.rd: Likewise.
2005-03-16 21:52:48 +00:00
Nick Clifton 569acd2ce2 Rename switch to enable/disable -Werror to --enable-werror/--disable-werror
for compatibility with gcc.
2005-03-16 17:18:17 +00:00
Nick Clifton 1ad12f975f Enable -Werror by default 2005-03-16 16:17:14 +00:00
Nick Clifton 3b5d3310ee Convert to ISO C90 formatting. 2005-03-16 14:37:15 +00:00
Alan Modra 25dbc73a85 * elf32-ppc.c: Divide file into general and linker specific
functions.  Sort linker functions into roughly the order in which
	they are called by the ELF linker code.
2005-03-16 06:11:51 +00:00
Alan Modra cb2d1ef2ae bfd/
* elf32-ppc.c (ppc_elf_create_linker_section): Set SEC_LINKER_CREATED
	on section.  Correct comment, and add FIXME.
	(ppc_elf_additional_program_headers): Don't bump header count for
	interp.  Test SEC_ALLOC, not SEC_LOAD, and don't test size.
	(ppc_elf_size_dynamic_sections): Don't strip sdata and sdata2, but
	do allocate memory if they need it.
ld/
	* emulparams/elf32ppclinux.sh (OTHER_READWRITE_SECTION): Delete.
	(OTHER_RELRO_SECTIONS): Set this instead.
ld/testsuite/
	* ld-powerpc/tlsexe32.d: Update.
	* ld-powerpc/tlsexe32.g: Update.
	* ld-powerpc/tlsexe32.r: Update.
	* ld-powerpc/tlsexe32.t: Update.
	* ld-powerpc/tlsso32.d: Update.
	* ld-powerpc/tlsso32.g: Update.
	* ld-powerpc/tlsso32.r: Update.
	* ld-powerpc/tlsso32.t: Update.
2005-03-16 02:41:28 +00:00
Alan Modra ca07ff3495 daily update 2005-03-15 23:00:05 +00:00
Nick Clifton 34723071b5 Add support for an x86_64-elf target 2005-03-15 14:14:08 +00:00
Alan Modra 729ae8d20e Commit new Spanish translation. 2005-03-15 05:25:37 +00:00
Alan Modra 8e9c1e6d1c daily update 2005-03-14 23:00:05 +00:00
H.J. Lu f05819304c 2005-03-14 H.J. Lu <hongjiu.lu@intel.com>
* elfxx-ia64.c (elfNN_ia64_relocate_section): Set symbo name
	for global symbol when reporting overflow.
2005-03-14 18:55:44 +00:00
Alan Modra 114bfe309a daily update 2005-03-13 23:00:05 +00:00
Alan Modra 3d982b6f53 daily update 2005-03-12 23:00:07 +00:00
Alan Modra afea7a384b daily update 2005-03-11 23:00:06 +00:00
Jakub Jelinek 390c0e4288 * libbfd-in.h (_bfd_ar_spacepad): New prototype.
* libbfd.h: Rebuilt.
	* archive.c (_bfd_ar_spacepad): New function.
	(_bfd_construct_extended_name_table, _bfd_write_archive_contents,
	bsd_write_armap, _bfd_archive_bsd_update_armap_timestamp,
	coff_write_armap): Use it.
	(bfd_ar_hdr_from_filesystem): Likewise.  Fix HP-UX large
	uid/gid support.
	* archive64.c (bfd_elf64_archive_write_armap): Use _bfd_ar_spacepad.
2005-03-11 16:37:17 +00:00
Alan Modra 41bc16b289 daily update 2005-03-10 23:00:05 +00:00
Mark Kettenis a2633f4e94 * archive.c (_bfd_look_for_bfd_in_cache): Move declaration of
has_table to the start of the function.
2005-03-10 21:26:53 +00:00
Ben Elliston 109f709619 * archive.c: Include hashtab.h.
(struct ar_cache): Rename `arelt' to `arbfd' and remove `next'.
	(_bfd_look_for_bfd_in_cache): Reimplement using htab_find.
	(hash_file_ptr): New function.
	(eq_file_ptr): Likewise.
	(_bfd_add_bfd_to_archive_cache): Reimplement using a hash table.
	* libbfd-in.h: Include hashtab.h.
	(struct artdata): Change `cache' member type to htab_t.
	* libbfd.h: Rebuild.
2005-03-10 00:29:35 +00:00
Alan Modra 291108ad01 daily update 2005-03-09 23:00:05 +00:00
Alan Modra e4362844bc daily update 2005-03-08 23:00:05 +00:00
Daniel Jacobowitz 664fe1be18 * configure.in: Bump version to 2.16.90.
* configure: Regenerated.
2005-03-08 15:09:23 +00:00
Alan Modra 048325cf9c daily update 2005-03-07 23:00:05 +00:00
Jakub Jelinek 0709bb2246 * opncls.c (opncls_bread, opncls_bclose): Fix if pread resp.
close is a function like macro in system headers.
2005-03-07 10:32:38 +00:00
Alan Modra b18e2ae59e PR ld/778
* elf32-hppa.c (elf32_hppa_create_dynamic_sections): Reinstate
	_GLOBAL_OFFSET_TABLE_ as a normal dynamic symbol.
2005-03-07 06:01:17 +00:00
Alan Modra 3ab8f84c9c daily update 2005-03-06 23:00:05 +00:00
Alan Modra 1f17067849 * elf.c (elfcore_grok_win32pstatus): Warning fixes. 2005-03-06 02:02:15 +00:00
Alan Modra 486d6afcde daily update 2005-03-05 23:00:05 +00:00
Alan Modra 06647dfdde Regenerate .pot files 2005-03-05 12:14:34 +00:00
Alan Modra 93f3fa9956 * elf64-ppc.c (update_plt_info): Don't mark new ABI call syms
with is_func.
	(func_desc_adjust): Force dot-syms local in executables as well
	as shared libs.
2005-03-05 11:44:14 +00:00
Thiemo Seufer bbe506e8ba bfd/ChangeLog
* elfxx-mips.c (mips_elf_calculate_relocation): Handle special
	'__gnu_local_gp' symbol used by gas -mno-shared.

	gas/ChangeLog
	* config/tc-mips.c (macro_build_lui): Use '__gnu_local_gp'
	instead of '_gp' for -mno-shared optimization.
	(s_cpload): Ditto.
	(s_abicalls): Document it in the comment.
	(md_show_usage): Document the -mno-shared option.

	gas/testsuite/ChangeLog
	* gas/mips/elf-rel23b.d: Use '__gnu_local_gp' instead of '_gp'
	for -mno-shared optimization.
	* gas/mips/elf-rel25a.d: Ditto.

	ld/testsuite/ChangeLog
	* ld-mips-elf/multi-got-no-shared-1.s,
	ld-mips-elf/multi-got-no-shared-2.s,
	ld-mips-elf/multi-got-no-shared.d: New tests.
	* ld-mips-elf/mips-elf.exp: Run them.
2005-03-05 00:01:44 +00:00
Alan Modra f829048aac daily update 2005-03-04 23:00:06 +00:00