Commit Graph

7120 Commits

Author SHA1 Message Date
Alan Modra 46f2f11d4c * coffcode.h (coff_slurp_line_table): bfd_alloc lineno_cache first
so that we don't inadvertently free it.  Use bfd_alloc for sort
	arrays, and memcpy sorted line table.
2008-08-05 03:03:46 +00:00
Alan Modra 75fad9c700 daily update 2008-08-05 00:00:07 +00:00
Alan Modra e5e6a5ff6e * elf32-spu.c (spu_elf_auto_overlay): Use the maximum possible
if --fixed-space request is too large.
2008-08-04 13:01:42 +00:00
Alan Modra 323ee3f41c Set LC_ALL=C rather than unsetting LC_COLLATE for sort. 2008-08-04 06:55:33 +00:00
Alan Modra 2fa331fa33 daily update 2008-08-04 00:00:05 +00:00
Alan Modra f9d4c3329e daily update 2008-08-03 00:00:05 +00:00
Alan Modra 4f0d75bedd * elf32-spu.c (mark_overlay_section): Move code calculating
max_overlay_size to correct block.
	(spu_elf_auto_overlay): Don't use %x in einfo error message.
2008-08-02 06:44:43 +00:00
Alan Modra dbe454a3b5 daily update 2008-08-02 00:00:05 +00:00
Alan Modra 11a7ae4fa9 * elfcore.h (elf_core_file_p): Ensure we have a backend match
with the correct arch size before rejecting the generic fallback.
	* elfcode.h (elf_object_p): Likewise.  Ensure arch size matches
	before accepting a target.
2008-08-01 12:21:28 +00:00
Alan Modra 010c8431b0 * elf.c (rewrite_elf_program_header): Don't wrap p_paddr to
include file or program headers.
2008-08-01 06:39:04 +00:00
Alan Modra 960b1a9a21 daily update 2008-08-01 00:00:06 +00:00
Alan Modra f2f3bcb705 daily update 2008-07-31 00:00:05 +00:00
Alan Modra 0af1713e7c Silence gcc printf warnings 2008-07-30 04:34:58 +00:00
Alan Modra baea00a633 daily update 2008-07-30 00:00:06 +00:00
Alan Modra 322f0e159d daily update 2008-07-29 00:00:05 +00:00
Daniel Jacobowitz 9a59ad6b6f * elfxx-mips.c (mips_elf_calculate_relocation): Avoid generating
relocations for undefined weak symbols with non-default visibility.
	(_bfd_mips_elf_check_relocs): Use possibly_dynamic_relocs for
	global symbols in shared libraries.
	(allocate_dynrelocs): New function.
	(_bfd_mips_elf_adjust_dynamic_symbol): Do not handle
	possibly_dynamic_relocs here.
	(_bfd_mips_elf_size_dynamic_sections): Call allocate_dynrelocs.
2008-07-28 22:14:53 +00:00
Alexandre Oliva 9f03412ac6 bfd/ChangeLog:
* elf32-i386.c (struct elf_i386_link_hash_table): Added field
tls_module_base.
(elf_i386_link_hash_table_create): Initialize it.
(elf_i386_always_size_sections): Set it.
(set_tls_module_base): New.
(elf_i386_relocate_sections): Call it.
* elf64-x86-64.c (struct elf64_x86_64_link_hash_table): Added
field tls_module_base.
(elf64_x86_64_link_hash_table_create): Initialize it.
(elf64_x86_64_always_size_sections): Set it.
(set_tls_module_base): New.
(elf64_x86_64_relocate_sections): Call it.
Reported by Cary Coutant <ccoutant@google.com>
ld/testsuite/ChangeLog:
* ld-i386/tlsbindesc.dd: Adjust incorrect expectations for LD to
LE relaxation.
* ld-x86-64/tlsbindesc.dd: Likewise.
* ld-i386/tlsbindesc.rd: Adjust address of _TLS_MODULE_BASE_.
* ld-x86-64/tlsbindesc.rd: Likewise.
Reported by Cary Coutant <ccoutant@google.com>
2008-07-28 18:07:05 +00:00
Alan Modra 9a008db36e * elf32-arm.c (arm_map_one_stub): Declare variables at beginning
of block.
	* elf32-avr.c (get_local_syms): Likewise.
2008-07-28 06:46:31 +00:00
Alan Modra 14a9197011 bfd/
PR 6769
	* bfd-in.h (BFD_VMA_FMT): Define.
	(printf_vma, sprintf_vma): Use the above.
	(_bfd_int64_low, _bfd_int64_high): Delete.
	* bfd-in2.h: Regenerate.
binutils/
	PR 6769
	* readelf.c (print_dec_vma, print_hex_vma): Delete.
	(print_vma): Use BFD_VMA_FMT.
	* size.c (size_number, rprint_number): Likewise.
2008-07-28 04:07:32 +00:00
Alan Modra d77b387c92 daily update 2008-07-28 00:00:05 +00:00
Alan Modra baea7ef144 * elf.c (_bfd_elf_make_section_from_shdr): Ignore return from
elf_parse_notes.  Use bfd_malloc_and_get_section.
	(elf_parse_notes): Validate note namesz and descsz.
2008-07-27 03:43:51 +00:00
Alan Modra 7208a7f88d daily update 2008-07-27 00:00:05 +00:00
Alan Modra 3c7b98977c Support PowerPC single-precision float. 2008-07-26 13:10:48 +00:00
Alan Modra 94c034a2b1 daily update 2008-07-26 00:00:06 +00:00
Alan Modra 167ac92966 daily update 2008-07-25 00:00:06 +00:00
Daniel Jacobowitz 20163277f8 * elf32-mips.c (elf_backend_write_section): Define. 2008-07-24 16:17:42 +00:00
Nick Clifton 4ff738568a * elf.c (_bfd_elf_map_sections_to_segments): Catch off by one
error assigning sections to segments.
2008-07-24 07:51:25 +00:00
Alan Modra 94c16cb988 daily update 2008-07-24 00:00:05 +00:00
Alan Modra 2b380f6b14 daily update 2008-07-23 00:00:05 +00:00
Nick Clifton 39948a609d * elf.c (_bfd_elf_map_sections_to_segments): Allow sections in
adjoining pages to be included in the same segment.
2008-07-22 11:19:01 +00:00
Chris Demetriou bda987c255 2008-07-22 Simon Baldwin <simonb@google.com>
* elflink.c (elf_link_output_extsym): Set st_size to zero for
        symbols from dynamic libraries.
2008-07-22 04:58:33 +00:00
Alan Modra 21963d0e69 daily update 2008-07-22 00:00:05 +00:00
H.J. Lu 88ba32a0f9 2008-07-21 H.J. Lu <hongjiu.lu@intel.com>
PR ld/4424
	* elflink.c (_bfd_elf_merge_symbol): Call bed->relocs_compatible
	to check if 2 inputs are compatible.
2008-07-21 16:13:27 +00:00
Nick Clifton 37c43c558f * elf.c (assign_file_positions_for_load_sections): Print vma in
error message about overlapping section vmas.
2008-07-21 16:01:01 +00:00
H.J. Lu 50403a1fdb 2008-07-21 H.J. Lu <hongjiu.lu@intel.com>
PR ld/6747
	* elf32-frv.c (elf32_frv_relocate_section): Revert the change
	for PR ld/6446 checked in by accident on May 21, 2008.
2008-07-21 14:36:07 +00:00
Nick Clifton 799c00e027 * coff-sh.c (bfd_pe_print_pdata): Define to NULL for non
COFF_WITH_PE based SH ports.
        * libpei.h (_bfd_XX_print_ce_compressed_pdata): Prototype.
        * arm-wince-pe.c (bfd_pe_print_pdata): Use
        _bfd_pe_print_ce_compressed_pdata.
        (slurp_symcache, cleanup_syms, pe_print_ce_compressed_pdata): Move
        to...
        * peXXigen.c: ... here and rename pe_print_ce_compressed_pdata to
        _bfd_XX_print_ce_compressed_pdata.
2008-07-21 14:09:57 +00:00
Alan Modra f60e73e9fc * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Drop
unwanted zero terminators.
2008-07-21 07:49:58 +00:00
Alan Modra dc1859a6ef * elf32-spu.c (spu_elf_relocate_section): Expand
RELOC_FOR_GLOBAL_SYMBOL.  Don't warn about undefined symbols for
	R_SPU_PPU32 and R_SPU_PPU64 relocations.
2008-07-21 07:36:25 +00:00
Luis Machado 89eeb0bc23 * bfd/elf-bfd.h: Declare elfcore_write_ppc_vsx.
* bfd/elf.c (elfcore_grok_ppc_vsx): New function.
	(elfcore_write_ppc_vsx): New function
	(elfcore_grok_note): Handle VSX notes.
	(elfcore_write_register_note): Handle VSX notes.
	* include/elf/common.h: Define NT_PPC_VSX.
	* binutils/readelf.c (get_note_type): Handle VSX notes.
2008-07-21 05:33:37 +00:00
Alan Modra 1cad8cd386 daily update 2008-07-21 00:00:05 +00:00
Alan Modra 66f7e4cd3f daily update 2008-07-20 00:00:05 +00:00
Alan Modra 25ba9239fd daily update 2008-07-19 00:00:05 +00:00
Joseph Myers a9dc948127 bfd:
* bfd-in.h (bfd_elf32_arm_set_target_relocs): Add new parameter.
	* bfd-in2.h: Regenerate.
	* elf32-arm.c (struct elf_arm_obj_tdata): Add field
	no_wchar_size_warning.
	(bfd_elf32_arm_set_target_relocs): Add new parameter
	no_wchar_warn.
	(elf32_arm_merge_eabi_attributes): Give a warning, not an error,
	for conflicting wchar_t attributes.  Do not warn if
	--no-wchar-size-warning.  Make diagnostic text more specific.

ld:
	* ld.texinfo (--no-wchar-size-warning): Document new ARM option.
	* emultempl/armelf.em (no_wchar_size_warning): New.
	(arm_elf_create_output_section_statements): Pass
	no_wchar_size_warning to arm_elf_create_output_section_statements.
	(OPTION_NO_WCHAR_SIZE_WARNING): New.
	(PARSE_AND_LIST_LONGOPTS): Add no-wchar-size-warning.
	(PARSE_AND_LIST_OPTIONS): List --no-wchar-size-warning.
	(PARSE_AND_LIST_ARGS_CASES): Handle --no-wchar-size-warning.

