Commit Graph

9498 Commits

Author SHA1 Message Date
Alan Modra 9cd76556c3 daily update 2012-01-22 23:00:05 +00:00
Alan Modra 9886336bcf daily update 2012-01-21 23:00:05 +00:00
Alan Modra 9fc0f57088 daily update 2012-01-20 23:00:05 +00:00
Nick Clifton f1bb16f888 PR binutils/13534
* archive.c (_bfd_ar_sizepad): New function. Correctly install and
	pad the size field in an archive header.
	(_bfd_generic_read_ar_hdr_mag): Use the correct type and scan
	function for the archive size field.
	(bfd_generic_openr_next_archived_file): Likewise.
	(do_slurp_coff_armap): Likewise.
	(_bfd_write_archive_contents): Likewise.
	(_bfd_bsd44_write_ar_hdr): Use the new function.
	(bfd_ar_hdr_from_filesystem): Likewise.
	(_bfd_write_archive_contents): Likewise.
	(bsd_write_armap): Likewise.
	(coff_write_armap): Likewise.
	* archive64.c (bfd_elf64_archive_write_armap): Likewise.
	* bfdio.c (bfd_bread): Use correct type for archive element
	sizes.
	* ar.c (open_inarch): Likewise.
	(extract_file): Likewise.
	* libbfd-in.h (struct areltdata): Use correct types for
	parsed_size and extra_size fields.
	Prototype _bfd_ar_sizepad function.
	* libbfd.h: Regenerate.
2012-01-20 14:42:57 +00:00
Ulrich Weigand 1f20dca58b * elf.c (elfcore_write_prpsinfo): Provide unconditionally.
Return NULL if core file generation is unsupported.
	(elfcore_write_prstatus): Likewise.
	* elf32-arm.c (elf32_arm_nabi_write_core_note): New function.
	(elf_backend_write_core_note): Define.
2012-01-20 09:52:43 +00:00
Alan Modra 3e83742a65 daily update 2012-01-19 23:00:07 +00:00
Tristan Gingold 100fc76795 2012-01-19 Tristan Gingold <gingold@adacore.com>
* pef.c: Add a comment.
	* xsym.c: Likewise.
2012-01-19 11:45:36 +00:00
Alan Modra 868e0b4d84 daily update 2012-01-18 23:00:05 +00:00
Alan Modra 89ee7288fe daily update 2012-01-17 23:00:05 +00:00
Alan Modra 6aa2bb2b1b daily update 2012-01-16 23:00:05 +00:00
Alan Modra 75cd47ede2 * elf32-ppc.c (ppc_elf_write_core_note <NT_PRPSINFO>): Don't leave
trailing garbage in the note.
	* elf64-ppc.c (ppc64_elf_write_core_note <NT_PRPSINFO>): Likewise.
2012-01-16 22:30:19 +00:00
Alan Modra 8a5dcf532e PR ld/13491
* coff-i386.c (coff_i386_rtype_to_howto <R_SECREL32>): Test
	h->root.type not h->type.
	* coff-x86_64.c (coff_amd64_rtype_to_howto <R_AMD64_SECREL>): Likewise.
2012-01-16 08:30:18 +00:00
Alan Modra 70abf05b38 daily update 2012-01-15 23:00:06 +00:00
Alan Modra f326dd16d6 daily update 2012-01-14 23:00:06 +00:00
Alan Modra 99ac642055 daily update 2012-01-13 23:00:11 +00:00
Iain Sandoe 687be931eb handle absolute indirect syms in mach-o
bfd:

	* mach-o.c (bfd_mach_o_build_dysymtab_command): Handle absolute
	indirect symbols.
gas:

	* config/obj-macho.c (obj_mach_o_set_indirect_symbols): Handle
	absolute indirect symbols.

gas/testsuite:

	* gas/mach-o/dysymtab-3.d: New.
	* gas/mach-o/symbols-7.s: New.
2012-01-13 12:59:30 +00:00
Iain Sandoe bb76d9401e order relocs after segments for mach-o
bfd:

	* mach-o.c (bfd_mach_o_write_relocs): Move compuation of relocs file
	position from here... to (bfd_mach_o_build_seg_command): Here.