ld/testsuite:
	* ld-arm/attr-merge-wchar-0.s,ld-arm/attr-merge-wchar-2.s,
	ld-arm/attr-merge-wchar-4.s, ld-arm/attr-merge-wchar-00-nowarn.d,
	ld-arm/attr-merge-wchar-00.d, ld-arm/attr-merge-wchar-02-nowarn.d,
	ld-arm/attr-merge-wchar-02.d, ld-arm/attr-merge-wchar-04-nowarn.d,
	ld-arm/attr-merge-wchar-04.d, ld-arm/attr-merge-wchar-20-nowarn.d,
	ld-arm/attr-merge-wchar-20.d, ld-arm/attr-merge-wchar-22-nowarn.d,
	ld-arm/attr-merge-wchar-22.d, ld-arm/attr-merge-wchar-24-nowarn.d,
	ld-arm/attr-merge-wchar-24.d, ld-arm/attr-merge-wchar-40-nowarn.d,
	ld-arm/attr-merge-wchar-40.d, ld-arm/attr-merge-wchar-42-nowarn.d,
	ld-arm/attr-merge-wchar-42.d, ld-arm/attr-merge-wchar-44-nowarn.d,
	ld-arm/attr-merge-wchar-44.d: New.
	* ld-arm/arm-elf.exp: Run new tests.
2008-07-18 20:49:12 +00:00
H.J. Lu 6cee0a6ffc 2008-07-18 H.J. Lu <hongjiu.lu@intel.com>
PR ld/6748
	* elf32-arm.c (elf32_arm_link_hash_table_create): Initialize
	new fields added for ARM long call support.
2008-07-18 12:45:33 +00:00
Nick Clifton 2b5c217d45 * pe-arm-wince.c (pe_print_compressed_pdata): Define new function to
print compressed pdata structure as described on MSDN. This only
        applies to a limited set of architectures (ARM, SH4).
        (slurp_symtab, my_symbol_for_address): Define static helper
        functions for pe_print_compressed_pdata.
        * coffcode.h (bfd_coff_backend_data): Add _bfd_coff_print_pdata field.
        (bfd_coff_have_print_pdata, bfd_coff_print_pdata): Define.
        * bfd/peXXigen.c (_bfd_XX_print_private_bfd_data_common): Add check on
        bfd_coff_backend_data, call the function if non-null.
        * pei-mcore.c: Add target dependent initialisation for
        bfd_coff_backend_data.
        * coff-sh.c: Likewise.
        * coff64-rs6000.c: Likewise.
        * coff-rs6000.c: Likewise.
        * libcoff-in.h: Likewise.
        * cf-i386lynx.c: Likewise.
        * coff-alpha.c: Likewise.
        * coff-apollo.c: Likewise.
        * coff-arm.c: Likewise.
        * coff-aux.c: Likewise.
        * coff-h8300.c: Likewise.
        * coff-h8500.c: Likewise.
        * coff-i386.c: Likewise.
        * coff-i860.c: Likewise.
        * coff-i960.c: Likewise.
        * coff-ia64.c: Likewise.
        * coff-m68k.c: Likewise.
        * coff-m88k.c: Likewise.
        * coff-maxq.c: Likewise.
        * coff-mips.c: Likewise.
        * coff-or32.c: Likewise.
        * coff-sparc.c: Likewise.
        * coff-tic30.c: Likewise.
        * coff-tic4x.c: Likewise.
        * coff-tic54x.c: Likewise.
        * coff-tic80.c: Likewise.
        * coff-w65.c: Likewise.
        * coff-we32k.c: Likewise.
        * coff-x86_64.c: Likewise.
        * coff-z80.c: Likewise.
        * coff-z8k.c: Likewise.
        * pe-mcore.c: Likewise.
        * pe-mips.c: Likewise.
        * pe-ppc.c: Likewise.
        * peXXigen.c: Likewise.
        * pei-ppc.c: Likewise.
        * libcoff.h: Regenerate.
2008-07-18 11:30:22 +00:00
Alan Modra 957ab57169 daily update 2008-07-18 00:00:05 +00:00
Alan Modra 55028dd05b daily update 2008-07-17 00:00:05 +00:00
Bernd Schmidt c96a857020 * elf32-bfin.c (bfin_check_relocs, bfin_relocate_section,
bfin_final_link_relocate, bfin_gc_mark_hook, bfin_gc_sweep_hook,
	ELF_DYNAMIC_INTERPRETER, DEFAULT_STACK_SIZE,
	struct _bfinfdpic_dynamic_got_info): Moved around to keep FD-PIC code
	separate from non-FD-PIC.
2008-07-16 15:27:05 +00:00
Alan Modra 86be91b866 daily update 2008-07-16 00:00:05 +00:00
DJ Delorie 605d18d435 * elf-m10300.c (mn10300_elf_final_link_relocate): Correct overflow
checks for PCREL8, PCREL16, GOTPC16, GOTOFF16, PLT16, and GOT16
relocs.
(mn10300_elf_relax_section): Correct jump offset check when target
is in a different section.
2008-07-15 18:48:07 +00:00
H.J. Lu c2f950c8a8 Add missing ChangeLog entries for
http://sourceware.org/ml/binutils-cvs/2008-05/msg00092.html
2008-07-15 18:44:18 +00:00
Jie Zhang b0a0b9787e bfd/
* elf32-bfin.c (elf32_bfin_special_sections[]): New.
	(elf_backend_special_sections): Define.

	ld/
	* emulparams/elf32bfinfd.sh (OTHER_SECTIONS): Define.
2008-07-15 13:09:47 +00:00
Alan Modra f3908caa83 daily update 2008-07-15 00:00:05 +00:00
H.J. Lu 08b78292ee Mention "PR binutils/6743" in ChangeLog. 2008-07-14 01:20:48 +00:00
Craig Silverstein aaf30c25fb 2008-07-13 Craig Silverstein <csilvers@google.com>
* dwarf2.c (struct dwarf2_debug): New variable info_ptr_memory.
	(find_line): Use info_ptr_memory instead of sec_info_ptr.
	(_bfd_dwarf2_cleanup_debug_info): Likewise.
2008-07-14 00:10:09 +00:00
Alan Modra 7f52f6a6ca daily update 2008-07-14 00:00:04 +00:00
Alan Modra 5fa56f1b52 daily update 2008-07-13 00:00:04 +00:00
Jie Zhang 1bac266e85 Revert my last change since it has not been approved. 2008-07-12 08:54:13 +00:00
Alan Modra 3a3af82797 daily update 2008-07-12 00:00:04 +00:00
Jie Zhang 8c68457827 bfd/
* elf.c (_bfd_elf_map_sections_to_segments): Don't put
	executable sections into the same segment with other
	read only sections if --sep-code.
	* elf32-bfin.c (elf32_bfin_code_in_l1): New variable.
	(elf32_bfin_data_in_l1): New variable.
	(elf32_bfin_final_write_processing): New.
	(elf32_bfin_special_sections[]): New.
	(elf_backend_final_write_processing): Define.
	(elf_backend_special_sections): Define.

	binutils/
	* readelf.c (get_machine_flags): Deal with Blackfin specific
	flags.

	include/
	* bfdlink.h (struct bfd_link_info): Add sep_code member
	variable.
	* elf/bfin.h (EF_BFIN_CODE_IN_L1): Define.
	(EF_BFIN_DATA_IN_L1): Define.

	ld/
	* Makefile.am (eelf32bfin.c): Depend on bfin.em.
	(eelf32bfinfd.c): Likewise.
	* Makefile.in: Regenerate.
	* gen-doc.texi: Set Blackfin.
	* ld.texinfo: Document --sep-code and Blackfin specific
	options.
	* ldmain.c (main): Initialize link_info.sep_code.
	* lexsup.c (enum option_values): Add OPTION_SEP_CODE.
	(ld_options[]): Add --sep-code.
	(parse_args): Deal with --sep-code.
	* emulparams/bfin.sh (EXTRA_EM_FILE): Define.
	* emulparams/elf32bfinfd.sh (OTHER_SECTIONS): Define.
	* emultempl/bfin.em: New file.
2008-07-11 19:24:39 +00:00
Andreas Schwab 3076cd1fd4 (read_section): Take pointer to bfd_size_type instead
of unsigned long as last parameter.
(struct dwarf2_debug): Define dwarf_abbrev_size, dwarf_line_size,
dwarf_str_size and dwarf_ranges_size as bfd_size_type instead of
unsigned long.
2008-07-11 09:18:19 +00:00
Alan Modra f1185050a3 daily update 2008-07-11 00:00:05 +00:00
Richard Sandiford 0a61c8c283 bfd/
* elfxx-mips.c (mips_elf_calculate_relocation): Calculate GP and GP0
	for all relocation types.  Allow any type of relocation to refer to
	__gnu_local_gp.

ld/testsuite/
	* ld-mips-elf/no-shared-1-o32.s,
	ld-mips-elf/no-shared-1-o32.d,
	ld-mips-elf/no-shared-1-n32.d,
	ld-mips-elf/no-shared-1-n64.s,
	ld-mips-elf/no-shared-1-n64.d,
	ld-mips-elf/no-shared-1.ld: New tests.
	* ld-mips-elf/mips-elf.exp: Run them.
2008-07-10 19:06:54 +00:00
Richard Sandiford 30c0909079 include/elf/
* mips.h (ELF_ST_IS_MIPS16, ELF_ST_SET_MIPS16): New macros.

bfd/
	* elfxx-mips.c (mips_elf_check_mips16_stubs): Use ELF_ST_IS_MIPS16.
	(mips_elf_calculate_relocation): Likewise.
	(_bfd_mips_elf_add_symbol_hook): Likewise.
	(_bfd_mips_elf_finish_dynamic_symbol): Likewise.
	(_bfd_mips_vxworks_finish_dynamic_symbol): Likewise.

opcodes/
	* mips-dis.c (_print_insn_mips): Use ELF_ST_IS_MIPS16.

gas/
	* config/tc-mips.c (mips16_mark_labels): Use ELF_ST_SET_MIPS16.
	(mips_fix_adjustable): Likewise.
	(mips_frob_file_after_relocs): Likewise.

gas/testsuite/
	* gas/mips/mips16-vis-1.d, gas/mips/mips16-vis-1.s: New tests.
	* gas/mips/mips.exp: Run them.