2012-01-13 12:08:23 +00:00
Alan Modra 4be111d2a0 daily update 2012-01-12 23:00:05 +00:00
Iain Sandoe 50d10658ee add indirect_symbol to mach-o port.
bfd:

	* mach-o.c (bfd_mach_o_count_indirect_symbols): New.
	(bfd_mach_o_build_dysymtab_command): Populate indirect symbol table.
	* mach-o.h (bfd_mach_o_asymbol): Move declaration to start of the
	file. (bfd_mach_o_section): Add indirect_syms field.

gas:

	* config/obj-macho.c (obj_mach_o_set_symbol_qualifier): Switch off
	lazy when the symbol is private_extern.
	(obj_mach_o_indirect_sym): New type.
	(obj_mach_o_indirect_symbol): New.
	(mach_o_pseudo_table): Use obj_mach_o_indirect_symbol.
	(obj_macho_frob_label): Adjust to avoid adding bsyms for locals.
	(obj_macho_frob_label): Likewise.  Adjust external and comm
	symbol tests.
	(obj_mach_o_set_indirect_symbols): New.
	(obj_mach_o_frob_file_after_relocs): New.
	*config/obj-macho.h (obj_frob_file_after_relocs): Define.
	(obj_mach_o_frob_file_after_relocs): Declare.

include/mach-o:

	* loader.h (BFD_MACH_O_INDIRECT_SYM_LOCAL): New.
	(BFD_MACH_O_INDIRECT_SYM_ABS): New

gas/testsuite:

	* gas/mach-o/dysymtab-2.d: New.
	* gas/mach-o/err-syms-4.s: New.
	* gas/mach-o/err-syms-5.s: New.
	* gas/mach-o/err-syms-6.s: New.
	* gas/mach-o/symbols-6-64.d: New.
	* gas/mach-o/symbols-6-64.s: New.
	* gas/mach-o/symbols-6.d: New.
	* gas/mach-o/symbols-6.s: New.
2012-01-12 14:03:12 +00:00
Alan Modra da737a1679 daily update 2012-01-11 23:00:05 +00:00
Iain Sandoe e5081f2f8f bfd:
* mach-o.c (bfd_mach_o_build_seg_command): Separate computation of
	vmsize from filesize.  Don't compute offsets or file sizes for
	zerofill sections.
2012-01-11 15:24:10 +00:00
Iain Sandoe bbd561712c bfd:
* mach-o.c (bfd_mach_o_build_commands): Make the building of each
	command type independent.
2012-01-11 15:06:36 +00:00
Alan Modra 794e51c094 bfd/
* elf64-ppc.c: Define more insns used in plt call stubs.
	(ppc64_elf_brtaken_reloc): Assume isa version 2 or above.
	(ppc64_elf_relocate_section): Likewise.
	(enum ppc_stub_type): Add ppc_stub_plt_call_r2save.
	(struct ppc_link_hash_table): Increase size of stub_count array.
	Add plt_stub_align and plt_thread_safe.
	(ALWAYS_USE_FAKE_DEP, ALWAYS_EMIT_R2SAVE): Define.
	(plt_stub_size, plt_stub_pad): New functions.
	(build_plt_stub): Emit barriers for power7 thread safety.  Don't
	emit needless save of r2.
	(build_tls_get_addr_stub): Adjust params.
	(ppc_build_one_stub): Handle ppc_stub_plt_call_r2save and aligning
	plt stubs.  Adjust build_*plt_stub calls.
	(ppc_size_one_stub): Similarly.
	(ppc64_elf_size_stubs): Accept plt_thread_safe and plt_stub_align
	params.  Choose default for plt_thread_safe based on existence of
	calls to thread creation functions.  Modify plt_call to
	plt_call_r2save when no tocsave reloc found.  Align tail of stub
	sections.
	(ppc64_elf_build_stubs): Align tail of stub sections.  Adjust
	output of stub statistics.
	(ppc64_elf_relocate_section): Handle ppc_stub_plt_call_r2save.
	* elf64-ppc.h (ppc64_elf_size_stubs): Update prototype.
ld/
	* emultempl/ppc64elf.em (PARSE_AND_LIST_PROLOGUE,
	PARSE_AND_LIST_LONGOPTS, PARSE_AND_LIST_OPTIONS,
	PARSE_AND_LIST_ARGS_CASES): Handle --{no-,}plt-thread-safe and
	--{no-,}plt-align.
	(plt_thread_safe, plt_stub_align): New vars.
	(gld${EMULATION_NAME}_after_allocation): Pass them to
	ppc64_elf_size_stubs.  Align stub sections according to plt_stub_align.
	* ld.texinfo: Document new command line options, and an old
	undocumented option.
2012-01-11 09:28:45 +00:00
Alan Modra 6a94ddad87 daily update 2012-01-10 23:00:05 +00:00
H.J. Lu df4f944355 Remove ABI_64_P check on R_X86_64_PCXX
bfd/

2012-01-10  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/13581
	* elf64-x86-64.c (elf_x86_64_relocate_section): Remove ABI_64_P
	check on R_X86_64_PCXX.

ld/testsuite/

2012-01-10  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/13581
	* ld-x86-64/ilp32-4.s: New.
	* ld-x86-64/ilp32-10.d: Likewise.
	* ld-x86-64/ilp32-10.s: Likewise.

	* ld-x86-64/ilp32-4.d: Adjusted.
	* ld-x86-64/ilp32-5.d: Likewise.
	* ld-x86-64/ilp32-5.s: Likewise.

	* ld-x86-64/x86-64.exp: Run ilp32-10.
2012-01-10 20:18:18 +00:00
Tristan Gingold 2a65a88eea 2012-01-10 Tristan Gingold <gingold@adacore.com>
* mach-o.c (bfd_mach_o_build_commands): Avoid uninitialized false
	warning.
2012-01-10 11:59:28 +00:00
Tristan Gingold 660722b0e2 2012-01-10 Tristan Gingold <gingold@adacore.com>
* bfdio.c (bfd_tell): Handle nested archives.
	(bfd_seek): Ditto.
	* cache.c (bfd_cache_lookup_worker): Ditto.
	* archive.c (_bfd_get_elt_at_filepos): Remove code dealing with
	nested archives.
	(bfd_generic_openr_next_archived_file): Likewise.
2012-01-10 11:51:09 +00:00
Alan Modra f6a7d9b8fc daily update 2012-01-09 23:00:05 +00:00
Iain Sandoe b22161d698 add symbol qualifiers for mach-o to bfd/gas
bfd:

	* mach-o.c (bfd_mach_o_bfd_copy_private_symbol_data): Implement.
	(bfd_mach_o_write_symtab): Remove handling for indirect syms.
	(bfd_mach_o_primary_symbol_sort_key): Likewise.
	(bfd_mach_o_cf_symbols): Likewise.
	(bfd_mach_o_sort_symbol_table): Remove.
	(bfd_mach_o_mangle_symbols): Adjust arguments, remove handling
	for indirect and dysymtab counts.  Do the symbol sorting here.
	(bfd_mach_o_build_dysymtab_command): Count the symbol types here.
	Make the indirect symbols a TODO.
	(bfd_mach_o_build_commands): Adjust call to bfd_mach_o_mangle_symbols.
	(bfd_mach_o_make_empty_symbol): Specifically flag unset symbols with
	a non-zero value.
	(bfd_mach_o_read_symtab_symbol): Record the symbol index.
	(bfd_mach_o_read_symtab_symbol): Adjust recording of global status.
	* mach-o.h (mach_o_data_struct): Remove indirect and dysymtab entries.
	(IS_MACHO_INDIRECT): Remove.
	(SYM_MACHO_FIELDS_UNSET, SYM_MACHO_FIELDS_NOT_VALIDATED): New.

gas:

	* config/obj-macho.c (obj_mach_o_weak): Remove.
	(obj_mach_o_common_parse): Set symbol qualifiers.
	(LAZY, REFE): New macros.
	(obj_mach_o_symbol_type): New enum.
	(obj_mach_o_set_symbol_qualifier): New.
	(obj_mach_o_sym_qual): New.
	(mach_o_pseudo_table): Add symbol qualifiers, set indirect_symbol to
	a dummy function.
	(obj_mach_o_type_for_symbol): New.
	(obj_macho_frob_label): New.
	(obj_macho_frob_symbol): New.
	* config/obj-macho.h (S_SET_ALIGN): Amend temorary var name.
	(obj_frob_label, obj_macho_frob_label): Declare.
	(obj_frob_symbol, obj_macho_frob_symbol): Declare.