2008-07-10 19:05:29 +00:00
Andreas Schwab 355d10dc14 (_bfd_mips_elf_section_from_shdr): Add missing
paren.
2008-07-10 16:24:03 +00:00
Craig Silverstein 1b31505692 bfd/
* Makefile.am (BFD32_LIBS): Add compress.lo.
	(BFD32_LIBS_CFILES): Add compress.c.
	(BFD_H_FILES): Likewise.
	* Makefile.in: Regenerate.
	* bfd-in2.h: Regenerate.
	* config.in: Add HAVE_ZLIB_H
	* configure.in: Add test for libz and zlib.h
	* configure: Regenerate.
	* dwarf2.c (read_section): New function.
	(read_indirect_string): Call new function read_section.
	(read_abbrevs): Likewise.
	(decode_line_info): Likewise.
	(read_debug_ranges): Likewise.
	(find_line): Call new function read_section when just one
	.zdebug_info section is found, otherwise read and compress
	multiple sections.
	(_bfd_dwarf2_cleanup_debug_info): Free sec_info_ptr.
	* elf.c (_bfd_elf_make_section_from_shdr): Add zdebug prefix.
	(special_sections_z): New struct.
	(special_sections): Refer to special_sections_z.
	* elfxx-mips.c (_bfd_mips_elf_section_from_shdr): Recognize
	sections named .zdebug_*.
	(_bfd_mips_elf_fake_sections): Likewise.
	* compress.c: New file.
	(bfd_uncompress_section_contents): New function.
bfd/doc/
	* Makefile.am (BFD_H_DEP): Add ../compress.c.
	* Makefile.in: Regenerate.
binutils/
	* config.in: Add HAVE_ZLIB_H
	* configure.in: Add test for libz and zlib.h
	* configure: Regenerate.
	* dwarf.c (debug_displays): Add .zdebug_* strings.
	* dwarf.h (struct dwarf_section): Add fields uncompressed_namd
	and compressed_name.
	* objdump.c (load_debug_section): Call
	bfd_uncompress_section_contents when loading a compressed
	section.
	(dump_dwarf_section): Recognize compressed section name.
	(mach_o_dwarf_sections): Rename as
	mach_o_uncompressed_dwarf_sections.
	(mach_o_compressed_dwarf_sections): New variable.
	(generic_dwarf_section): Rename as
	generic_uncompressed_dwarf_sections.
	(generic_compressed_dwarf_sections): New variable.
	(check_mach_o_dwarf): Save and restore
	mach_o_compressed_dwarf_sections.
	* readelf.c: Add #include for config.h and zlib.h
	(process_section_headers): Recognize compressed section name.
	(uncompress_section_contents): New function.
	(load_debug_section): Call uncompress_section_contents when
	loading a compressed section.
	(display_debug_section): Recognize compressed section name.
binutils/testsuite:
	* binutils-all/objdump.exp: Add test for objdump -s on a file
	with a compressed debug section.  Add test for objdump -W on a
	file that contains a compressed debug section.
	* binutils-all/readelf.exp: Call readelf_compressed_wa_test.
	(readelf_compressed_wa_test): New function.
	* binutils-all/dw2-compressed.S: New file.
	* binutils-all/objdump.W: New file.
	* binutils-all/objdump.s: New file.
	* binutils-all/readelf.wa: New file.
2008-07-10 01:32:23 +00:00
Alan Modra 67f9f80fe8 daily update 2008-07-10 00:00:05 +00:00
Alan Modra 679823d92c daily update 2008-07-09 00:00:05 +00:00
Alan Modra 219dc6c834 daily update 2008-07-08 00:00:05 +00:00
Nick Clifton 329dcd78c6 * elf32-arm.c (arm_type_of_stub): Don't crash on local symbols in
the presence of a PLT.
2008-07-07 16:02:32 +00:00
Alan Modra c29aae594a * bfd.c (bfd_demangle): Always trim off bfd_get_symbol_leading_char. 2008-07-07 11:48:27 +00:00
Alan Modra 67c9104572 daily update 2008-07-07 00:00:05 +00:00
Alan Modra d67fad7bcc daily update 2008-07-06 00:00:05 +00:00
Alan Modra ab8c0151ac daily update 2008-07-05 00:00:06 +00:00
Alan Modra 348e39b942 daily update 2008-07-04 00:00:04 +00:00
Alan Modra 6a8b14f88e daily update 2008-07-03 00:00:06 +00:00
Alan Modra 7382d32a75 * elf32-ppc.c (is_pic_glink_stub): New function.
(ppc_elf_get_synthetic_symtab): Don't generate symbols when
	multiple shared/pie stubs per plt entry.
2008-07-02 13:31:53 +00:00
Alan Modra b8be0b248f daily update 2008-07-02 00:00:05 +00:00
Alan Modra ca12087be2 daily update 2008-07-01 00:00:06 +00:00
Richard Sandiford cb53bf42a0 bfd/
* elf.c (_bfd_elf_get_synthetic_symtab): Increment p by
	bed->s->int_rels_per_ext_rel.
2008-06-30 20:53:06 +00:00
Richard Sandiford 6ba2a41553 bfd/
* syms.c (BSF_SYNTHETIC): New flag.
	* elf.c (_bfd_elf_get_synthetic_symtab): Set it.
	* elf32-ppc.c (ppc_elf_get_synthetic_symtab): Likewise.
	* elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Likewise.
	* bfd-in.h (bfd_asymbol_flavour): Return bfd_target_unknown_flavour
	for synthetic symbols.
	* bfd-in2.h: Regenerate.

opcodes/
	* mips-dis.c (_print_insn_mips): Use bfd_asymbol_flavour to check
	for ELF symbols.
2008-06-30 20:51:58 +00:00
Daniel Jacobowitz 3dccd7b794 * elf32-arm.c (record_arm_to_thumb_glue, record_thumb_to_arm_glue):
Expand comments.
	(arm_map_one_stub): Use | 1 when setting the low bit.
2008-06-30 15:32:51 +00:00
Alan Modra 560083c34b daily update 2008-06-30 00:00:05 +00:00
Andreas Schwab f57718b4c3 * elf32-m68k.c (elf_m68k_relocate_section): Don't ignore existing
addend on _GLOBAL_OFFSET_TABLE_.

ld/testsuite/:
	* ld-m68k/got-1.s: New file.
	* ld-m68k/got-1.d: New dump test.
	* ld-m68k/m68k.exp: Run it.
2008-06-29 12:56:41 +00:00
Alan Modra 240c00d201 daily update 2008-06-29 00:00:05 +00:00
Alan Modra 5d4c9a945e daily update 2008-06-28 00:00:05 +00:00
Alan Modra abf6428858 daily update 2008-06-27 00:00:06 +00:00
Alan Modra 54cde45796 daily update 2008-06-26 00:00:06 +00:00
Daniel Jacobowitz 7413f23fb4 * elf32-arm.c (STUB_ENTRY_NAME): Define.
(arm_thumb_thumb_long_branch_stub): Use bx instead of b.n.
	(arm_pic_long_branch_stub): Mention R_ARM_REL32 instead of
	R_ARM_ABS32.
	(struct elf32_arm_stub_hash_entry): Add output_name.
	(arm_build_one_stub): Move offsets into the offset argument
	of _bfd_final_link_relocate.  Correct offset for
	arm_thumb_arm_v4t_stub_long_branch.
	(elf32_arm_size_stubs): Set stub_entry->output_name.
	(elf32_arm_ouput_plt_map_sym): Rename to elf32_arm_output_map_sym.
	Update all callers.
	(elf32_arm_output_stub_sym): New.
	(arm_map_one_stub): Correct formatting.  Use elf32_arm_output_stub_sym.

	* ld-arm/farcall-arm-arm-be8.d, ld-arm/farcall-arm-arm-pic-veneer.d,
	ld-arm/farcall-arm-arm.d, ld-arm/farcall-arm-thumb-blx-pic-veneer.d,
	ld-arm/farcall-arm-thumb-blx.d, ld-arm/farcall-arm-thumb-pic-veneer.d,
	ld-arm/farcall-arm-thumb.d, ld-arm/farcall-group-size2.d,
	ld-arm/farcall-group.d, ld-arm/farcall-mix.d, ld-arm/farcall-mix2.d,
	ld-arm/farcall-thumb-arm-blx-pic-veneer.d,
	ld-arm/farcall-thumb-arm-blx.d, ld-arm/farcall-thumb-arm.d,
	ld-arm/farcall-thumb-thumb-blx-pic-veneer.d,
	ld-arm/farcall-thumb-thumb-blx.d, ld-arm/farcall-thumb-thumb-m.d,
	ld-arm/thumb2-bl-as-thumb1-bad.d, ld-arm/thumb2-bl-bad.d: Update for
	stub symbols and stub corrections.
2008-06-25 14:28:48 +00:00
Alan Modra 92677fa666 daily update 2008-06-25 00:00:05 +00:00
Alan Modra bd6a792434 daily update 2008-06-24 00:00:07 +00:00
Alan Modra 7c39fb20ea * elf32-spu.c (needs_ovl_stub): Correctly return nonovl_stub for
non-branch insns.
2008-06-19 16:16:58 +00:00
Alan Modra f3c29e8aee * elf32-spu.c (build_stub): Allow wraparound on stub branches.
(allocate_spuear_stubs, build_spuear_stubs): Return value from
	count_stub/build_stub.
	(spu_elf_build_stubs): Correct location of stub reloc error message.
2008-06-19 16:14:15 +00:00
Alan Modra 61daf88db1 daily update 2008-06-19 00:00:05 +00:00
M R Swami Reddy de73c6116d elf32-cr16.c (ELF_MACHINE_ALT1): Define to EM_CR16_OLD. 2008-06-18 11:12:54 +00:00
M R Swami Reddy 1e1d9f39ae elf32-cr16.c (ELF_MACHINE_ALT1): Define to EM_CR16_OLD. 2008-06-18 11:08:19 +00:00
Alan Modra 00a286e012 daily update 2008-06-18 00:00:05 +00:00
Ralf Wildenhues 7a283e077b * configure: Regenerate.
config/
	* override.m4: Use m4_version_prereq throughout.
	(_AC_ARG_VAR_VALIDATE, AC_MSG_FAILURE): Backport from git
	Autoconf: output pwd along with fatal errors, so the right
	config.log file is hinted at more prominently.
	(PARSE_ARGS): Push setting of ac_pwd in this diversion.
	(_GCC_AUTOCONF_VERSION): New, define to 2.59 if not defined.
	(_GCC_AUTOCONF_VERSION_CHECK): New macro, require use of Autoconf
	version _GCC_AUTOCONF_VERSION throughout the tree.
	(m4_wrap): New override, fix for Posix semantics of m4wrap.

binutils/
	* configure: Regenerate.

opcodes/
	* configure: Regenerate.

bfd/
	* configure: Regenerate.

gas/
	* configure: Regenerate.

gprof/
	* configure: Regenerate.

ld/
	* config.in: Regenerate.
	* configure: Regenerate.
2008-06-17 23:14:44 +00:00
Alan Modra 09500eca64 daily update 2008-06-17 00:00:05 +00:00
Alan Modra 99302af9a2 bfd/
* elf32-spu.c (struct spu_link_hash_table): Add extra_stack_space.
	(spu_elf_check_vma): Add extra_stack_space param, copy to htab.
	(spu_elf_auto_overlay): Use it.
	(RECURSE_UNMARK): Define as 0.
	(unmark_overlay_section): Heed RECURSE_UNMARK.
	* elf32-spu.h (spu_elf_check_vma): Update prototype.
ld/
	* emultempl/spuelf.em (extra_stack_space): New variable.
	(gld${EMULATION_NAME}_finish): Pass it to spu_elf_check_vma.
	(PARSE_AND_LIST_LONGOPTS, PARSE_AND_LIST_OPTIONS,
	PARSE_AND_LIST_ARGS_CASES): Handle --extra-stack-space.
	* emultempl/spu_ovl.S: Mask interrupts during dma and update of
	overlay manager structures.
	* emultempl/spu_ovl.o: Regenerate.
2008-06-16 16:16:31 +00:00
Alan Modra c4fbee410b daily update 2008-06-16 00:00:05 +00:00
Alan Modra dea206f512 daily update 2008-06-15 00:00:05 +00:00
Alan Modra 3d45c43596 daily update 2008-06-14 00:00:05 +00:00
Alan Modra 10b0b322be daily update 2008-06-13 00:00:05 +00:00
DJ Delorie ff7eeb894e * common.h (EM_M32C_NEW): Rename to EM_M32C.
(EM_M32C): Rename to EM_M32C_OLD.

* elf32-m32c.c (ELF_MACHINE_ALT1): Define as EM_M32C_OLD.

* readelf.c (guess_is_rela): Add EM_M32C_OLD.
(dump_relocations): Likewise.
(process_section_headers): Likewise.
(is_32bit_abs_reloc): Likewise.
(is_16bit_abs_reloc): Likewise.
2008-06-12 19:49:48 +00:00
Alan Modra f45c4fa2c6 daily update 2008-06-12 00:00:05 +00:00
Alan Modra 06c74433a7 daily update 2008-06-11 00:00:06 +00:00
Alan Modra ceb1cb7f3d daily update 2008-06-10 00:00:05 +00:00
Paul Brook c13bb2ea03 2008-06-09 Paul Brook <paul@codesourcery.com>
bfd/
	* elf32-arm.c (elf32_arm_merge_private_bfd_data): Allow BE8 shared
	libraries.
2008-06-09 15:19:52 +00:00
Daniel Jacobowitz f4ac848464 2008-06-03 Christophe Lyon <christophe.lyon@st.com>
bfd/
	* elf32-arm.c (arm_stub_is_thumb): Define.
	(elf32_arm_final_link_relocate): Handle near mode switching stubs.

	ld/testsuite/
	* ld-arm/farcall-thumb-thumb-m.d: Fix branch type.
	* ld-arm/farcall-thumb-arm.d: Likewise.
2008-06-09 14:53:13 +00:00
Alan Modra 8f4e019755 daily update 2008-06-09 00:00:05 +00:00
Alan Modra cb60bdc1b1 daily update 2008-06-08 00:00:06 +00:00
Alan Modra 6a26771553 * elf32-spu.c (spu_elf_auto_overlay): Add valid area below sp
to stack calculation.
2008-06-07 12:02:47 +00:00
Alan Modra bf37b8e812 daily update 2008-06-07 00:00:05 +00:00
Paul Brook 23684067ca 2008-06-06 Paul Brook <paul@codesourcery.com>
bfd/
	* elf32-arm.c (elf32_arm_merge_private_bfd_data): Reject BE8 input.
2008-06-06 23:20:48 +00:00
Alan Modra 97407faf3d include/
* bfdlink.h (struct bfd_link_info): Add "path_separator".
bfd/
	* elf32-spu.c (spu_elf_auto_overlay): Relax requirement that
	file names be unique.  Specify archive:path in overlay script.
ld/
	* ldlang.c (name_match): New function.
	(unique_section_p, walk_wild_consider_section): Use it here.
	(walk_wild_section_general): And here.
	(archive_path): New function.
	(walk_wild): Match archive:path filespecs.
	(open_input_bfds): Don't load archive:path files.
	* emultempl/spuelf.em (choose_target): Set path_separator.
	* emulparams/elf32_spu.sh: Add ._ea.* sections to ._ea output.
2008-06-06 06:02:00 +00:00
Alan Modra 4636d79789 daily update 2008-06-06 00:00:04 +00:00
Alan Modra 7cfbafbcb4 PR ld/6590
* elf64-ppc.c (ppc_build_one_stub): Correct reloc offsets.
2008-06-05 00:30:09 +00:00
Alan Modra 0111ea7065 daily update 2008-06-05 00:00:06 +00:00
Alan Modra 0f0a5e5880 * elf.c (ignore_section_sym): Don't test section sym value here.
(elf_map_symbols): Instead check zero value here as was done prior
	to 2006-05-26 change.
2008-06-04 14:24:05 +00:00
Nick Clifton 696b7ad299 PR ld/6019
* elf32-avr.c (elf32_avr_relax_section): Handle the case where
        there are no local symbols.
2008-06-04 09:59:08 +00:00
Alan Modra 1f27ab8de1 * elf32-spu.c (get_sym_h): Don't attempt to read global syms.
(process_stubs): Likewise.
	(discover_functions): Don't used cached symbols.
	(maybe_insert_function): Correct condition under which function
	array is realloc'd.
	(mark_functions_via_relocs): Delete unused variable.
2008-06-04 07:07:19 +00:00
Alan Modra 81c41e7378 daily update 2008-06-04 00:00:05 +00:00
Alan Modra bdac03e477 daily update 2008-06-03 00:00:05 +00:00
Alan Modra 29d070cc57 daily update 2008-06-02 00:00:05 +00:00
Alan Modra 0def9f42e1 daily update 2008-06-01 00:00:05 +00:00
Alan Modra 942dc83a61 daily update 2008-05-31 00:00:05 +00:00
Nick Clifton adfef0bd47 PR ld/6511
* elf64-hppa.c (allocate_global_data_opd): Default to using the
        dynamic symbol table for local function names in shared libraries.
2008-05-30 16:13:53 +00:00
Alan Modra 4199b5c406 daily update 2008-05-30 00:00:04 +00:00
Jan Kratochvil 11701589a8 bfd/
* elf.c (assign_file_positions_for_load_sections): Adjust pre-section
	gaps based on VMA and P_VADDR instead of LMA and P_PADDR addresses.
binutils/testsuite/
	* binutils-all/objcopy.exp: Call KEEP_DEBUG_SYMBOLS_AND_TEST_COPY.
	(keep_debug_symbols_and_test_copy): New function.
	(test5, test6): New variables.
2008-05-29 07:07:21 +00:00
Alan Modra 1aafe37a59 daily update 2008-05-29 00:00:05 +00:00
Alan Modra 124b52c6d8 * elf32-spu.c (spu_elf_object_p): New function.
(elf_backend_object_p): Define.
	(build_stub): Correct second word of 8 byte overlay stubs.
	(spu_elf_relocate_section): Formatting.
2008-05-28 08:15:27 +00:00
Alan Modra ec386385a6 daily update 2008-05-28 00:00:05 +00:00
Alan Modra 89f4b705cd daily update 2008-05-27 00:00:05 +00:00
Alan Modra 6860177f5d daily update 2008-05-26 00:00:05 +00:00
Alan Modra fa3c17ae4b daily update 2008-05-25 00:00:06 +00:00
Carlos Eduardo Seo bb864ac122 * elf.c (elfcore_write_register_note): New function.
* elf-bfd.h (elfcore_write_register_note): New prototype.
2008-05-24 16:14:59 +00:00
Alan Modra f773c2d3dd daily update 2008-05-24 00:00:05 +00:00
Nick Clifton da5938a216 bfd/
* elf32-arm.c (arm_type_of_stub): Ignore STT_SECTION symbols.
        (elf32_arm_stub_add_mapping_symbol): Remove.
        (elf32_arm_add_stub): Don't generate mapping symbols. Change
        prototype.
        (elf32_arm_size_stubs): Use new elf32_arm_add_stub
        prototype. Don't generate thumb to arm glue for calls.
        (arm_map_one_stub): Define.
        (elf32_arm_output_arch_local_syms): Generate mapping symbols for
        long calls stubs.

        ld/testsuite/
        * ld-arm/farcall-arm-arm.s: Force function type on 'bar'.
        * ld-arm/farcall-thumb-arm.s: Likewise.
        * ld-arm/farcall-thumb-arm-blx.d: Fix encoding.
        * ld-arm/farcall-thumb-arm.d: Likewise.
        * ld-arm/farcall-thumb-arm-blx-pic-veneer.d: Likewise.
        * ld-arm/arm-elf.exp (armelftests): Add farcall-mix, farcall-mix2,
        farcall-group-default, farcall-group-size2, farcall-section Ignore
        gas warnings in farcall-thumb-arm, farcall-thumb-arm-blx,
        farcall-thumb-arm-blx-pic-veneer.