gas/testsuite:

	* gas/mach-o/err-syms-1.s: New.
	* gas/mach-o/err-syms-2.s: New.
	* gas/mach-o/err-syms-3.s: New.
	* gas/mach-o/symbols-2.d: New.
	* gas/mach-o/symbols-2.s: New.
	* gas/mach-o/symbols-3.s: New.
	* gas/mach-o/symbols-4.s: New.
	* gas/mach-o/symbols-5.d: New.
	* gas/mach-o/symbols-5.s: New.
2012-01-09 10:47:50 +00:00
Alan Modra 61405183f3 daily update 2012-01-08 23:00:06 +00:00
Alan Modra a6cbf2b94a daily update 2012-01-07 23:00:06 +00:00
Alan Modra 6e3571fce8 daily update 2012-01-06 23:00:06 +00:00
Nick Clifton 28a1b4f812 PR binutils/13121
* reloc.c (bfd_generic_lookup_section_flags): Rename 'finfo' to
	'flaginfo' to avoid conflicts with AIX system headers.
2012-01-06 15:44:30 +00:00
Tristan Gingold 36f0a48f6c 2012-01-06 Tristan Gingold <gingold@adacore.com>
* bfdio.c (bfd_bread): Use arelt_size macro.
2012-01-06 11:43:51 +00:00
Tristan Gingold 76d4c1cb5c 2012-01-06 Tristan Gingold <gingold@adacore.com>
* config.bfd (i[3-7]86-*-darwin*): Define targ64_selvecs.
2012-01-06 11:41:28 +00:00
Alan Modra e1c67baeca daily update 2012-01-05 23:00:06 +00:00
Nick Clifton 23e1d3291c Rotate ChangeLogs 2012-01-05 10:09:39 +00:00
Nick Clifton a1c7aafba7 PR ld/12161
* elf32-avr.c (elf32_avr_relax_delete_bytes): Read in relocs if
	necessary.
2012-01-05 09:57:18 +00:00
Jan Kratochvil e85c6a7015 bfd/
Fix zero registers core files when built by gcc-4.7.
	* elf64-x86-64.c (elf_x86_64_write_core_note): Remove variables p and
	size.  Call elfcore_write_note for the local variables.  Remove the
	final elfcore_write_note call.  Add NOTREACHED comments.
2012-01-05 07:50:44 +00:00
Tristan Gingold 15bbba8d0d 2012-01-04 Tristan Gingold <gingold@adacore.com>
* mach-o.c (bfd_mach_o_fat_stat_arch_elt): New function.
	(bfd_mach_o_generic_stat_arch_elt): Adjust.
2012-01-04 13:31:27 +00:00
Tristan Gingold a4e241ca1b 2012-01-04 Tristan Gingold <gingold@adacore.com>
* mach-o.c (bfd_mach_o_fat_member_init): New function.
	(bfd_mach_o_openr_next_archived_file): Reindent.
	Adjust to call bfd_mach_o_fat_member_init.
	(bfd_mach_o_fat_extract): Adjust to call bfd_mach_o_fat_member_init.
2012-01-04 13:22:21 +00:00
Tristan Gingold 71141310f5 2012-01-04 Tristan Gingold <gingold@adacore.com>
* mach-o-x86-64.c (bfd_mach_o_x86_64_swap_reloc_out): Handle
	BFD_RELOC_32, BFD_RELOC_MACH_O_X86_64_PCREL32_1,
	BFD_RELOC_MACH_O_X86_64_PCREL32_2,
	BFD_RELOC_MACH_O_X86_64_PCREL32_4,
	BFD_RELOC_MACH_O_X86_64_BRANCH32,
	BFD_RELOC_MACH_O_X86_64_SUBTRACTOR32,
	BFD_RELOC_MACH_O_X86_64_GOT.
2012-01-04 12:59:23 +00:00
Tristan Gingold 9f4a5bd19a bfd/
2012-01-04  Tristan Gingold  <gingold@adacore.com>

	* mach-o.h (bfd_mach_o_fvmlib_command): New structure.
	(bfd_mach_o_load_command): Add fvmlib field.

	* mach-o.c (bfd_mach_o_read_fvmlib): New function.
	(bfd_mach_o_read_command): Handle fvmlib.

binutils/
2012-01-04  Tristan Gingold  <gingold@adacore.com>

	* od-macho.c (dump_load_command): Handle fvmlib.