2008-05-23 13:53:27 +00:00
Alan Modra 19d63e75ac daily update 2008-05-23 00:00:05 +00:00
Alan Modra 7d2d98888a daily update 2008-05-22 00:00:05 +00:00
Nick Clifton 7fb9f789e3 Multi-GOT support for m68k.
bfd/

        * elf32-m68k.c (struct elf_m68k_link_hash_entry: got_entry_key,
        glist): New fields.
        (struct elf_m68k_got_entry_key, struct elf_m68k_got_entry,
        struct elf_m68k_got, struct elf_m68k_bfd2got_entry,
        struct elf_m68k_multi_got): New data structures.
        (struct elf_m68k_link_hash_table: local_gp_p, use_neg_got_offsets_p,
        allow_multigot_p, multi_got_): New fields.
        (elf_m68k_multi_got): New macro.
        (elf_m68k_link_hash_newfunc): Initialize new fields of
        struct elf_m68k_link_hash_entry.
        (elf_m68k_link_hash_table_create): Initialize new fields of
        struct elf_m68k_link_hash_table.
        (elf_m68k_link_hash_table_free): New static function implementing hook.
        (elf_m68k_init_got, elf_m68k_clear_got, elf_m68k_create_empty_got): New
        static functions for struct elf_m68k_got.
        (elf_m68k_init_got_entry_key, elf_m68k_got_entry_hash,
        elf_m68k_got_entry_eq): New static functions for
        struct elf_m68k_got_entry.
        (ELF_M68K_REL_8O_MAX_N_ENTRIES_IN_GOT,
        ELF_M68K_REL_8O_16O_MAX_N_ENTRIES_IN_GOT): New macros.
        (enum elf_m68k_get_entry_howto): New enum.
        (elf_m68k_get_got_entry, elf_m68k_update_got_entry_type,
        elf_m68k_remove_got_entry_type): New static functions for
        struct elf_m68k_got_entry.
        (elf_m68k_add_entry_to_got): New static function.
        (elf_m68k_bfd2got_entry_hash, elf_m68k_bfd2got_entry_eq,
        elf_m68k_bfd2got_entry_del, elf_m68k_get_bfd2got_entry): New static
        functions for struct elf_m68k_bfd2got_entry.
        (struct elf_m68k_can_merge_gots_arg, elf_m68k_can_merge_gots_1,
        elf_m68k_can_merge_gots): New traversal.
        (struct elf_m68k_merge_gots_arg, elf_m68k_merge_gots_1,
        elf_m68k_merge_gots): Ditto.
        (struct elf_m68k_finalize_got_offsets_arg,
        elf_m68k_finalize_got_offsets_1, elf_m68k_finalize_got_offsets): Ditto.
        (struct elf_m68k_partition_multi_got_arg,
        elf_m68k_partition_multi_got_1, elf_m68k_init_symndx2h_1,
        elf_m68k_partition_multi_got): Ditto.
        (elf_m68k_find_got_entry_ptr, elf_m68k_remove_got_entry): New static
        functions.
        (elf_m68k_copy_indirect_symbol): New static function implementing
        a hook.
        (elf_m68k_check_relocs): Update to add entries to multi-GOT.
        (elf_m68k_gc_sweep_hook): Update to remove entries from multi-GOT.
        (elf_m68k_always_size_sections): Assign BFDs to GOTs.
        (elf_m68k_relocate_section): Update to properly handle GOT relocations.
        (elf_m68k_finish_dynamic_symbol): Update to traverse all GOT entries
        of a global symbol.
        (bfd_elf_m68k_set_target_options): New function.
        (bfd_elf32_bfd_link_hash_table_free): Define hook.
        (bfd_elf32_bfd_final_link): Change expansion to bfd_elf_final_link
        to skip generic calculation of GOT offsets.
        (elf_backend_copy_indirect_symbol): Define hook.

        * bfd-in.h (bfd_elf_m68k_set_target_options): Declare function.
        * bfd-in2.h: Regenerate.

        ld/

        * configure.in (--enable-got): New option.  Handle it.
        * configure: Regenerate.
        * config.in: Regenerate.

        * emultempl/m68kelf.em: (got_handling_target_default): New shell
        variable.
        (GOT_HANDLING_TARGET_DEFAULT): New macro.
        (GOT_HANDLING_DEFAULT): New macro.  Initialize it from configure
        option if one was given.
        (got_handling): New static variable.
        (elf_m68k_create_output_section_statements): New static function
        implementing hook.
        (PARSE_AND_LIST_PROLOGUE): Define shell variable.
        (OPTION_GOT): New macro.
        (PARSE_AND_LIST_LONGOPTS): Define shell variable.  Specify
        --got option.
        (got): New linker option.
        (PARSE_AND_LIST_OPTIONS): Define shell variable.  Print help string
        for --got option.
        (PARSE_AND_LIST_ARGS_CASES): Define shell variable.  Handle --got
        option.

        * ld.texinfo: Document --got=<type> option.
        * gen-doc.texi: Add M68K.
        * NEWS: Mention the new feature.

        ld/testsuite/

        * ld-m68k/got-12.s: New file.
        * ld-m68k/got-13.s: New file.
        * ld-m68k/got-14.s: New file.
        * ld-m68k/got-15.s: New file.
        * ld-m68k/got-34.s: New file.
        * ld-m68k/got-35.s: New file.
        * ld-m68k/got-single-12-ok.d: New dump test.
        * ld-m68k/got-single-13-er.d: New dump test.
        * ld-m68k/got-negative-14-ok.d: New dump test.
        * ld-m68k/got-negative-15-er.d: New dump test.
        * ld-m68k/got-negative-12-13-14-34-ok.d: New dump test.
        * ld-m68k/got-negative-12-13-14-35-er.d: New dump test.
        * ld-m68k/got-multigot-14-ok.d: New dump test.
        * ld-m68k/got-multigot-15-er.d: New dump test.
        * ld-m68k/got-multigot-12-13-14-34-35-ok.d: New dump test.
        * ld-m68k/xgot-15.s: New source.
        * ld-m68k/got-xgot-15-ok.d: New test.
        * ld-m68k/got-xgot-12-13-14-15-34-35-ok.d: New test.
        * ld-m68k/m68k.exp: Run new tests.
2008-05-21 12:01:37 +00:00
Nick Clifton 90b5b1a5e4 PR 868
* dwarf2.c (_bfd_dwarf2_cleanup_debug_info): Free memory allocated
        for filenames in function tables and variable tables.
2008-05-21 11:46:42 +00:00
Alan Modra d5a4b93ca6 daily update 2008-05-21 00:00:05 +00:00
Alan Modra 3285cf2c2f daily update 2008-05-20 00:00:06 +00:00
Alan Modra 6ffd79000b PR 2995, PR 6473
* elf.c (_bfd_elf_make_section_from_shdr): Leave lma equal to
	vma when all p_paddr fields are zero and there is more than
	one PT_LOAD header.
2008-05-19 06:06:03 +00:00
Alan Modra 15fdb6a4ef daily update 2008-05-19 00:00:05 +00:00
Alan Modra 9993939649 daily update 2008-05-18 00:00:06 +00:00
Alan Modra 87096d2b26 daily update 2008-05-17 00:00:05 +00:00
Alan Modra 3560d16246 daily update 2008-05-16 00:00:05 +00:00
Nick Clifton 906e58cab5 bfd/
* elf32-arm.c (THM2_MAX_FWD_BRANCH_OFFSET): Define.
        (THM2_MAX_BWD_BRANCH_OFFSET): Define.
        (ARM_MAX_FWD_BRANCH_OFFSET): Define.
        (ARM_MAX_BWD_BRANCH_OFFSET): Define.
        (THM_MAX_FWD_BRANCH_OFFSET): Define.
        (THM_MAX_BWD_BRANCH_OFFSET): Define.
        (arm_long_branch_stub): Define.
        (arm_pic_long_branch_stub): Define.
        (arm_thumb_v4t_long_branch_stub): Define.
        (arm_thumb_thumb_long_branch_stub): Define.
        (arm_thumb_arm_v4t_long_branch_stub): Define.
        (STUB_SUFFIX): Define.
        (elf32_arm_stub_type): Define.
        (elf32_arm_stub_hash_entry): Define.
        (elf32_arm_link_hash_entry): Add stub_cache field.
        (arm_stub_hash_lookup): Define.
        (elf32_arm_link_hash_table): Add stub_hash_table, stub_bfd,
        add_stub_section, layout_sections_again, stub_group, bfd_count,
        top_index, input_list fields.
        (elf32_arm_link_hash_newfunc): Init new field.
        (stub_hash_newfunc): New function.
        (elf32_arm_link_hash_table_create): Init stub_hash_table.
        (elf32_arm_hash_table_free): New function.
        (arm_type_of_stub): New function.
        (elf32_arm_stub_name): New function.
        (elf32_arm_get_stub_entry): New function.
        (elf32_arm_stub_add_mapping_symbol): New function.
        (elf32_arm_add_stub): New function.
        (arm_build_one_stub): New function.
        (arm_size_one_stub): New function.
        (elf32_arm_setup_section_lists): New function.
        (elf32_arm_next_input_section): New function.
        (group_sections): New function.
        (elf32_arm_size_stubs): New function.
        (elf32_arm_build_stubs): New function.
        (bfd_elf32_arm_add_glue_sections_to_bfd): Skip stub sections.
        (bfd_elf32_arm_process_before_allocation): No longer handle
        R_ARM_CALL and R_ARM_THM_CALL.
        (using_thumb_only): New function.
        (elf32_arm_final_link_relocate): Redirect calls to stub if range
        exceeds encoding capabilities.
        (bfd_elf32_bfd_link_hash_table_free): Define.
        * bfd-in.h (R_ARM_max): Fix value to 130.
        (elf32_arm_setup_section_lists): Protype.
        (elf32_arm_next_input_section): Protype.
        (elf32_arm_size_stubs): Protype.
        (elf32_arm_build_stubs): Protype.

        ld/
        * emultempl/armelf.em (build_section_lists): New function.
        (stub_file): Define.
        (need_laying_out): Define.
        (group_size): Define.
        (hook_stub_info): Define.
        (hook_in_stub): New function.
        (elf32_arm_add_stub_section): New function.
        (gldarm_layout_sections_again): New function.
        (gld${EMULATION_NAME}_finish): Replace arm_elf_finish(). Generate
        stubs for long calls if needed.
        (arm_elf_create_output_section_statements): create stub_file bfd.
        (arm_for_each_input_file_wrapper): New function.
        (arm_lang_for_each_input_file): New function.
        (lang_for_each_input_file): Define.
        (PARSE_AND_LIST_PROLOGUE): Add option token OPTION_STUBGROUP_SIZE.
        (PARSE_AND_LIST_LONGOPTS): Add option stub-group-size.
        (PARSE_AND_LIST_OPTIONS): Add option stub-group-size.
        (PARSE_AND_LIST_ARGS_CASES): Add OPTION_STUBGROUP_SIZE case.
        (LDEMUL_FINISH): Update to gld${EMULATION_NAME}_finish.
        * ld/lang.c (print_input_statement): Skip if bfd has
        BFD_LINKER_CREATED.

        ld/testsuite
        * ld-arm/arm-elf.exp (armelftests): Add farcall-arm-arm,
        farcall-arm-arm-pic-veneer, farcall-arm-arm-be8 farcall-arm-thumb,
        farcall-arm-thumb-blx, farcall-arm-thumb-pic-veneer,
        farcall-arm-thumb-blx-pic-veneer, farcall-thumb-thumb,
        farcall-thumb-thumb-pic-veneer, farcall-thumb-thumb-blx,
        farcall-thumb-thumb-m, farcall-thumb-thumb-m-pic-veneer,
        farcall-thumb-thumb-blx-pic-veneer, farcall-thumb-arm,
        farcall-thumb-arm-pic-veneer, farcall-thumb-arm-blx,
        farcall-thumb-arm-blx-pic-veneer.
        Change thumb2-bl-as-thumb1-bad, thumb2-bl-bad.
        * ld-arm/thumb2-bl-as-thumb1-bad.d: Reflects farcall stub
        generation.
        * ld-arm/thumb2-bl-bad.d: Likewise.
        * ld-arm/thumb2-bl-as-thumb1-bad.s: Update comments.
        * ld-arm/thumb2-bl-bad.s: Likewise.