include/mach-o/
2012-01-04  Tristan Gingold  <gingold@adacore.com>

	* external.h (mach_o_fvmlib_command_external): New structure.
2012-01-04 10:37:36 +00:00
Tristan Gingold 0b2de10705 bfd/
2012-01-04  Tristan Gingold  <gingold@adacore.com>

	* mach-o.c (bfd_mach_o_convert_architecture): Reindent.
	Decode msubtype for ARM.

include/mach-o/
2012-01-04  Tristan Gingold  <gingold@adacore.com>

	* loader.h: Update copyright year.
	(bfd_mach_o_cpu_subtype): Add ARM subtypes.
2012-01-04 10:25:14 +00:00
Tristan Gingold aeefa1c9a5 bfd/
2012-01-04  Tristan Gingold  <gingold@adacore.com>

	* mach-o.c (bfd_mach_o_get_synthetic_symtab): Add comments.
2012-01-04 10:14:25 +00:00
Tristan Gingold fc55a90257 bfd/
2012-01-04  Tristan Gingold  <gingold@adacore.com>

	* mach-o.h: Reindent header.
	(bfd_mach_o_encryption_info_command): New structure.
	(bfd_mach_o_load_command): Add encryption_info field.

	* mach-o.c (bfd_mach_o_read_encryption_info): New function.
	(bfd_mach_o_read_command): Handle BFD_MACH_O_LC_ENCRYPTION_INFO.
	(bfd_mach_o_read_command): Adjust error message.

binutils/
2012-01-04  Tristan Gingold  <gingold@adacore.com>

	* od-macho.c: Update copyright year.
	(dump_load_command): Handle BFD_MACH_O_LC_ENCRYPTION_INFO.

include/mach-o/
2012-01-04  Tristan Gingold  <gingold@adacore.com>

	* external.h: Update copyright year.
	(mach_o_symtab_command_external): Add comments.
	(mach_o_encryption_info_command_external): New structure.
2012-01-04 09:58:55 +00:00
Tristan Gingold 2ca7691a9b 2012-01-04 Shinichiro Hamaji <shinichiro.hamaji@gmail.com>
* dwarf2.c (_bfd_dwarf2_slurp_debug_info): Factor out the part
	which reads DWARF2 and stores in stash from find_line.
	(find_line) Call _bfd_dwarf2_slurp_debug_info.
	* libbfd-in.h (_bfd_dwarf2_slurp_debug_info): Add declaration.
	* libbfd.h (_bfd_dwarf2_slurp_debug_info): Regenerate.
	* mach-o.c (dsym_subdir): The name of subdir where debug
	information may be stored.
	(bfd_mach_o_lookup_uuid_command): New. Lookup a load command whose
	type is UUID.
	(bfd_mach_o_dsym_for_uuid_p): New. Check if the specified BFD is
	corresponding to the executable.
	(bfd_mach_o_find_dsym): New. Find a debug information BFD in the
	specified binary file.
	(bfd_mach_o_follow_dsym): New. Find a debug information BFD for
	the original BFD.
	(bfd_mach_o_find_nearest_line): Check dSYM files for Mach-O
	executables, dylibs, and bundles.
	(bfd_mach_o_close_and_cleanup): Clean up BFDs for the dSYM file.
	* mach-o.h (dsym_bfd): The BFD of the dSYM file.
2012-01-04 08:44:04 +00:00
Alan Modra 14ae3bb20a daily update 2012-01-03 23:00:05 +00:00
Iain Sandoe 68588f9540 support stabs on mach-o GAS.
bfd:

	* mach-o.c (bfd_mach_o_mangle_symbols): Put in the section index
	for stabd symbols.
	(bfd_mach_o_primary_symbol_sort_key): Adjust for stabs.
	(bfd_mach_o_cf_symbols): Likewise.

gas:

	* config/obj-macho.c (obj_macho_process_stab): New.
	* config/obj-macho.h (OBJ_PROCESS_STAB): Define.
	(obj_macho_process_stab): Declare.
2012-01-03 13:18:48 +00:00
Iain Sandoe f2b324f1f9 correct typo in previous commit.
bfd:

	* mach-o.c (bfd_mach_o_mangle_symbols): Correct typo.
2012-01-03 12:03:10 +00:00