2008-05-15 17:00:15 +00:00
Alan Modra 13aeb833a1 daily update 2008-05-15 00:00:05 +00:00
Ulrich Weigand 86a4952b14 * elf32-ppc.c (ppc_elf_get_synthetic_symtab): Fix memset calls.
* elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Likewise.
2008-05-14 16:00:38 +00:00
Alan Modra 8944f3c277 update dependencies 2008-05-14 06:45:42 +00:00
Alan Modra 468392fb66 * elf32-ppc.c (section_covers_vma): New function.
(ppc_elf_get_synthetic_symtab): New function.
	(bfd_elf32_get_synthetic_symtab): Define.
	* elf64-ppc.c (section_covers_vma): New function.
	(ppc64_elf_get_synthetic_symtab): Generate sym@plt on glink branch
	table entries, and __glink_PLTresolve on resolver stub.
	(ppc64_elf_build_stubs): Rename __glink sym to __glink_PLTresolve.
2008-05-14 02:21:19 +00:00
Alan Modra 1650e108ba daily update 2008-05-14 00:00:05 +00:00
Alan Modra e4c1685bab daily update 2008-05-13 00:00:05 +00:00
Alan Modra 1d483afedd PR 6443
* elf32-ppc.c (MUST_BE_DYN_RELOC): Delete.
	(must_be_dyn_reloc): New function.
	(ppc_elf_check_relocs): Don't set DF_STATIC_TLS for tprel relocs
	in pies.
	(ppc_elf_tls_optimize): Optimise pies.
	(ppc_elf_relocate_section): Use a section symbol rather than no
	symbol if possible for LD->IE TLS sequence, but don't error if
	we must use no symbol.
	* elf64-ppc.c (MUST_BE_DYN_RELOC): As for elf32-ppc.c.
	(must_be_dyn_reloc): Likewise.
	(ppc64_elf_check_relocs): Likewise.
	(ppc64_elf_tls_optimize): Likewise.
	(ppc64_elf_relocate_section): Likewise.
2008-05-12 12:47:47 +00:00
Alan Modra cc5ca406f9 * elf32-spu.c (spu_elf_relocate_section): Rename is_ea to is_ea_sym. 2008-05-12 12:22:53 +00:00
Alan Modra 01cc54cfcd daily update 2008-05-12 00:00:06 +00:00
Alan Modra efd14abde9 daily update 2008-05-11 00:00:06 +00:00
Alan Modra 536d0ff40e * elfcore.h (elf_core_file_p): Warn about core truncation. 2008-05-10 01:58:17 +00:00
Alan Modra 14a720a133 daily update 2008-05-10 00:00:06 +00:00
Alan Modra e8525b24f4 daily update 2008-05-09 00:00:05 +00:00
Alan Modra 311b556392 daily update 2008-05-08 00:00:05 +00:00
Bob Wilson 51c8ebc1d0 bfd/
* elf32-xtensa.c (xtensa_property_section_name): New.
        (xtensa_make_property_section): New.
        (xtensa_get_property_section): Make static.  Do not create a new
        section if it does not exist.
gas/
        * config/tc-xtensa.c (xtensa_create_property_segments): Use
        xtensa_make_property_section instead of xtensa_get_property_section.
        (xtensa_create_xproperty_segments): Likewise.
2008-05-07 23:13:09 +00:00
Alan Modra 8374f9d4b5 bfd/
* elf32-spu.c (spu_elf_special_sections): Add "._ea".
	(spu_elf_relocate_section): Handle relocations against symbols
	defined in ._ea specially.
binutils/
	* embedspu.sh: Take note of R_SPU_PPU32/64 relocs without a symbol,
	and if present, put image in ".data.speelf".  Put program handle
	in ".data.spehandle".
ld/emulparams/
	* elf32_spu.sh (OTHER_SECTIONS): Add "._ea".
	* elf32ppc.sh: If building with spu support, put ".data.spehandle"
	sections at the start of ".data" and provide a symbol to locate
	the directory of embedded spe programs.
ld/testsuite/
	* ld-spu/ear.s: Align various sections.
	* ld-spu/embed.rd: Update.
2008-05-07 14:46:44 +00:00
Alan Modra 567f807c66 daily update 2008-05-07 00:00:05 +00:00
Alan Modra 00d1674256 daily update 2008-05-06 00:00:05 +00:00
Alan Modra 0768d95b23 daily update 2008-05-05 00:00:06 +00:00
Alan Modra e551b91b02 daily update 2008-05-04 00:00:05 +00:00
Daniel Jacobowitz 95720a8625 * elf32-arm.c (elf32_arm_symbian_link_hash_table_create): Use
ARRAY_SIZE.
	(elf32_arm_symbian_plt_sym_val): New.
	(elf_backend_plt_sym_val): Define.
2008-05-03 15:36:34 +00:00
Alan Modra 5c44b38ef6 PR 2995, PR 6473
* elf.c (rewrite_elf_program_header): Rather than clearing
	p_paddr_valid at end, don't set it in the first place.  Delete
	comment no longer relevant.  When not p_paddr_valid, don't set
	paddr from vaddr, and don't set p_vaddr_offset.
2008-05-03 05:18:02 +00:00
Alan Modra 4383e50aa7 daily update 2008-05-03 00:00:05 +00:00
Alan Modra a99f88dcfc daily update 2008-05-02 00:00:05 +00:00
Cary Coutant 3471d59d31 * elf.c (bfd_elf_get_str_section): Fix memory leak caused by
corrupt string table.
2008-05-01 17:06:52 +00:00
Joel Brobecker f12a02c018 * cache.c (cache_bread_1): Renames cache_bread.
(cache_bread): New function.
2008-05-01 15:45:43 +00:00
Alan Modra 889677147d PR 2995, PR 6473
* elf.c (_bfd_elf_make_section_from_shdr): Always set lma from p_paddr.
	(assign_file_positions_for_load_sections): Combine nested "if".
	(copy_elf_program_header): Don't set p_paddr_valid or p_vaddr_offset
	when all header p_paddr fields are zero.
2008-05-01 14:13:58 +00:00
Alan Modra 9fdcc737cc daily update 2008-05-01 00:00:06 +00:00
Alan Modra 9239aded50 missed from 20080414 commit for e500mc support 2008-04-30 06:47:24 +00:00
Alan Modra 7113306b60 daily update 2008-04-30 00:00:06 +00:00
Daniel Jacobowitz 266b05cf76 * elf.c (_bfd_elf_get_dynamic_reloc_upper_bound)
(_bfd_elf_canonicalize_dynamic_reloc): Find dynamic relocations
	even if they are not loaded.
	* elflink.c (_bfd_elf_init_2_index_sections): Set data_index_section
	first.

	* ld-arm/symbian-seg1.s, ld-arm/symbian-seg1.d: New files.
	* ld-arm/arm-elf.exp: Run symbian-seg1.
2008-04-29 11:53:45 +00:00
Alan Modra 2b79f900dc daily update 2008-04-29 00:00:05 +00:00
Alan Modra 03ffc2d0a6 daily update 2008-04-28 00:00:05 +00:00
Alan Modra 2836c85068 daily update 2008-04-27 00:00:05 +00:00
Alan Modra 4c8a3dd20c daily update 2008-04-26 00:00:04 +00:00
Nick Clifton fc2db3b82b * reloc16.c (bfd_coff_reloc16_get_value): Add support for
undefined weak symbols.
2008-04-25 16:02:43 +00:00
Nick Clifton ddeca4680f * po/vi.po: Updated Vietnamese translation. 2008-04-25 14:52:23 +00:00
Alan Modra 55ada6d956 daily update 2008-04-25 00:00:05 +00:00
Alan Modra 7011b767d8 daily update 2008-04-24 00:00:04 +00:00
H.J. Lu 6194aaaba7 bfd/
2008-04-23  Paolo Bonzini  <bonzini@gnu.org>

	* aclocal.m4: Regenerate.
	* configure: Regenerate.

binutils/

2008-04-23  Paolo Bonzini  <bonzini@gnu.org>

	* aclocal.m4: Regenerate.
	* configure: Regenerate.

gas/

2008-04-23  Paolo Bonzini  <bonzini@gnu.org>

	* aclocal.m4: Regenerate.
	* configure: Regenerate.

gold/

2008-04-23  Paolo Bonzini  <bonzini@gnu.org>

	* aclocal.m4: Regenerate.
	* configure: Regenerate.

gprof/

2008-04-23  Paolo Bonzini  <bonzini@gnu.org>

	* aclocal.m4: Regenerate.
	* configure: Regenerate.

ld/

2008-04-23  Paolo Bonzini  <bonzini@gnu.org>

	* aclocal.m4: Regenerate.
	* configure: Regenerate.

opcodes/

2008-04-23  Paolo Bonzini  <bonzini@gnu.org>

	* aclocal.m4: Regenerate.
	* configure: Regenerate.
2008-04-23 16:11:47 +00:00
Alan Modra 4f2658a76f daily update 2008-04-23 00:00:05 +00:00
Cary Coutant 38d6ea5b02 * archive.c (_bfd_write_archive_contents): Fix incorrect use of
ARFMAG.
2008-04-22 00:12:23 +00:00
Alan Modra cc0dcea88a daily update 2008-04-22 00:00:06 +00:00
Nathan Sidwell 131eb6b75e bfd/
* elfxx-mips.c (_bfd_mips_vxworks_adjust_dynamic_symbol): Don't
	set the value of undefined symbols in shared objects.
	(_bfd_mips_vxworks_finish_dynamic_symbol): Clear value for
	undefined symbols unless pointer equality is needed.
ld/testsuite/
	* ld-vxworks/plt-mips1.s: New.
	* ld-vxworks/plt-mips1.d: New.
2008-04-21 17:54:25 +00:00
Alan Modra 0fed330044 daily update 2008-04-21 00:00:05 +00:00
Alan Modra 7785603eaa daily update 2008-04-20 00:00:05 +00:00
Alan Modra ec32d1e818 daily update 2008-04-19 00:00:06 +00:00
Nick Clifton e0c880965c * aix5ppc-core.c: Define macros for the default architecture and
machine for matching core files.
       (xcoff64_core_p): Set the architecture and machine to the default
       values defined in the macros mentioned above.
       * rs6000-core.c: Define macros to determine whether or not the
       core file header uses the core_dumpxx header format.
       (rs6000coff_core_p): Don't match core files that use the
       core_dumpxx header format.
2008-04-18 09:22:24 +00:00
Alan Modra 3f7df0f0f4 daily update 2008-04-18 00:00:06 +00:00
Alan Modra c854ae07ba daily update 2008-04-17 00:00:05 +00:00
Pedro Alves 18c1668c64 * config.bfd (i[3-7]86-*-dicos*, x86_64-*-dicos*): Add. 2008-04-16 18:02:01 +00:00
David S. Miller 739f7f82be bfd/
* reloc.c (BFD_RELOC_SPARC_GOTDATA_HIX22,
	BFD_RELOC_SPARC_GOTDATA_LOX10, BFD_RELOC_SPARC_GOTDATA_OP_HIX22,
	BFD_RELOC_SPARC_GOTDATA_OP_LOX10, BFD_RELOC_SPARC_GOTDATA_OP): New.
	* libbfd.h: Regnerate.
	* bfd-in2.h: Regenerate.
	* elfxx-sparc.c (_bfd_sparc_elf_howto_table): Add entries for
	GOTDATA relocations.
	(sparc_reloc_map): Likewise.
	(_bfd_sparc_elf_check_relocs): Handle R_SPARC_GOTDATA_* like
	R_SPARC_GOT*.
	(_bfd_sparc_elf_gc_sweep_hook): Likewise.
	(_bfd_sparc_elf_relocate_section): Transform R_SPARC_GOTDATA_HIX22,
	R_SPARC_GOTDATA_LOX10, R_SPARC_GOTDATA_OP_HIX22, and
	R_SPARC_GOTDATA_OP_LOX10 into the equivalent R_SPARC_GOT* reloc.
	Simply ignore R_SPARC_GOTDATA_OP relocations.

gas/

	* config/tc-sparc.c (sparc_ip): Add support for gotdata mnemonics
	and relocation generation.
	(tc_gen_reloc): Likewise.

gas/testsuite/

	* gas/sparc/gotops32.d: New.
	* gas/sparc/gotops32.s: Likewise.
	* gas/sparc/gotops64.d: Likewise.
	* gas/sparc/gotops64.s: Likewise.
	* gas/sparc/sparc.exp: Run new gotdata tests.

ld/testsuite/

	* ld-sparc/gotop32.dd: New.
	* ld-sparc/gotop32.rd: Likewise.
	* ld-sparc/gotop32.s: Likewise.
	* ld-sparc/gotop32.sd: Likewise.
	* ld-sparc/gotop32.td: Likewise.
	* ld-sparc/gotop64.dd: Likewise.
	* ld-sparc/gotop64.rd: Likewise.
	* ld-sparc/gotop64.s: Likewise.
	* ld-sparc/gotop64.sd: Likewise.
	* ld-sparc/gotop64.td: Likewise.
	* ld-sparc/sparc.exp: Run new gotdata tests.
2008-04-16 08:51:18 +00:00
Alan Modra 0a9839f3aa daily update 2008-04-16 00:00:06 +00:00
Alan Modra 9380031c3f daily update 2008-04-15 00:00:05 +00:00
Thiemo Seufer c5cb844243 * configure.in: Link with the PIC version of libiberty on
Linux/MIPS hosts.
	* configure: Regenerate.
2008-04-14 19:58:48 +00:00
Alan Modra 19a6653ce8 ppc e500mc support 2008-04-14 11:01:38 +00:00
Alan Modra fc8c3ccedb daily update 2008-04-14 00:00:06 +00:00
Alan Modra 350fc95b2b daily update 2008-04-13 00:00:05 +00:00
Alan Modra 5bcb0e6433 daily update 2008-04-11 00:00:05 +00:00
Alan Modra ce947d23d2 daily update 2008-04-10 00:00:05 +00:00
Alan Modra 9340805735 daily update 2008-04-09 00:00:05 +00:00
Alan Modra 2ec9638bda * elf32-spu.c (spu_elf_build_stubs): Correct error message.
(mark_functions_via_relocs): Remove premature init of symtab_hdr.
	(collect_overlays): Commment typo fix.
2008-04-08 05:48:28 +00:00
Alan Modra a94b9d2d3a * elflink.c (bfd_elf_size_dynamic_sections): Ignore GNU-stack note
in EXEC_P bfds.
2008-04-08 05:41:19 +00:00
Alan Modra 9dcc47943c bfd/
* elf32-spu.c: Include libiberty.h.
	(struct spu_link_hash_table): Add local_stire, overlay_fixed, reserved,
	non_ovly_stub, spu_elf_load_ovl_mgr, spu_elf_open_overlay_script,
	spu_elf_relink, auto_overlay fields.
	(AUTO_OVERLAY, AUTO_RELINK, OVERLAY_RODATA): Define.
	(needs_ovl_stub): Flip test so that call to non-function warning
	is emitted during relocate_section rather than earlier.
	(spu_elf_check_vma): Stash --auto-overlay parameters, and clear
	auto_overlay if no section exceeds local store.
	(struct call_info): Add count, max_depth, is_pasted fields.
	(struct function_info): Add rodata, last_caller, call_count,
	depth, new visit flags.
	(insert_callee): Increment call count.
	(copy_callee): New function.
	(mark_functions_via_relocs): Investigate all reloc types to count
	possible function pointer stubs for --auto-overlay.  Track
	last_caller and increment function call_count.
	(pasted_function): Insert a "call" into call info for pasted section.
	(remove_cycles): Track max depth of calls.  Don't emit call graph
	pruning warning for --auto-overlay.
	(build_call_tree): Don't transfer_calls for --auto-overlay.
	Adjust remove_cycles call.
	(sort_calls, sort_lib, sort_bfds): New functions.
	(struct _mos_param, struct _uos_param, struct _cl_param): New.
	(mark_overlay_section, unmark_overlay_section): New functions.
	(collect_lib_sectios, auto_ovl_lib_functions): New functions.
	(collect_overlays, find_pasted_call): New functions.
	(sum_stack): Deal with is_pasted "calls".  Exit before printing
	when --auto-overlay.
	(spu_elf_auto_overlay): New function.
	(spu_elf_final_link): Call spu_elf_auto_overlay.
	* elf32-spu.h (spu_elf_check_vma): Update prototype.
ld/
	* emultempl/spuelf.em (auto_overlay, auto_overlay_file,
	auto_overlay_fixed, auto_overlay_reserved, my_argc, my_argv): New vars.
	(spu_before_allocation): Warn on --auto-overlay and existing overlays.
	(struct tflist, clean_tmp): Move.
	(new_tmp_file): New function, extracted from..
	(embedded_spu_file): ..here.
	(spu_elf_open_overlay_script, spu_elf_relink): New function.
	(gld${EMULATION_NAME}_finish): Pass a bunch of --auto-overlay params.
	Warn on --auto-overlay and zero local store.
	(gld${EMULATION_NAME}_choose_target): New function to stash argv.
	(OPTION_SPU_AUTO_OVERLAY, OPTION_SPU_AUTO_RELINK,
	OPTION_SPU_OVERLAY_RODATA, OPTION_SPU_FIXED_SPACE,
	OPTION_SPU_RESERVED_SPACE, OPTION_SPU_NO_AUTO_OVERLAY): Define.
	(PARSE_AND_LIST_LONGOPTS): Add entries for new options.
	(PARSE_AND_LIST_OPTIONS): Likewise.
	(PARSE_AND_LIST_ARGS_CASES): Likewise.
	(LDEMUL_CHOOSE_TARGET): Define.
2008-04-08 03:26:54 +00:00
Alan Modra c97929940f daily update 2008-04-08 00:00:05 +00:00
Alan Modra 380814a698 * elf32-spu.c (allocate_spuear_stubs): Ensure _SPUEAR_ symbol
is defined in overlay section before creating a stub.
	(build_spuear_stubs): Likewise.
	(spu_elf_size_stubs, spu_elf_build_stubs): Adjust calls.
2008-04-07 13:07:23 +00:00
Alan Modra 4c6cecf06c daily update 2008-04-07 00:00:05 +00:00
Alan Modra 2344873715 daily update 2008-04-06 00:00:07 +00:00
Alan Modra c4723173a9 daily update 2008-04-04 23:00:06 +00:00
Alan Modra cf65847e18 daily update 2008-04-03 23:00:05 +00:00
Alan Modra 6143242079 daily update 2008-04-02 23:00:06 +00:00
Alan Modra 055ed83b93 * elf32-spu.c (insert_callee): Reorder call list so most recent
call is always first.
	(interesting_section): Move.
	(mark_functions_via_relocs): Fold interesting_section and
	reloc_count tests in callers to here.  Simplify output section
	owner test.
	(discover_functions): Set "gaps" when no symbols and some
	"interesting_section".  Run pasted_function loop for no symbol
	bfds.
	(for_each_node, transfer_calls): New functions.
	(mark_non_root): Adjust to suit for_each_node.
	(call_graph_traverse): Likewise.  Fix memory leak.  Rename to..
	(remove_cycles): ..this.
	(build_call_tree): Use for_each_node and transfer_calls.
	(struct _sum_stack_param): New.
	(sum_stack): Adjust to suit for_each_node.  Return error on
	malloc failure.  Move code to print root node cumulative stack from..
	(spu_elf_stack_analysis): ..here.  Use for_each_node.
2008-04-01 23:52:00 +00:00
Alan Modra 2fd0a91741 daily update 2008-04-01 23:00:07 +00:00
Alan Modra 89a58aeb3e PR 6006
* archive.c (_bfd_slurp_extended_name_table): Change
	ARFMAG[0] to ARFMAG[1].
	(_bfd_construct_extended_name_table): Likewise.
2008-03-31 23:44:47 +00:00
Alan Modra 3ded4dd853 daily update 2008-03-31 23:00:05 +00:00
Daniel Jacobowitz 3a3b672568 * elfxx-mips.c (mips_elf_record_got_page_entry): Update comment.
(_bfd_mips_elf_check_relocs): Update comments.  Always call
	mips_elf_record_got_page_entry for R_MIPS_GOT_PAGE.
2008-03-31 14:02:26 +00:00
Alan Modra 2f49495a1c daily update 2008-03-30 23:00:05 +00:00
Alan Modra c339ea2d7c daily update 2008-03-29 23:00:05 +00:00
Alan Modra 22c426e677 daily update 2008-03-28 23:00:20 +00:00
Nick Clifton a8da640382 Add support for thin archives.
* bfd/archive.c (_bfd_find_nested_archive): New function.
    (get_extended_arelt_filename): Add origin parameter.
    (_bfd_generic_read_ar_hdr_mag): Deal with extended name
    combined with a file offset.
    (append_relative_path): New function.
    (_bfd_get_elt_at_filepos): Deal with external members and
    nested archives.
    (bfd_generic_openr_next_archived_file): Thin archives.
    (bfd_generic_archive_p): Recognize new magic string.
    (adjust_relative_path): New function.
    (_bfd_construct_extended_name_table): Construct extended
    names for thin archive members.
    (_bfd_write_archive_contents): Emit new magic string, skip
    copying files for thin archives.
    * bfd/bfd-in.h (bfd_is_thin_archive): New macro.
    * bfd/bfd.c (struct bfd): New fields for thin archives.
    * bfd/libbfd-in.h (struct areltdata): New field for thin archives.
    * bfd/opncls.c (bfd_close): Delete BFDs for nested archives.
    * binutils/ar.c (make_thin_archive): New global flag.
    (map_over_members): Deal with full pathnames in thin archives.
    (usage, main): Add 'T' option for building thin archives.
    (replace_members): Pass thin archive flag to ar_emul_append.
    * binutils/arsup.c (ar_open): Initialize new flag.
    * binutils/binemul.c (ar_emul_append): Add new parameter for
    flattening nested archives.
    (do_ar_emul_default_append): New function.
    (ar_emul_default_append): Factored out recursive code.
    * binutils/binemul.h (ar_emul_default_append): Add new parameter.
    (struct bin_emulation_xfer_struct): New parameter for ar_append.
    * binutils/dlltool.c (gen_lib_file): Initialize thin archive flag.
    * binutils/emul_aix.c (ar_emul_aix_internal): Add new flatten
    parameter, currently unimplemented.
    All callers changed.
    * binutils/objcopy.c (copy_archive): Preserve thin archive flag.
    * binutils/doc/binutils.texi: Update ar documentation.
    * binutils/testsuite/binutils-all/ar.exp: Add thin archive tests.
    * include/aout/ar.h (ARMAGT): New magic string for thin archives.
2008-03-28 06:49:44 +00:00
Alan Modra 592e58699d daily update 2008-03-27 23:00:05 +00:00
Alan Modra 5bac7f0ac4 daily update 2008-03-26 23:00:05 +00:00
Bernd Schmidt c35e54f424 * elf32-bfin.c (bfin_final_link_relocate): New function, wrapper around
_bfd_final_link_relocate that also handles R_pcrel24 relocs.
	(bfinfdpic_relocate_section, bfin_relocate_section): Use it.
2008-03-26 13:04:23 +00:00
Alan Modra b896398099 daily update 2008-03-25 23:00:04 +00:00
Nathan Sidwell 3348747a87 bfd/
* elf32-arm.c (elf32_arm_final_link_relocate): Skip dynamic relocs
	in vxworks tls_vars sections.
	(allocate_dynrelocs, elf32_arm_size_dynamic_sections): Likewise.
	* elf32-i386.c (allocate_dynrelocs,
	elf_i386_size_dynamic_sections, elf_i386_relocate_section): Likewise.
	* elf32-ppc.c (allocate_dynrelocs, ppc_elf_size_dynamic_sections,
	ppc_elf_relocate_section): Likewise.
	* elf32-sh.c (allocate_dynrelocs, sh_elf_size_dynamic_sections,
	sh_elf_relocate_section): Likewise.
	* elfxx-sparc.c (allocate_dynrelocs,
	_bfd_sparc_elf_size_dynamic_sections,
	_bfd_sparc_elf_relocate_section): Likewise.

	ld/testsuite/
	* ld-vxworks/tls-3.s: New.
	* ld-vxworks/tls-3.d: New.
2008-03-25 18:56:02 +00:00
Alan Modra 11f8f16916 daily update 2008-03-24 23:00:05 +00:00
Alan Modra 274466de1d daily update 2008-03-23 23:00:05 +00:00
Alan Modra a4acfff7de daily update 2008-03-22 23:00:05 +00:00
Alan Modra 6d6a162364 daily update 2008-03-21 23:00:05 +00:00
Adam Nemet a1f3c56ef7 * elf.c (_bfd_elf_print_private_bfd_data): Use bfd_fprintf_vma to
print the values from the dynamic section.
2008-03-21 16:22:51 +00:00
Alan Modra 00659ea749 daily update 2008-03-20 23:00:06 +00:00
Richard Sandiford 51e38d6878 bfd/
* elfxx-mips.c (MIPS_ELF_GNU_GOT1_MASK): New macro.
	(_bfd_mips_elf_finish_dynamic_sections): Use it instead of 0x80000000.

ld/testsuite/
	* ld-mips-elf/elf-rel-got-n64-linux.d: Expect bit 63 rather than
	bit 31 of the second GOT entry to be set.
	* ld-mips-elf/elf-rel-got-n64.d: Likewise.
	* ld-mips-elf/elf-rel-xgot-n64-linux.d: Likewise.
	* ld-mips-elf/elf-rel-xgot-n64.d: Likewise.
2008-03-20 10:52:14 +00:00
Alan Modra c65be8d78a bfd/
* elf32-spu.c (spu_elf_create_sections): Remove output_bfd parameter.
	(spu_elf_find_overlays, spu_elf_size_stubs): Likewise
	(process_stubs, discover_functions, build_call_tree): Likewise.
	(spu_elf_stack_analysis): Likewise.
	(spu_elf_check_vma): Likewise.  Move.
	(struct call_info): Make "is_tail" a bitfield.
	(insert_callee): Clear fun->start and set fun->is_func if we find
	a non-tail call.
	* elf32-spu.h (spu_elf_create_sections): Update prototype.
	(spu_elf_find_overlays, spu_elf_size_stubs, spu_elf_check_vma): Ditto.
ld/
	* emultempl/spuelf.em: Update calls to elf32-spu.c funcs.
2008-03-20 05:35:10 +00:00
Alan Modra 448acd7ae0 daily update 2008-03-19 23:00:05 +00:00
Alan Modra c17284e90a daily update 2008-03-18 23:00:05 +00:00
Alan Modra 0d3ad27f3b daily update 2008-03-17 23:00:05 +00:00
Ralf Wildenhues 58c85be758 * configure.ac: m4_include config/proginstall.m4.
* configure: Regenerate.
config/
        * proginstall.m4: New file, with fixed AC_PROG_INSTALL.
bfd/
        * aclocal.m4: Regenerate.
        * configure: Likewise.
        * Makefile.in: Likewise.
bfd/doc/
        * Makefile.in: Regenerate.
intl/
        * aclocal.m4: Regenerate.
        * configure: Likewise.
gas/
        * aclocal.m4: Regenerate.
        * configure: Likewise.
        * Makefile.in: Likewise.
        * doc/Makefile.in: Likewise.
ld/
        * aclocal.m4: Regenerate.
        * configure: Likewise.
        * Makefile.in: Likewise.
opcodes/
        * aclocal.m4: Regenerate.
        * configure: Likewise.
        * Makefile.in: Likewise.
binutils/
        * aclocal.m4: Regenerate.
        * configure: Likewise.
        * Makefile.in: Likewise.
        * doc/Makefile.in: Likewise.
gprof/
        * aclocal.m4: Regenerate.
        * configure: Likewise.
        * Makefile.in: Likewise.
2008-03-17 22:17:33 +00:00
Alan Modra 23fe836302 daily update 2008-03-16 23:00:05 +00:00
H.J. Lu 41bed6dd8a bfd/
2008-03-16  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/5789
	PR ld/5943
	* elf32-i386.c  (elf_i386_relocate_section): Issue an error
	for R_386_GOTOFF relocaton against undefined hidden/internal
	symbols when building a shared object.

	* elf64-x86-64.c (elf64_x86_64_relocate_section): Issue an
	error for R_X86_64_PC8/R_X86_64_PC16/R_X86_64_PC32
	relocaton against undefined hidden/internal symbols when
	building a shared object.
	(elf64_x86_64_finish_dynamic_symbol): Return FALSE when symbol
	is referenced locally, but isn't defined in a regular file.

ld/testsuite/

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

	PR ld/5789
	PR ld/5943
	* ld-i386/hidden1.d: New.
	* ld-i386/hidden1.s: Likewise.
	* ld-i386/hidden2.d: Likewise.
	* ld-i386/hidden2.s: Likewise.
	* ld-i386/hidden3.d: Likewise.
	* ld-i386/hidden4.s: Likewise.
	* ld-i386/protected1.d: Likewise.
	* ld-i386/protected1.s: Likewise.
	* ld-i386/protected2.d: Likewise.
	* ld-i386/protected2.s: Likewise.
	* ld-i386/protected3.d: Likewise.
	* ld-i386/protected3.s: Likewise.
	* ld-x86-64/hidden1.d: Likewise.
	* ld-x86-64/hidden1.s: Likewise.
	* ld-x86-64/hidden2.d: Likewise.
	* ld-x86-64/hidden2.s: Likewise.
	* ld-x86-64/hidden3.d: Likewise.
	* ld-x86-64/hidden3.s: Likewise.
	* ld-x86-64/protected1.d: Likewise.
	* ld-x86-64/protected1.s: Likewise.
	* ld-x86-64/protected2.d: Likewise.
	* ld-x86-64/protected2.s: Likewise.
	* ld-x86-64/protected3.d: Likewise.
	* ld-x86-64/protected3.s: Likewise.

	* ld-i386/i386.exp: Run hidden1, hidden2, hidden3, protected1,
	protected2 and protected3.
	* ld-x86-64/x86-64.exp: Likewise.
2008-03-16 22:26:23 +00:00