Commit Graph

9943 Commits

Author SHA1 Message Date
Nick Clifton 082d11223c * elf32-m68hc1x.c (elf32_m68hc11_relocate_section): Added code
that enables the linker to offset addresses, when linking against
        symbols from the XGATE processor and vice versa.
2012-07-24 13:23:41 +00:00
Alan Modra 3c6d336c31 daily update 2012-07-24 00:00:05 +00:00
Nick Clifton d86492f2b7 * cisco-core.c (cisco_core_file_failing_command): Make static.
(cisco_core_file_failing_signal): Make static.
2012-07-23 13:19:28 +00:00
Alan Modra 567aa8da1f daily update 2012-07-23 00:00:04 +00:00
Alan Modra e30324cba5 daily update 2012-07-22 00:00:05 +00:00
Alan Modra 130d31771c daily update 2012-07-21 00:00:04 +00:00
Alan Modra 10251a9e8b daily update 2012-07-20 00:00:04 +00:00
Alan Modra f3718686b5 daily update 2012-07-19 00:00:06 +00:00
H.J. Lu 7c960184ff Regenerate bfd-in2.h
* bfd-in2.h: Regenerated.
2012-07-18 17:09:31 +00:00
H.J. Lu c06fc9eb02 Fix a typo in section.c comments
PR binutils/14335
	* section.c: Fix a typo in comments.
2012-07-18 17:08:18 +00:00
Alan Modra a1ad3e4c95 daily update 2012-07-18 00:00:05 +00:00
Alan Modra 2e84b6bfc2 daily update 2012-07-17 00:00:04 +00:00
Alan Modra 6817161ed4 daily update 2012-07-16 00:00:05 +00:00
Alan Modra ed9598823a daily update 2012-07-15 00:00:04 +00:00
Alan Modra 871bd9bf73 daily update 2012-07-14 00:00:04 +00:00
Andreas Krebbel 470b557aaf 2012-07-13 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
* elf64-s390.c: Include elf-s390-common.c.
	(R_390_IRELATIVE): New reloc.
	(elf_s390_reloc_type_lookup): Support R_390_IRELATIVE.
	(RELA_ENTRY_SIZE): New macro.
	(elf_s390_link_hash_entry): New fields ifunc_resolver_address and
	*ifunc_resolver_section.
	(struct plt_entry): New struct.
	(struct elf_s390_obj_tdata): New field local_plt.
	(elf_s390_local_plt): New macro.
	(struct elf_s390_link_hash_table): New field irelifunc.
	(ELF64): New macro.
	(link_hash_newfunc): Initialize new fields.
	(elf_s390_check_relocs): Handle IFUNC symbols.
	(elf_s390_adjust_dynamic_symbol): Don't do anything for IFUNC
	symbols.
	(allocate_dynrelocs): Call s390_elf_allocate_ifunc_dyn_relocs for
	IFUNC symbols.
	(elf_s390_size_dynamic_sections): Handle IFUNC symbols.
	(elf_s390_relocate_section): Likewise.
	(elf_s390_finish_dynamic_symbol): Likewise.
	(elf_s390_finish_dynamic_sections): Handle local IFUNC symbols.
	(elf_s390_finish_ifunc_symbol): New function.
	(elf_s390_gc_sweep_hook): Handle local plt entries.
	(elf_backend_add_symbol_hook): Define.
	* elf32-s390.c: See elf64-s390.c changes.
	* elf-s390-common.c: New file.
	* bfd-in2.h (BFD_RELOC_390_IRELATIVE): New enum field.
	* libbfd.h (BFD_RELOC_390_IRELATIVE): New entry for
	BFD_RELOC_390_IRELATIVE.
	* reloc.c (BFD_RELOC_390_IRELATIVE): Document new relocation.

2012-07-13  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>

	* elf/s390.h (START_RELOC_NUMBERS): Define R_390_IRELATIVE reloc.

2012-07-13  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>

	* emulparams/elf_s390.sh (IREL_IN_PLT): Define.
	* emulparams/elf64_s390.sh (IREL_IN_PLT): Define.
2012-07-13 15:47:27 +00:00
Nick Clifton 2c3fc38946 * aix386-core.c: Remove use of PTR and PARAMS macros.
* archive.c: Likewise.
	* cache.c: Likewise.
	* cisco-core.c: Likewise.
	* coff-alpha.c: Likewise.
	* coff-apollo.c: Likewise.
	* coff-aux.c: Likewise.
	* coff-h8300.c: Likewise.
	* coff-h8500.c: Likewise.
	* coff-i386.c: Likewise.
	* coff-i960.c: Likewise.
	* coff-ia64.c: Likewise.
	* coff-m68k.c: Likewise.
	* coff-m88k.c: Likewise.
	* coff-mcore.c: Likewise.
	* coff-mips.c: Likewise.
	* coff-or32.c: Likewise.
	* coff-ppc.c: Likewise.
	* coff-rs6000.c: Likewise.
	* coff-sh.c: Likewise.
	* coff-sparc.c: Likewise.
	* coff-stgo32.c: Likewise.
	* coff-tic30.c: Likewise.
	* coff-tic4x.c: Likewise.
	* coff-tic54x.c: Likewise.
	* coff-tic80.c: Likewise.
	* coff-w65.c: Likewise.
	* cofflink.c: Likewise.
	* cpu-arc.c: Likewise.
	* cpu-cris.c: Likewise.
	* cpu-h8500.c: Likewise.
	* cpu-i960.c: Likewise.
	* cpu-msp430.c: Likewise.
	* cpu-ns32k.c: Likewise.
	* cpu-powerpc.c: Likewise.
	* cpu-rs6000.c: Likewise.
	* cpu-tic4x.c: Likewise.
	* cpu-w65.c: Likewise.
	* ecoff.c: Likewise.
	* ecofflink.c: Likewise.
	* elf-m10200.c: Likewise.
	* elf32-bfin.c: Likewise.
	* elf32-cris.c: Likewise.
	* elf32-crx.c: Likewise.
	* elf32-fr30.c: Likewise.
	* elf32-frv.c: Likewise.
	* elf32-h8300.c: Likewise.
	* elf32-i960.c: Likewise.
	* elf32-m32c.c: Likewise.
	* elf32-m68hc11.c: Likewise.
	* elf32-m68hc12.c: Likewise.
	* elf32-m68hc1x.c: Likewise.
	* elf32-m68k.c: Likewise.
	* elf32-mcore.c: Likewise.
	* elf32-rl78.c: Likewise.
	* elf32-rx.c: Likewise.
	* elf32-s390.c: Likewise.
	* elf32-vax.c: Likewise.
	* elf64-alpha.c: Likewise.
	* elf64-mmix.c: Likewise.
	* elf64-s390.c: Likewise.
	* elf64-sparc.c: Likewise.
	* elfnn-ia64.c: Likewise.
	* elfxx-mips.c: Likewise.
	* elfxx-sparc.c: Likewise.
	* hash.c: Likewise.
	* hp300hpux.c: Likewise.
	* hppabsd-core.c: Likewise.
	* hpux-core.c: Likewise.
	* i386dynix.c: Likewise.
	* i386linux.c: Likewise.
	* i386lynx.c: Likewise.
	* i386mach3.c: Likewise.
	* i386msdos.c: Likewise.
	* i386os9k.c: Likewise.
	* irix-core.c: Likewise.
	* lynx-core.c: Likewise.
	* m68klinux.c: Likewise.
	* mach-o.h: Likewise.
	* mipsbsd.c: Likewise.
	* netbsd-core.c: Likewise.
	* nlm32-i386.c: Likewise.
	* osf-core.c: Likewise.
	* pc532-mach.c: Likewise.
	* pef.c: Likewise.
	* ppcboot.c: Likewise.
	* ptrace-core.c: Likewise.
	* reloc16.c: Likewise.
	* sco5-core.c: Likewise.
	* som.h: Likewise.
	* sparclinux.c: Likewise.
	* sparclynx.c: Likewise.
	* ticoff.h: Likewise.
	* trad-core.c: Likewise.
	* vms-lib.c: Likewise.
	* xsym.h: Likewise.
2012-07-13 14:22:50 +00:00
Alan Modra f1b8e226de daily update 2012-07-13 00:00:04 +00:00
Alan Modra 8c6d03e711 daily update 2012-07-12 00:00:04 +00:00
Alan Modra cedbfe6825 daily update 2012-07-11 00:00:05 +00:00
Alan Modra c06853bb15 daily update 2012-07-10 00:00:03 +00:00
Alan Modra 1416057852 PR ld/14323
* elflink.c (elf_sort_symbol): Sort by size too.
	(elf_link_add_object_symbols <weakdefs>): Simplify binary search.
	Do not depend on ordering of symbol aliases.  Match largest size.
2012-07-09 08:17:34 +00:00
Alan Modra 2e515f7e37 daily update 2012-07-09 00:00:04 +00:00
Alan Modra 461be744ee daily update 2012-07-08 00:00:06 +00:00
Alan Modra f33353ae21 daily update 2012-07-07 00:00:04 +00:00
Alan Modra 51fe2ab425 daily update 2012-07-06 00:00:04 +00:00
Alan Modra 0a56835690 daily update 2012-07-05 00:00:04 +00:00
H.J. Lu 1c52a64577 Check number of sections overflow
* elf.c (assign_section_numbers): Check if number of sections
	>= SHN_LORESERVE.
	* elfcode.h (elf_object_p): Likewise.
2012-07-04 00:29:52 +00:00
Alan Modra e37fa14346 daily update 2012-07-04 00:00:05 +00:00
Nick Clifton 5f8ebec53d * archive.c (bsd_write_armap): Catch attempts to create an archive
with indicies bigger than 4Gb.
	(coff_write_armap): Likewise.

	* readelf.c (process_archive): Display member indicies when
	dumping index.
2012-07-03 16:25:17 +00:00
H.J. Lu 5a5ed5b0e4 Don't compress empty debug section
2012-07-03  H.J. Lu  <hongjiu.lu@intel.com>

	PR binutils/14319
	* elf.c (_bfd_elf_make_section_from_shdr): Don't compress empty
	debug section.

2012-07-03  H.J. Lu  <hongjiu.lu@intel.com>

	PR binutils/14319
	* binutils-all/compress.exp: Test compress empty debug sections.

	* binutils-all/dw2-empty.S: New file.
2012-07-03 16:06:34 +00:00
H.J. Lu 90c984fc53 Properly handle indirect symbols
2012-07-03  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/3351
	* elflink.c (_bfd_elf_update_dynamic_flags): New.
	(_bfd_elf_merge_symbol): Update both real and indirect symbol
	dynamic flags.
	(_bfd_elf_add_default_symbol): Make the real symbol dynamic if
	the indirect symbol is defined in a shared library.
	(elf_link_add_object_symbols): Likewise.  If the indirect
	symbol has been forced local, don't make the real symbol
	dynamic.
	(elf_link_check_versioned_symbol): Check indirect symbol.
	(elf_link_output_extsym): Use real symbol definition when
	reporting indirect symbol error.  Check version info for
	dynamic versioned symbol.

2012-07-03  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/3351
	* ld-elf/indirect.exp: New file.
	* ld-elf/indirect1a.c: Likewise.
	* ld-elf/indirect1b.c: Likewise.
	* ld-elf/indirect1c.c: Likewise.
	* ld-elf/indirect2.c: Likewise.
	* ld-elf/indirect3.out: Likewise.
	* ld-elf/indirect3a.c: Likewise.
	* ld-elf/indirect3b.c: Likewise.
	* ld-elf/indirect3c.c: Likewise.
	* ld-elf/indirect4.out: Likewise.
	* ld-elf/indirect4a.c: Likewise.
	* ld-elf/indirect4b.c: Likewise.
	* ld-elf/indirect4c.c: Likewise.
2012-07-03 14:44:35 +00:00
Alan Modra 3146fac428 PR ld/14207
* elf.c (assign_file_positions_for_load_sections): Remove assertions
	that only PT_LOAD headers include file header and section headers.
	(assign_file_positions_for_non_load_sections): Similarly don't
	assert PT_GNU_RELRO header does not include file and section headers.
	Compare first section vma rather than PT_LOAD p_vaddr against
	relro_start when looking for PT_LOAD covering PT_GNU_RELRO.  Replace
	abort with assertion.
2012-07-03 05:47:35 +00:00
Alan Modra 3da732519b daily update 2012-07-03 00:00:04 +00:00
Alan Modra 87e0a731c8 * elf32-m32c.c (m32c_elf_check_relocs): Use bfd_make_section
"anyway" variant when creating .plt.
	(m32c_elf_relax_plt_section): Remove redundant test and unused param.
	(m32c_elf_relax_section): Test SEC_LINKER_CREATED before calling
	m32c_elf_relax_plt_section.
	* elfxx-mips.c (mips_elf_create_got_section): Use make anyway variant
	when creating .got and .got.plt.
	(_bfd_mips_elf_final_link): Likewise for .rtproc, and use
	bfd_get_linker_section.
	* sunos.c: Similarly throughout.
2012-07-02 03:02:45 +00:00
Alan Modra 8de28c9ef6 daily update 2012-07-02 00:00:04 +00:00
Andreas Schwab bc823199d1 * elf.c (_bfd_elf_make_section_from_shdr): Fix typo in error
message.
2012-07-01 08:23:13 +00:00
Alan Modra 4a84e058e5 daily update 2012-07-01 00:00:04 +00:00
Alan Modra 9eaa1654f1 daily update 2012-06-30 00:00:05 +00:00
H.J. Lu a040981f62 Return FALSE on unresolvable relocation
* elf64-x86-64.c (elf_x86_64_relocate_section): Return FALSE
	on unresolvable relocation.
2012-06-29 21:54:44 +00:00
H.J. Lu d5abbdf3c1 Simplify global symbol handling
* archive.c (_bfd_compute_and_write_armap): Simplify global
	symbol handling.
2012-06-29 17:36:21 +00:00
Nick Clifton a8c887ddc5 PR ld/14189
* elf32-arm.c (elf32_arm_check_relocs): Do not increment refcount
	for locally bound symbols.
2012-06-29 15:20:30 +00:00
Alan Modra 3d4d4302b9 * section.c (bfd_get_linker_section): New function.
* elf32-arm.c: When retrieving SEC_LINKER_CREATED sections, use
	the above throughout rather than bfd_get_section_by_name.  Use
	bfd_make_section_anyway rather than bfd_make_section when creating
	them.
	* elf32-bfin.c: Likewise.
	* elf32-cr16.c: Likewise.
	* elf32-cris.c: Likewise.
	* elf32-frv.c: Likewise.
	* elf32-hppa.c: Likewise.
	* elf32-i370.c: Likewise.
	* elf32-i386.c: Likewise.
	* elf32-lm32.c: Likewise.
	* elf32-m32c.c: Likewise.
	* elf32-m32r.c: Likewise.
	* elf32-m68k.c: Likewise.
	* elf32-microblaze.c: Likewise.
	* elf32-ppc.c: Likewise.
	* elf32-rl78.c: Likewise.
	* elf32-s390.c: Likewise.
	* elf32-score.c: Likewise.
	* elf32-score7.c: Likewise.
	* elf32-sh.c: Likewise.
	* elf32-tic6x.c: Likewise.
	* elf32-tilepro.c: Likewise.
	* elf32-vax.c: Likewise.
	* elf32-xstormy16.c: Likewise.
	* elf32-xtensa.c: Likewise.
	* elf64-alpha.c: Likewise.
	* elf64-hppa.c: Likewise.
	* elf64-ia64-vms.c: Likewise.
	* elf64-ppc.c: Likewise.
	* elf64-s390.c: Likewise.
	* elf64-sh64.c: Likewise.
	* elf64-sparc.c: Likewise.
	* elf64-x86-64.c: Likewise.
	* elfnn-ia64.c: Likewise.
	* elfxx-mips.c: Likewise.
	* elfxx-sparc.c: Likewise.
	* elfxx-tilegx.c: Likewise.
	* elflink.c: Likewise.
	* elf-vxworks.c: Likewise.
	* elf-m10300.c: Likewise.  Also make use of htab plt, got and
	gotplt shortcuts.
	* bfd-in2.h: Regenerate.
	* elf32-lm32.c (lm32_elf_check_relocs): Use the correct bfd when
	calling create_rofixup_section.
	* elflink.c (bfd_elf_final_link): Simplify test for .dynstr.
2012-06-29 14:46:03 +00:00
Alan Modra 66e17d7f53 * elf32-sh.c (sh_elf_create_dynamic_sections): Don't create .rela
section for bss type sections, except for .rela.bss.
	* elf-m10300.c (_bfd_mn10300_elf_create_dynamic_sections): Likewise.
	* elf32-cr16.c (_bfd_cr16_elf_create_dynamic_sections): Likewise.
	* elf32-lm32.c (lm32_elf_create_dynamic_sections): Likewise.
	* elf32-m32r.c (m32r_elf_create_dynamic_sections): Likewise.
	* elf64-sh64.c (sh64_elf64_create_dynamic_sections): Likewise.
2012-06-29 07:37:50 +00:00
Alan Modra bd2e36c1da daily update 2012-06-29 00:00:05 +00:00
Sean Keys fe54041627 gas/config/
* tc-xgate.h: Defined tc_frob_symbol.
	* tc-xgate.c (xgate_frob_symbol): Wrote new function to mark
	  symbols as being XGATE by setting st_target_internal value.

bfd/
	* elf32-xgate.c (elf32_xgate_add_symbol_hook): Added a temp patch
	  that forces st_target_internal to equal 1, since tc_frob_symbol
	  seems to need adjusting.
2012-06-28 21:36:35 +00:00
Roland McGrath 6034aab8a1 bfd/
* elf32-arm.c (elf32_arm_populate_plt_entry): Use int32_t for
	displacement calculation in nacl_p case.
2012-06-28 16:57:24 +00:00
Nick Clifton 4c6a93d362 * po/vi.po: Updated Vietnamese translation.
* po/uk.po: New Ukranian translation.
	* configure.in (ALL_LINGUAS): Add uk.
	* configure: Regenerate.
2012-06-28 14:36:01 +00:00
Alan Modra d26281a3fc daily update 2012-06-28 00:00:04 +00:00
Alan Modra f7ccda615a daily update 2012-06-27 00:00:05 +00:00
Alan Modra a4fd3de5d3 * elf64-ppc.c (ppc64_elf_next_toc_section): Don't error if input
file has multiple .got/.toc sections and all don't fit in
	current toc group.
2012-06-26 01:40:59 +00:00
Alan Modra e01efe68d4 daily update 2012-06-26 00:00:05 +00:00
Alan Modra 8eb3f24a99 daily update 2012-06-25 00:00:05 +00:00
Alan Modra 5a0196faca daily update 2012-06-24 00:00:04 +00:00
Alan Modra 069db2a3fe daily update 2012-06-23 00:00:04 +00:00
Roland McGrath 62655c7b8b bfd/
* elf.c (assign_file_positions_for_non_load_sections): Define
	__ehdr_start symbol if it's referenced and there's a PT_LOAD
	segment that covers both the file and program headers.

ld/
	* NEWS: Mention __ehdr_start.

ld/testsuite/
	* ld-elf/ehdr_start.s: New file.
	* ld-elf/ehdr_start.d: New file.
2012-06-22 16:52:33 +00:00
Andreas Schwab b70e7a2fdf * elf32-m68k.c (elf_m68k_finish_dynamic_symbol): Don't make
_GLOBAL_OFFSET_TABLE_ and _DYNAMIC absolute.
2012-06-22 09:30:18 +00:00
Alan Modra 27fc25a1a9 * elf64-ppc.c (ppc64_elf_func_desc_adjust): Don't emit out-of-line
save/restore functions when relocatable.  Make "funcs" static.
2012-06-22 05:53:04 +00:00
Alan Modra dedde98681 daily update 2012-06-22 00:00:05 +00:00
Alan Modra e7c706a741 daily update 2012-06-21 00:00:04 +00:00
Alan Modra bc2dbe6f7c daily update 2012-06-20 00:00:04 +00:00
Alan Modra de7a087642 daily update 2012-06-19 00:00:04 +00:00
Hans-Peter Nilsson 51806b9750 * elf32-cris.c (cris_elf_plt_sym_val): Rewrite to work in presence
of merged .got and .got.plt entries.
2012-06-18 06:16:59 +00:00
Alan Modra 466911340d * elf32-arm.c (elf32_arm_final_link_relocate): Correct return value. 2012-06-18 00:46:28 +00:00
Alan Modra 87e7ada21d daily update 2012-06-18 00:00:05 +00:00
Hans-Peter Nilsson 26a48bb3a9 * elf32-cris.c (cris_elf_relocate_section): <R_CRIS_32_IE>
<R_CRIS_32_GOT_TPREL, R_CRIS_16_GOT_TPREL>: Handle references to
	thread common symbols.
2012-06-17 07:28:29 +00:00
Alan Modra e24b8d86fc daily update 2012-06-17 00:00:05 +00:00
Alan Modra c4a8824cca daily update 2012-06-16 00:00:04 +00:00
Alan Modra a9322fc66a daily update 2012-06-15 00:00:05 +00:00
Alan Modra 1d1702fcaa daily update 2012-06-14 00:00:05 +00:00
Nick Clifton 5968a7b800 * elf32-arm.c (bfd_arm_get_mach_from_attributes): New function.
(elf32_arm_object_p): If the machine number could not be deduced
	from the notes, call bfd_arm_get_mach_from_attributes to get the
	number from the attributes.
2012-06-13 10:01:50 +00:00
Alan Modra a8f7b9da8d daily update 2012-06-13 00:00:04 +00:00
H.J. Lu 8981c88a1e Abort if PT_GNU_RELRO segment doesn't fit in PT_LOAD segment
bfd/

	PR bfd/14207
	* elf.c (assign_file_positions_for_non_load_sections): Abort if
	PT_GNU_RELRO segment doesn't fit in PT_LOAD segment.

ld/testsuite/

	PR ld/14207
	* ld-x86-64/x86-64.exp: Run pr14207.

	* ld-x86-64/pr14207.d: New file.
	* ld-x86-64/pr14207.s: Likewise.
2012-06-12 12:55:11 +00:00
Alan Modra 3832a4d892 PR ld/14207
* elf.c (_bfd_elf_map_sections_to_segments): Disregard bss type
	sections at end of PT_LOAD segment when searching for segment
	that contains end of relro extent.
2012-06-12 06:31:06 +00:00
Alan Modra 1bec2beaab daily update 2012-06-12 00:00:04 +00:00
H.J. Lu f3944f7224 Reindent assign_file_positions_for_non_load_sections
* elf.c (assign_file_positions_for_non_load_sections): Reindent.
2012-06-11 16:48:35 +00:00
H.J. Lu be01b34487 Reindent _bfd_elf_map_sections_to_segments
* elf.c (_bfd_elf_map_sections_to_segments): Reindent.
2012-06-11 16:44:02 +00:00
Alan Modra 7b9f845ec7 daily update 2012-06-11 00:00:05 +00:00
Alan Modra a77271fddc daily update 2012-06-10 00:00:04 +00:00
Alan Modra 036746c412 daily update 2012-06-09 00:00:04 +00:00
Alan Modra 5d9636cc4a daily update 2012-06-08 00:00:05 +00:00
Alan Modra 08d5d40f93 daily update 2012-06-07 00:00:05 +00:00
Alan Modra ffbc01ccf0 bfd/
* elflink.c (elf_link_input_bfd): Provide a file symbol for
	each input file with local syms, if the input lacks such.
	(bfd_elf_final_link): Add a file symbol to mark end of locals
	for which we can associate with input files.
	(struct elf_final_link_info): Add filesym_count field.
	(struct elf_outext_info): Add need_second_pass and second_pass.
	(elf_link_output_extsym): Detect symbols defined in the output
	file, emit them on second pass over locals.
ld/testsuite/
Update to suit added STT_FILE symbols.
2012-06-06 10:50:18 +00:00
Alan Modra ae1ac7ef2a daily update 2012-06-06 00:00:05 +00:00
Alan Modra 436ab6fd1b daily update 2012-06-05 00:00:04 +00:00
Jan Kratochvil fe78531dcf bfd/
* bfd-in.h (bfd_elf_bfd_from_remote_memory): Make LEN argument
	of target_read_memory as bfd_size_type.
	* bfd-in2.h: Regenerate.
	* elf-bfd.h (elf_backend_bfd_from_remote_memory): Make LEN
	argument of target_read_memory as bfd_size_type.
	(_bfd_elf32_bfd_from_remote_memory): Likewise.
	(_bfd_elf64_bfd_from_remote_memory): Likewise.
	* elf.c (bfd_elf_bfd_from_remote_memory): Likewise.
	* elfcode.h (NAME(_bfd_elf,bfd_from_remote_memory)): Likewise.

gdb/
	* symfile-mem.c: 3 new gdb_static_assert for target_read_memory_bfd
	parameters.
	(target_read_memory_bfd): New function.
	(symbol_file_add_from_memory): Use it.
2012-06-04 14:35:25 +00:00
Alan Modra bb3a4c1019 daily update 2012-06-04 00:00:03 +00:00
Alan Modra aef36ac1fc PR binutils/13897
* elf.c (elf_find_function): Cache last function sym info.
	(_bfd_elf_maybe_function_sym): Return function size, pass in
	section of interest.
	* elf-bfd.h (struct elf_backend_data <maybe_function_sym>): Likewise.
	(_bfd_elf_maybe_function_sym): Likewise.
	* elf64-ppc.c (ppc64_elf_maybe_function_sym): Likewise.
	(opd_entry_value): Add in_code_sec param.  Revert caching code.
	Return -1 if in_code_sec and function found in wrong section.
	Update all calls.
2012-06-03 04:08:07 +00:00
Alan Modra e8403b7398 daily update 2012-06-03 00:00:02 +00:00
Alan Modra 8c937023fb daily update 2012-06-02 00:00:02 +00:00
Jan Kratochvil 5299c1c488 bfd/
* bfd-in.h (bfd_elf_bfd_from_remote_memory): Make LEN argument
	of target_read_memory as size_t.
	* bfd-in2.h: Regenerate.
	* elf-bfd.h (elf_backend_bfd_from_remote_memory): Make LEN
	argument of target_read_memory as size_t.
	(_bfd_elf32_bfd_from_remote_memory): Likewise.
	(_bfd_elf64_bfd_from_remote_memory): Likewise.
	* elf.c (bfd_elf_bfd_from_remote_memory): Likewise.
	* elfcode.h (NAME(_bfd_elf,bfd_from_remote_memory)): Likewise.

gdb/
	* target.c (target_read_memory): Make LEN argument as size_t.
	* target.h (target_read_memory): Likewise.
2012-06-01 16:37:59 +00:00
Alan Modra ee1e4edefe PR binutils/13897
* elf64-ppc.c (opd_entry_value): Rewrite cache code.
2012-06-01 12:26:55 +00:00
Alan Modra 0acc1ee90a daily update 2012-06-01 00:00:03 +00:00
Alan Modra 5189aad2e6 daily update 2012-05-30 00:00:03 +00:00
Tom Tromey 6f0c7050fc bfd/
* opncls.c (bfd_fopen): Always close fd on failure.
	(bfd_fdopenr): Likewise.
gdb/
	* symfile.c (symfile_bfd_open): Don't close desc if bfd_fopen
	fails.
	* solib.c (solib_bfd_fopen): Don't close fd if bfd_fopen fails.
	* exec.c (exec_file_attach): Don't close scratch_chan if bfd_fopen
	fails.
	* dwarf2read.c (try_open_dwo_file): Don't close fd if bfd_fopen
	fails.
2012-05-29 14:23:40 +00:00
Alan Modra 431719081d daily update 2012-05-29 00:00:03 +00:00
Alan Modra 55a189b0c9 daily update 2012-05-28 00:00:03 +00:00
Alan Modra f5eda4731e PR ld/14170
* elflink.c (_bfd_elf_merge_symbol): When a symbol defined in
	a dynamic library finds a new instance with non-default
	visibility in a regular object, correctly handle symbols
	already on the undefs list and undo dynamic symbol state when
	the new symbol is hidden or internal.
2012-05-27 13:55:45 +00:00
Alan Modra 887b61ae53 daily update 2012-05-27 00:00:03 +00:00
Alan Modra e7c7fd1c22 daily update 2012-05-26 00:00:04 +00:00
H.J. Lu bbf96e4eef Don't use dynamic_sec_flags on PLT .eh_frame section
* elf32-i386.c (elf_i386_create_dynamic_sections): Don't use
	dynamic_sec_flags to create PLT .eh_frame section.
	* elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Likewise.
2012-05-25 16:20:15 +00:00
Alan Modra 9a2a56cc5a PR ld/13909
* elf-eh-frame.c (_bfd_elf_eh_frame_present): New function.
	(_bfd_elf_maybe_strip_eh_frame_hdr): Use it here.
	* elf-bfd.h (_bfd_elf_eh_frame_present): Declare.
	* elflink.c (bfd_elf_size_dynamic_sections): Let the backend
	size dynamic sections before stripping eh_frame_hdr.
	(bfd_elf_gc_sections): Handle multiple .eh_frame sections.
	* elf32-ppc.c (ppc_elf_size_dynamic_sections): Drop glink_eh_frame
	if no other .eh_frame sections exist.
	* elf64-ppc.c (ppc64_elf_size_stubs): Likewise.
	* elf32-i386.c (elf_i386_create_dynamic_sections): Don't size
	or alloc plt_eh_frame here..
	(elf_i386_size_dynamic_sections): ..do it here instead.  Don't
	specially keep sgotplt, iplt, tgotplt, sdynbss for symbols.
	(elf_i386_finish_dynamic_sections): Check plt_eh_frame->contents
	before writing plt offset.
	* elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Don't size
	or alloc plt_eh_frame here..
	(elf_x86_64_size_dynamic_sections): ..do it here instead.
	(elf_x86_64_finish_dynamic_sections): Check plt_eh_frame->contents
	before writing plt offset.
2012-05-25 01:12:20 +00:00
Alan Modra 3161ca4f50 daily update 2012-05-25 00:00:04 +00:00
Alan Modra 4bbe044a20 PR ld/14158
* elf64-ppc.c (ppc64_elf_size_stubs): Round up glink_eh_frame
	size to output section alignment.
	(ppc64_elf_build_stubs): Likewise, and extend last FDE to cover.
2012-05-24 06:20:52 +00:00
Alan Modra 9a8b4da9b4 daily update 2012-05-24 00:00:04 +00:00
Alan Modra 89b2bec8ac * elf-eh-frame.c (_bfd_elf_maybe_strip_eh_frame_hdr): Handle
BFDs with multiple .eh_frame sections.
2012-05-23 04:38:08 +00:00
Alan Modra 259b427a20 PR ld/13909
* elflink.c (bfd_elf_discard_info): Don't ignore dynamic BFDs.
2012-05-23 04:35:31 +00:00
H.J. Lu e4de50d447 Revert the change for PR ld/r13909
bfd/

	PR ld/13909
	* elf32-i386.c (elf_i386_create_dynamic_sections): Revert the
	last change.
	* elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Likewise.

ld/testsuite/

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

	PR ld/13909
	* ld-i386/i386.exp: Revert the last change.
	* ld-x86-64/x86-64.exp: Likewise.

	* ld-i386/dummy.s: Removed.
	* ld-i386/pr13909.d: Likewise.
	* ld-x86-64/pr13909.d: Likewise.
2012-05-22 15:55:01 +00:00
Alan Modra 7e01508c91 * elflink.c (bfd_elf_discard_info): Look for next .eh_frame if
first one is zero size or discarded.
	* elf32-ppc.c (ppc_elf_size_dynamic_sections): Set most of
	glink_eh_frame contents here..
	(ppc_elf_finish_dynamic_sections): ..rather than here.  Just set
	offset to .glink.
2012-05-22 14:58:15 +00:00
H.J. Lu 5d4f7eb2f0 Create PLT eh_frame section if there is .eh_frame section
bfd/

	PR ld/13909
	* elf32-i386.c (elf_i386_create_dynamic_sections): Create PLT
	eh_frame section if there is an input .eh_frame section.
	* elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Likewise.

ld/testsuite/

	PR ld/13909
	* ld-i386/i386.exp: Run pr13909.
	* ld-x86-64/x86-64.exp: Likewise.

	* ld-i386/dummy.s: New file.
	* ld-i386/pr13909.d: Likewise.
	* ld-x86-64/pr13909.d: Likewise.
2012-05-22 14:46:44 +00:00
H.J. Lu 2fe0fd0638 Always create PLT eh_frame section for i386/x86-64
bfd/

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

	PR ld/14105
	* elf32-i386.c (elf_i386_create_dynamic_sections): Always
	create PLT eh_frame section with SEC_LINKER_CREATED.
	* elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Likewise.

ld/testsuite/

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

	PR ld/14105
	* ld-elf/eh4.d: Add PLT eh_frame.

	* ld-i386/i386.exp: Run pr12570a and pr12570b.
	* ld-x86-64/x86-64.exp: Likewise.

	* ld-i386/pr12570a.d: New file.
	* ld-i386/pr12570a.s: Likewise.
	* ld-i386/pr12570b.s: Likewise.
	* ld-i386/pr12570b.s: Likewise.
	* ld-x86-64/pr12570a.d: Likewise.
	* ld-x86-64/pr12570a.s: Likewise.
	* ld-x86-64/pr12570b.d: Likewise.
	* ld-x86-64/pr12570b.s: Likewise.
2012-05-22 14:05:21 +00:00
Alan Modra 90061c3348 * elflink.c (bfd_elf_discard_info): Handle multiple .eh_frame
sections attached to a BFD.
	* section.c (bfd_get_section_by_name): Rewrite description.
	(bfd_get_next_section_by_name): New function.
	* bfd-in2.h: Regenerate.
2012-05-22 12:09:26 +00:00
Alan Modra 99fd6accc4 daily update 2012-05-22 00:00:04 +00:00
Andreas Schwab 8bbeae90c5 * elf32-m68k.c (elf_m68k_grok_prstatus): New function.
(elf_m68k_grok_psinfo): New function.
(elf_backend_grok_prstatus): Define.
(elf_backend_grok_psinfo): Define.
2012-05-21 08:17:15 +00:00
Alan Modra 2a2e1f8e32 daily update 2012-05-21 00:00:04 +00:00
Alan Modra 6cb7aad2a0 daily update 2012-05-20 00:00:05 +00:00
Maciej W. Rozycki a44acb1ed2 * elf64-mips.c (elf_backend_got_header_size): Correct definition.
* elfxx-mips.c (_bfd_mips_elf_adjust_dynamic_symbol): Use the ELF
	backend's GOT header size instead of hardcoding it.
2012-05-19 19:30:45 +00:00
Maciej W. Rozycki 751c1fe7ea * elf32-vax.c (elf_vax_relocate_section)
<R_VAX_8, R_VAX_16, R_VAX_32>: Don't check if info->shared again.
2012-05-19 19:27:01 +00:00
Maciej W. Rozycki ddd74d3cef * elf32-vax.c (elf_vax_relocate_section)
<R_VAX_8, R_VAX_16, R_VAX_32>: Use section flags rather than
	its name as the check for text sections.
2012-05-19 19:23:24 +00:00
Maciej W. Rozycki b0189df033 * elf64-mips.c (mips_elf64_be_swap_reloc_out): Also make sure
the third reloc offset is the same as the first.
2012-05-19 19:13:56 +00:00
Alan Modra 94caa96637 bfd/
* elf32-ppc.h (has_vle_insns, is_ppc_vle): Delete.
	(has_tls_reloc, has_tls_get_addr_call): Move back to..
	* elf32-ppc.c: ..here.
	(ppc_elf_section_flags, elf_backend_section_flags): Delete.
	(ppc_elf_modify_segment_map): Use ELF sh_flags to detect VLE sections.
opcodes/
	* ppc-dis.c: Don't include elf32-ppc.h, do include elf/ppc.h.
	(get_powerpc_dialect): Detect VLE sections from ELF sh_flags.
ld/testsuite/
	* ld-powerpc/vle.ld: New.
	* ld-powerpc/powerpc.exp (vle reloc tests): Link using vle.ld.
2012-05-19 06:58:48 +00:00
Alan Modra 5e1b447d5a daily update 2012-05-19 00:00:05 +00:00
H.J. Lu 220cf8092f Don't make _DYNAMIC/_GLOBAL_OFFSET_TABLE_ absolute
bfd/

	* elf32-i386.c (elf_i386_finish_dynamic_symbol): Don't make
	_DYNAMIC nor _GLOBAL_OFFSET_TABLE_ absolute.
	* elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.

ld/testsuite/

	* ld-i386/tlsdesc-nacl.rd: Update for dynamic sym changes.
	* ld-i386/tlsdesc.rd: Likewise.
	* ld-i386/tlsgdesc-nacl.rd: Likewise.
	* ld-i386/tlsgdesc.rd: Likewise.
	* ld-i386/tlsnopic-nacl.rd: Likewise.
	* ld-i386/tlsnopic.rd: Likewise.
	* ld-i386/tlspic-nacl.rd: Likewise.
	* ld-i386/tlspic.rd: Likewise.
	* ld-x86-64/tlsdesc-nacl.rd: Likewise.
	* ld-x86-64/tlsdesc.rd: Likewise.
	* ld-x86-64/tlsgdesc-nacl.rd: Likewise.
	* ld-x86-64/tlsgdesc.rd: Likewise.
	* ld-x86-64/tlspic-nacl.rd: Likewise.
	* ld-x86-64/tlspic.rd: Likewise.
2012-05-18 22:26:18 +00:00
Roland McGrath 3a11e31eb2 * archive.c (_bfd_generic_read_ar_hdr_mag): Fix last change so as
not to clobber the ar_fmag field stored in ARED->arch_header.
2012-05-18 16:38:22 +00:00
Pedro Alves 2a0bfc8d16 2012-05-18 Pedro Alves <palves@redhat.com>
* mach-o.h: Don't include sysdep.h.
2012-05-18 15:11:53 +00:00
Nick Clifton 0bee45d9e7 PR 14072
* bfd-in.h: Check for PACKAGE or PACKAGE_VERSION before
	complaining about config.h not having been included.
	* bfd-in2.h: Regenerate.
2012-05-18 10:29:12 +00:00
Alan Modra 625af9a0b3 daily update 2012-05-18 00:00:05 +00:00
Andreas Schwab f2c621e45e bfd/
* aclocal.m4: Regenerate.
* Makefile.in: Regenerate.

binutils/
* aclocal.m4: Regenerate.
* configure: Regenerate.
* config.in: Regenerate.
* Makefile.in: Regenerate.

gas/
* aclocal.m4: Regenerate.
* configure: Regenerate.
* Makefile.in: Regenerate.
2012-05-17 22:23:42 +00:00
Nick Clifton df7b86aa4c PR 14072
* configure.in: Add check that sysdep.h has been included before
	any system header files.
	* configure: Regenerate.
	* config.in: Regenerate.
	* sysdep.h: Generate an error if included before config.h.
	* alpha-opc.c: Include sysdep.h before any other header file.
	* alpha-dis.c: Likewise.
	* avr-dis.c: Likewise.
	* cgen-opc.c: Likewise.
	* cr16-dis.c: Likewise.
	* cris-dis.c: Likewise.
	* crx-dis.c: Likewise.
	* d10v-dis.c: Likewise.
	* d10v-opc.c: Likewise.
	* d30v-dis.c: Likewise.
	* d30v-opc.c: Likewise.
	* h8500-dis.c: Likewise.
	* i370-dis.c: Likewise.
	* i370-opc.c: Likewise.
	* m10200-dis.c: Likewise.
	* m10300-dis.c: Likewise.
	* micromips-opc.c: Likewise.
	* mips-opc.c: Likewise.
	* mips61-opc.c: Likewise.
	* moxie-dis.c: Likewise.
	* or32-opc.c: Likewise.
	* pj-dis.c: Likewise.
	* ppc-dis.c: Likewise.
	* ppc-opc.c: Likewise.
	* s390-dis.c: Likewise.
	* sh-dis.c: Likewise.
	* sh64-dis.c: Likewise.
	* sparc-dis.c: Likewise.
	* sparc-opc.c: Likewise.
	* spu-dis.c: Likewise.
	* tic30-dis.c: Likewise.
	* tic54x-dis.c: Likewise.
	* tic80-dis.c: Likewise.
	* tic80-opc.c: Likewise.
	* tilegx-dis.c: Likewise.
	* tilepro-dis.c: Likewise.
	* v850-dis.c: Likewise.
	* v850-opc.c: Likewise.
	* vax-dis.c: Likewise.
	* w65-dis.c: Likewise.
	* xgate-dis.c: Likewise.
	* xtensa-dis.c: Likewise.
	* rl78-decode.opc: Likewise.
	* rl78-decode.c: Regenerate.
	* rx-decode.opc: Likewise.
	* rx-decode.c: Regenerate.

	* configure.in: Add check that sysdep.h has been included before
	any system header files.
	* configure: Regenerate.
	* config.in: Regenerate.
	* sysdep.h: Generate an error if included before config.h.

	* configure.in: Add check that sysdep.h has been included before
	any system header files.
	* configure: Regenerate.
	* config.in: Regenerate.
	* aclocal.m4: Regenerate.
	* bfd-in.h: Generate an error if included before config.h.
	* sysdep.h: Likewise.
	* bfd-in2.h: Regenerate.
	* compress.c: Remove #include "config.h".
	* plugin.c: Likewise.
	* elf32-m68hc1x.c: Include sysdep.h before alloca-conf.h.
	* elf64-hppa.c: Likewise.
	* som.c: Likewise.
	* xsymc.c: Likewise.

	* configure.in: Add check that sysdep.h has been included before
	any system header files.
	* configure: Regenerate.
	* config.in: Regenerate.

	* configure.in: Add check that sysdep.h has been included before
	any system header files.
	* configure: Regenerate.
	* config.in: Regenerate.
	* aclocal.m4: Regenerate.
	* Makefile.am: Use wrappers around C files generated by flex.
	* Makefile.in: Regenerate.
	* doc/Makefile.in: Regenerate.
	* itbl-lex-wrapper.c: New file.
	* config/bfin-lex-wrapper.c: New file.
	* cgen.c: Include as.h before setjmp.h.
	* config/tc-dlx.c: Include as.h before any other header.
	* config/tc-h8300.c: Likewise.
	* config/tc-lm32.c: Likewise.
	* config/tc-mep.c: Likewise.
	* config/tc-microblaze.c: Likewise.
	* config/tc-mmix.c: Likewise.
	* config/tc-msp430.c: Likewise.
	* config/tc-or32.c: Likewise.
	* config/tc-tic4x.c: Likewise.
	* config/tc-tic54x.c: Likewise.
	* config/tc-xtensa.c: Likewise.

	* configure.in: Add check that sysdep.h has been included before
	any system header files.
	* configure: Regenerate.
	* config.in: Regenerate.
	* unwind-ia64.h: Include config.h.
2012-05-17 15:13:28 +00:00
Alan Modra 2633a79cc0 * elf.c (ignore_section_sym): Correct comment. Don't return
true for absolute section.
	(elf_map_symbols): Move stray comment.  Adjust for above change.
	Don't discard global section symbols.
2012-05-17 06:29:02 +00:00
Alan Modra ab6dce2336 bfd/
* elf32-ppc.c (ppc_elf_finish_dynamic_symbol): Don't make _DYNAMIC,
	_GLOBAL_OFFSET_TABLE_ or _PROCEDURE_LINKAGE_TABLE_ absolute.
	* elf64-ppc.c (ppc64_elf_finish_dynamic_symbol): Don't make _DYNAMIC
	absolute.
ld/testsuite/
	* ld-powerpc/tlsso.r: Update for dynamic sym changes.
	* ld-powerpc/tlsso32.d: Likewise.
	* ld-powerpc/tlsso32.r: Likewise.
	* ld-powerpc/tlstocso.r: Likewise.
2012-05-17 02:43:36 +00:00
Alan Modra e1dad58d73 bfd/
* elf32-ppc.c (has_tls_reloc, has_tls_get_addr_call, has_vle_insns,
	is_ppc_vle): Move to..
	* elf32-ppc.h: ..here, making is_ppc_vle a macro.
opcodes/
	* ppc_dis.c: Don't include elf/ppc.h.
2012-05-17 02:24:50 +00:00
Alan Modra 0b6c6df481 daily update 2012-05-17 00:00:06 +00:00
Nick Clifton a0f49396fd * bfd-in.h (bfd_get_section_name, bfd_get_section_vma,
bfd_get_section_lma, bfd_get_section_alignment,
	bfd_get_section_flags, bfd_get_section_userdata): Rewrite macros
	in order to use the `bfd' argument.
	* bfd-in2.h: Regenerate.
	* elf-vxworks.c (elf_vxworks_finish_dynamic_entry): Pass proper `bfd'
	as the first argument for `bfd_get_section_alignment'.
	* elf32-arm.c (create_ifunc_sections): Likewise, for
	`bfd_set_section_alignment'.
	* elf32-m32r.c (m32r_elf_relocate_section): Likewise, for
	`bfd_get_section_name'.
	* elf32-microblaze.c (microblaze_elf_relocate_section): Likewise.
	* elf32-ppc.c (ppc_elf_size_dynamic_sections): Likewise.
	(ppc_elf_relocate_section): Likewise.
	* elf64-mmix.c (mmix_final_link_relocate): Likewise, for
	`bfd_get_section_vma'.
	* elf64-ppc.c (create_linkage_sections): Likewise, for
	`bfd_set_section_alignment'.

	* emultempl/m68hc1xelf.em (hook_in_stub): Pass proper `bfd'
	as the first argument for `bfd_get_section_name'.

	* config/tc-alpha.c (maybe_set_gp): Pass proper `bfd'
	as the first argument for `bfd_get_section_vma'.
2012-05-16 16:38:29 +00:00
Nick Clifton 40551fb82e PR 13503
* reloc.c: Rename BFD_RELOC_AVR_8_HHI to BFD_RELOC_AVR_8_HLO.
	* bfd-in2.h: Regenerate.
	* libbfd.h: Regenrate.
	* elf32-avr.c (elf_avr_howto_table): Rename R_AVR_8_HHI8 to
	R_AVR_8_HLO8.
	(avr_reloc_map): Ditto.

	* config/tc-avr.c (avr_cons_fix_new): Rename R_AVR_8_HHI8 to
	R_AVR_8_HLO8.
	(exp_mod_data) Ditto. And replace "hhi8" with "hlo8".
	(md_apply_fix): Rename BFD_RELOC_AVR_8_HHI to BFD_RELOC_AVR_8_HLO.

	* avr.h (RELOC_NUMBERS): Rename R_AVR_8_HHI8 to R_AVR_8_HLO8.
2012-05-16 14:52:16 +00:00
Nick Clifton 691bf19c4e PR binutils/13558
* bfd/aout-cris.c: Include sysdep.h before bfd.h.
	* bfd/aout-ns32k.c: Likewise.
	* bfd/aout-sparcle.c: Likewise.
	* bfd/aout0.c: Likewise.
	* bfd/bfd-in2.h: Likewise.
	* bfd/coff-stgo32.c: Likewise.
	* bfd/cpu-lm32.c: Likewise.
	* bfd/cpu-microblaze.c: Likewise.
	* bfd/cpu-score.c: Likewise.
	* bfd/cpu-tilegx.c: Likewise.
	* bfd/cpu-tilepro.c: Likewise.
	* bfd/elf32-lm32.c: Likewise.
	* bfd/elf32-microblaze.c: Likewise.
	* bfd/elf32-score7.c: Likewise.
	* bfd/elf32-tilepro.c: Likewise.
	* bfd/elfxx-tilegx.c: Likewise.
	* bfd/mach-o.h: Likewise.
	* bfd/nlm32-ppc.c: Likewise.
	* bfd/ns32knetbsd.c: Likewise.
	* bfd/pef.h: Likewise.
	* bfd/plugin.c: Likewise.
	* bfd/stab-syms.c: Likewise.
	* bfd/sunos.c: Likewise.
	* bfd/syms.c: Likewise.
	* bfd/xsym.h: Likewise.

	* Makefile.am (CFILES): Add syslex_wrap.c.
	(sysinfo): Depend upon syslex_wrap.o.
	(syslex_wrap.o): New rule.
	(syslex.o): Delete rule.
	* syslex_wrap.c: New file.
	* Makefile.in: Regenerate.
2012-05-16 14:26:46 +00:00
Alan Modra 8b127cbcc3 * elflink.c: Rename flaginfo to flinfo throughout, except..
(bfd_elf_lookup_section_flags): ..here, rename finfo to flaginfo.
	Formatting, style.  Simplify flag match.
2012-05-16 14:13:26 +00:00
Alan Modra a2a5095467 * dwarf2.c: Formatting.
(arange_add): Pass in unit rather than bfd.  Update callers.
	Ignore empty ranges.  Don't ask for cleared memory.
	(parse_comp_unit): Only set unit->base_address if processing
	DW_TAG_compile_unit.
	(find_debug_info): Optimise section lookup.
	(place_sections): Use bfd_alloc for stash->adjusted_sections.
	(find_line): Match previously parsed comp unit addresses as we
	do for newly parsed comp units.
2012-05-16 13:57:11 +00:00
Alan Modra df35687a29 * archive.c (_bfd_generic_read_ar_hdr_mag): Ensure sscanf
stops at end of ar_size field.
2012-05-16 13:00:29 +00:00
Alan Modra eee3b78649 PR ld/13962
PR ld/7023
	* elf.c (bfd_section_from_shdr): Fail when .dynsym sh_info is
	out of range.  As a special case, fix sh_info for zero sh_size.
	Do the same for .symtab.
2012-05-16 03:35:29 +00:00
Alan Modra 83e56e63c2 daily update 2012-05-16 00:00:04 +00:00
Nick Clifton 6927f98292 * config/tc-m68hc11.c: Add S12X and XGATE co-processor support.
Add option to offset S12 addresses into XGATE memory space.
	Tweak target flags to match other tools. (i.e. -m m68hc11).
	* doc/as.texinfo: Mention new options.
	* doc/c-m68hc11.texi: Document new options.
	* NEWS: Mention new support.

	* archures.c: Add bfd_arch_m9s12x and bfd_arch_m9s12xg.
	* config.bfd: Likewise.
	* cpu-m9s12x.c: New.
	* cpu-m9s12xg.c: New.
	* elf32-m68hc12.c: Add S12X and XGATE co-processor support.
	Add option to offset S12 addresses into XGATE memory space.
	Fix carry bug in IMM16 (IMM8 low/high) relocate.
	* Makefile.am (ALL_MACHINES): Add cpu-m9s12x and cpu-m9s12xg.
	(ALL_MACHINES_CFILES): Likewise.
	* reloc.c: Add S12X relocs.
	* Makefile.in: Regenerate.
	* bfd-in2.h: Regenerate.
	* libbfd.h: Regenerate.

	* gas/m68hc11/insns9s12x.s: New
	* gas/m68hc11/insns9s12x.d: New
	* gas/m68hc11/hexprefix.s: New
	* gas/m68hc11/hexprefix.d: New
	* gas/m68hc11/9s12x-exg-sex-tfr.s: New
	* gas/m68hc11/9s12x-exg-sex-tfr.d: New
	* gas/m68hc11/insns9s12xg.s: New
	* gas/m68hc11/insns9s12xg.d: New
	* gas/m68hc11/9s12x-mov.s: New
	* gas/m68hc11/9s12x-mov.d: New
	* gas/m68hc11/m68hc11.exp: Updated
	* gas/m68hc11/*.d: Brought in line with changed objdump output.
	* gas/all/gas.exp: XFAIL all hc11/12 targets for redef2,3.
	* gas/elf/elf.exp: XFAIL all hc11/12 targets for redef.
	* gas/elf/dwarf2-1.d: Skip for hc11/12 targets.
	* gas/elf/dwarf2-2.d: Likewise.

	* ld-m68hc11/xgate-link.s: New.
	* ld-m68hc11/xgate-link.d: New.
	* ld-m68hc11/xgate-offset.s: New.
	* ld-m68hc11/xgate-offset.d: New.
	* ld-m68hc11/xgate1.s: New.
	* ld-m68hc11/xgate1.d: New.
	* ld-m68hc11/xgate2.s: New.
	* ld-m68hc11/m68hc11.exp: Updated.
	* ld-m68hc11/*.d: Brought in line with changed objdump output.
	* ld-gc/gc.exp: Update CFLAGS for m68hc11.
	* ld-plugin/plugin.exp: Likewise.
	* ld-srec/srec.exp: XFAIL for m68hc11 and m68hc12.

	* configure.in: Add S12X and XGATE co-processor support to m68hc11
	target.
	* disassemble.c: Likewise.
	* configure: Regenerate.
	* m68hc11-dis.c: Make objdump output more consistent, use hex
	instead of decimal and use 0x prefix for hex.
	* m68hc11-opc.c: Add S12X and XGATE opcodes.
	* dis-asm.h (print_insn_m9s12x): Prototype.
	(print_insn_m9s12xg): Prototype.

	* m68hc11.h (R_M68HC12_16B, R_M68HC12_PCREL_9, R_M68HC12_PCREL_10)
	R_M68HC12_HI8XG, R_M68HC12_LO8XG): New relocations.
	(E_M68HC11_XGATE_RAMOFFSET): Define.

	* m68hc11.h: Add XGate definitions.
	(struct m68hc11_opcode): Add xg_mask field.
2012-05-15 12:55:51 +00:00
Alan Modra d051b294b9 daily update 2012-05-15 00:00:05 +00:00
James Lemke b9c361e0ad Add support for PowerPC VLE.
2012-05-14  Catherine Moore  <clm@codesourcery.com>

	* NEWS:  Mention PowerPC VLE port.

2012-05-14  James Lemke <jwlemke@codesourcery.com>
	    Catherine Moore  <clm@codesourcery.com>

	bfd/
	* bfd.c (bfd_lookup_section_flags): Add section parm.
	* ecoff.c (bfd_debug_section): Remove flag_info initializer.
	* elf-bfd.h (bfd_elf_section_data): Move in section_flag_info.
	(bfd_elf_lookup_section_flags): Add section parm.
	* elf32-ppc.c (is_ppc_vle): New function.
	(ppc_elf_modify_segment_map): New function.
	(elf_backend_modify_segment_map): Define.
	(has_vle_insns): New define.
	* elf32-ppc.h (ppc_elf_modify_segment_map): Declare.
	* elflink.c (bfd_elf_lookup_section_flags): Add return value & parm.
	Move in logic to omit / include a section.
	* libbfd-in.h (bfd_link_info): Add section parm.
	(bfd_generic_lookup_section_flags): Likewise.
	* reloc.c (bfd_generic_lookup_section_flags): Likewise.
	* section.c (bfd_section): Move out section_flag_info.
	(BFD_FAKE_SECTION): Remove flag_info initializer.
	* targets.c (_bfd_lookup_section_flags): Add section parm.

2012-05-14  Catherine Moore  <clm@codesourcery.com>

	bfd/
	* archures.c (bfd_mach_ppc_vle): New.
	* bfd-in2.h: Regenerated.
	* cpu-powerpc.c (bfd_powerpc_archs): New entry for vle.
	* elf32-ppc.c (split16_format_type): New enumeration.
	(ppc_elf_vle_split16): New function.
	(HOWTO): Add entries for R_PPC_VLE relocations.
	(ppc_elf_reloc_type_lookup): Handle PPC_VLE relocations.
	(ppc_elf_section_flags): New function.
	(ppc_elf_lookup_section_flags): New function.
	(ppc_elf_section_processing): New function.
	(ppc_elf_check_relocs): Handle PPC_VLE relocations.
	(ppc_elf_relocation_section): Likewise.
	(elf_backend_lookup_section_flags_hook): Define.
	(elf_backend_section_flags): Define.
	(elf_backend_section_processing): Define.
	* elf32-ppc.h (ppc_elf_section_processing): Declare.
	* libbfd.h: Regenerated.
	* reloc.c (BFD_RELOC_PPC_VLE_REL8, BFD_RELOC_PPC_VLE_REL15,
	BFD_RELOC_PPC_VLE_REL24, BFD_RELOC_PPC_VLE_LO16A,
	BFD_RELOC_PPC_VLE_LO16D, BFD_RELOC_PPC_VLE_HI16A,
	BFD_RELOC_PPC_VLE_HI16D, BFD_RELOC_PPC_VLE_HA16A,
	BFD_RELOC_PPC_VLE_HA16D, BFD_RELOC_PPC_VLE_SDA21,
	BFD_RELOC_PPC_VLE_SDA21_LO, BFD_RELOC_PPC_VLE_SDAREL_LO16A,
	BFD_RELOC_PPC_VLE_SDAREL_LO16D, BFD_RELOC_PPC_VLE_SDAREL_HI16A,
	BFD_RELOC_PPC_VLE_SDAREL_HI16D, BFD_RELOC_PPC_VLE_SDAREL_HA16A,
	BFD_RELOC_PPC_VLE_SDAREL_HA16D): New bfd relocations.

2012-05-14  James Lemke  <jwlemke@codesourcery.com>

	gas/
	* config/tc-ppc.c (insn_validate): New func of existing code to call..
	(ppc_setup_opcodes): ..from 2 places here.
	Revise for second (VLE) opcode table.
	Add #ifdef'd code to print opcode tables.

2012-05-14  James Lemke  <jwlemke@codesourcery.com>

	gas/
	* config/tc-ppc.c (ppc_setup_opcodes): Allow out-of-order
	for the VLE conditional branches.

2012-05-14  Catherine Moore  <clm@codesourcery.com>
            Maciej W. Rozycki  <macro@codesourcery.com>
	    Rhonda Wittels  <rhonda@codesourcery.com>

	gas/
	* config/tc-ppc.c (PPC_VLE_SPLIT16A): New macro.
	(PPC_VLE_SPLIT16D): New macro.
	(PPC_VLE_LO16A): New macro.
	(PPC_VLE_LO16D): New macro.
	(PPC_VLE_HI16A): New macro.
	(PPC_VLE_HI16D): New macro.
	(PPC_VLE_HA16A): New macro.
	(PPC_VLE_HA16D): New macro.
	(PPC_APUINFO_VLE): New definition.
	(md_chars_to_number): New function.
	(md_parse_option): Check for combinations of little
	endian and -mvle.
	(md_show_usage): Document -mvle.
	(ppc_arch): Recognize VLE.
	(ppc_mach): Recognize bfd_mach_ppc_vle.
	(ppc_setup_opcodes): Print the opcode table if
	* config/tc-ppc.h (ppc_frag_check): Declare.
	* doc/c-ppc.texi: Document -mvle.
	* NEWS:  Mention PowerPC VLE port.

2012-05-14  Catherine Moore  <clm@codesourcery.com>

	gas/
	* config/tc-ppc.h (ppc_dw2_line_min_insn_length): Declare.
	(DWARF2_LINE_MIN_INSN_LENGTH): Redefine.
	* config/tc-ppc.c (ppc_dw2_line_min_insn_length): New.
	* dwarf2dbg.c (scale_addr_delta): Handle values of 1
	for DWARF2_LINE_MIN_INSN_LENGTH.

2012-05-14  Catherine Moore  <clm@codesourcery.com>
            Maciej W. Rozycki  <macro@codesourcery.com>
	    Rhonda Wittels  <rhonda@codesourcery.com>

	gas/testsuite/
	* gas/ppc/ppc.exp: Run new tests.
	* gas/ppc/vle-reloc.d: New test.
	* gas/ppc/vle-reloc.s: New test.
	* gas/ppc/vle-simple-1.d: New test.
	* gas/ppc/vle-simple-1.s: New test.
	* gas/ppc/vle-simple-2.d: New test.
	* gas/ppc/vle-simple-2.s: New test.
	* gas/ppc/vle-simple-3.d: New test.
	* gas/ppc/vle-simple-3.s: New test.
	* gas/ppc/vle-simple-4.d: New test.
	* gas/ppc/vle-simple-4.s: New test.
	* gas/ppc/vle-simple-5.d: New test.
	* gas/ppc/vle-simple-5.s: New test.
	* gas/ppc/vle-simple-6.d: New test.
	* gas/ppc/vle-simple-6.s: New test.
	* gas/ppc/vle.d: New test.
	* gas/ppc/vle.s: New test.

2012-05-14  James Lemke  <jwlemke@codesourcery.com>
	include/elf/
	* ppc.h (SEC_PPC_VLE): Remove.

2012-05-14  Catherine Moore  <clm@codesourcery.com>
	    James Lemke  <jwlemke@codesourcery.com>

	include/elf/
	* ppc.h (R_PPC_VLE_REL8): New reloction.
	(R_PPC_VLE_REL15): Likewise.
	(R_PPC_VLE_REL24): Likewise.
	(R_PPC_VLE_LO16A): Likewise.
	(R_PPC_VLE_LO16D): Likewise.
	(R_PPC_VLE_HI16A): Likewise.
	(R_PPC_VLE_HI16D): Likewise.
	(R_PPC_VLE_HA16A): Likewise.
	(R_PPC_VLE_HA16D): Likewise.
	(R_PPC_VLE_SDA21): Likewise.
	(R_PPC_VLE_SDA21_LO): Likewise.
	(R_PPC_VLE_SDAREL_LO16A): Likewise.
	(R_PPC_VLE_SDAREL_LO16D): Likewise.
	(R_PPC_VLE_SDAREL_HI16A): Likewise.
	(R_PPC_VLE_SDAREL_HI16D): Likewise.
	(R_PPC_VLE_SDAREL_HA16A): Likewise.
	(R_PPC_VLE_SDAREL_HA16D): Likewise.
	(SEC_PPC_VLE): Remove.
	(PF_PPC_VLE): New program header flag.
	(SHF_PPC_VLE): New section header flag.
	(vle_opcodes, vle_num_opcodes): New.
	(VLE_OP): New macro.
	(VLE_OP_TO_SEG): New macro.

2012-05-14  Catherine Moore  <clm@codesourcery.com>
            Maciej W. Rozycki  <macro@codesourcery.com>
	    Rhonda Wittels  <rhonda@codesourcery.com>

	include/opcode/
	* ppc.h (PPC_OPCODE_VLE): New definition.
	(PPC_OP_SA): New macro.
	(PPC_OP_SE_VLE): New macro.
	(PPC_OP): Use a variable shift amount.
	(powerpc_operand): Update comments.
	(PPC_OPSHIFT_INV): New macro.
	(PPC_OPERAND_CR): Replace with...
	(PPC_OPERAND_CR_BIT): ...this and
	(PPC_OPERAND_CR_REG): ...this.

2012-05-14  James Lemke  <jwlemke@codesourcery.com>

	ld/
	* ldlang.c (walk_wild_consider_section): Don't copy section_flag_list.
	Pass it to callback.
	(walk_wild_section_general): Pass section_flag_list to callback.
	(lang_add_section): Add sflag_list parm.
	Move out logic to keep / omit a section & call bfd_lookup_section_flags.
	(output_section_callback_fast): Add sflag_list parm.
	Add new parm to lang_add_section calls.
	(output_section_callback): Likewise.
	(check_section_callback): Add sflag_list parm.
	(lang_place_orphans): Add new parm to lang_add_section calls.
	(gc_section_callback): Add sflag_list parm.
	(find_relro_section_callback): Likewise.
	* ldlang.h (callback_t): Add flag_info parm.
	(lang_add_section): Add sflag_list parm.
	* emultempl/armelf.em (elf32_arm_add_stub_section):
	Add lang_add_section parm.
	* emultempl/beos.em (gld*_place_orphan): Likewise.
	* emultempl/elf32.em (gld*_place_orphan): Likewise.
	* emultempl/hppaelf.em (hppaelf_add_stub_section): Likewise.
	* emultempl/m68hc1xelf.em (m68hc11elf_add_stub_section): Likewise.
	* emultempl/mipself.em (mips_add_stub_section): Likewise.
	* emultempl/mmo.em (mmo_place_orphan): Likewise.
	* emultempl/pe.em (gld_*_place_orphan): Likewise.
	* emultempl/pep.em (gld_*_place_orphan): Likewise.
	* emultempl/ppc64elf.em (ppc_add_stub_section): Likewise.
	* emultempl/spuelf.em (spu_place_special_section): Likewise.
	* emultempl/vms.em (vms_place_orphan): Likewise.

2012-05-14  James Lemke  <jwlemke@codesourcery.com>

	ld/testsuite/
	* ld-powerpc/powerpc.exp: Create ppceabitests.
	* ld-powerpc/vle-multiseg.s: New.
	* ld-powerpc/vle-multiseg-1.d: New.
	* ld-powerpc/vle-multiseg-1.ld: New.
	* ld-powerpc/vle-multiseg-2.d: New.
	* ld-powerpc/vle-multiseg-2.ld: New.
	* ld-powerpc/vle-multiseg-3.d: New.
	* ld-powerpc/vle-multiseg-3.ld: New.
	* ld-powerpc/vle-multiseg-4.d: New.
	* ld-powerpc/vle-multiseg-4.ld: New.
	* ld-powerpc/vle-multiseg-5.d: New.
	* ld-powerpc/vle-multiseg-5.ld: New.
	* ld-powerpc/vle-multiseg-6.d: New.
	* ld-powerpc/vle-multiseg-6.ld: New.
	* ld-powerpc/vle-multiseg-6a.s: New.
	* ld-powerpc/vle-multiseg-6b.s: New.
	* ld-powerpc/vle-multiseg-6c.s: New.
	* ld-powerpc/vle-multiseg-6d.s: New.
	* ld-powerpc/powerpc.exp: Run new tests.

2012-05-14  Catherine Moore  <clm@codesourcery.com>

	ld/
	* NEWS:  Mention PowerPC VLE port.

2012-05-14  Catherine Moore  <clm@codesourcery.com>

	ld/testsuite/
	* ld-powerpc/apuinfo.rd: Update for VLE.
	* ld-powerpc/vle-reloc-1.d: New.
	* ld-powerpc/vle-reloc-1.s: New.
	* ld-powerpc/vle-reloc-2.d: New.
	* ld-powerpc/vle-reloc-2.s: New.
	* ld-powerpc/vle-reloc-3.d: New.
	* ld-powerpc/vle-reloc-3.s: New.
	* ld-powerpc/vle-reloc-def-1.s: New.
	* ld-powerpc/vle-reloc-def-2.s: New.
	* ld-powerpc/vle-reloc-def-3.s: New.

2012-05-14  James Lemke  <jwlemke@codesourcery.com>

	opcodes/
	* ppc-dis.c (get_powerpc_dialect): Use is_ppc_vle.
	(PPC_OPCD_SEGS, VLE_OPCD_SEGS): New defines.
	(vle_opcd_indices): New array.
	(lookup_vle): New function.
	(disassemble_init_powerpc): Revise for second (VLE) opcode table.
	(print_insn_powerpc): Likewise.
	* ppc-opc.c: Likewise.

2012-05-14  Catherine Moore  <clm@codesourcery.com>
            Maciej W. Rozycki  <macro@codesourcery.com>
	    Rhonda Wittels  <rhonda@codesourcery.com>
	    Nathan Froyd <froydnj@codesourcery.com>

	opcodes/
	* ppc-opc.c (insert_arx, extract_arx): New functions.
	(insert_ary, extract_ary): New functions.
	(insert_li20, extract_li20): New functions.
	(insert_rx, extract_rx): New functions.
	(insert_ry, extract_ry): New functions.
	(insert_sci8, extract_sci8): New functions.
	(insert_sci8n, extract_sci8n): New functions.
	(insert_sd4h, extract_sd4h): New functions.
	(insert_sd4w, extract_sd4w): New functions.
	(insert_vlesi, extract_vlesi): New functions.
	(insert_vlensi, extract_vlensi): New functions.
	(insert_vleui, extract_vleui): New functions.
	(insert_vleil, extract_vleil): New functions.
 	(BI_MASK, BB_MASK, BT): Use PPC_OPERAND_CR_BIT.
 	(BI16, BI32, BO32, B8): New.
	(B15, B24, CRD32, CRS): New.
 	(CRD, OBF, BFA, CR, CRFS): Use PPC_OPERAND_CR_REG.
	(DB, IMM20, RD, Rx, ARX, RY, RZ): New.
	(ARY, SCLSCI8, SCLSCI8N, SE_SD, SE_SDH): New.
	(SH6_MASK): Use PPC_OPSHIFT_INV.
	(SI8, UI5, OIMM5, UI7, BO16): New.
	(VLESIMM, VLENSIMM, VLEUIMM, VLEUIMML): New.
	(XT6, XA6, XB6, XB6S, XC6): Use PPC_OPSHIFT_INV.
	(ALLOW8_SPRG): New.
	(insert_sprg, extract_sprg): Check ALLOW8_SPRG.
	(OPVUP, OPVUP_MASK OPVUP): New
	(BD8, BD8_MASK, BD8IO, BD8IO_MASK): New.
	(EBD8IO, EBD8IO1_MASK, EBD8IO2_MASK, EBD8IO3_MASK): New.
	(BD15, BD15_MASK, EBD15, EBD15_MASK, EBD15BI, EBD15BI_MASK): New.
	(BD24,BD24_MASK, C_LK, C_LK_MASK, C, C_MASK): New.
 	(IA16, IA16_MASK, I16A, I16A_MASK, I16L, I16L_MASK): New.
	(IM7, IM7_MASK, LI20, LI20_MASK, SCI8, SCI8_MASK): New.
	(SCI8BF, SCI8BF_MASK, SD4, SD4_MASK): New.
	(SE_IM5, SE_IM5_MASK): New.
	(SE_R, SE_R_MASK, SE_RR, SE_RR_MASK): New.
	(EX, EX_MASK, BO16F, BO16T, BO32F, BO32T): New.
	(BO32DNZ, BO32DZ): New.
	(NO371, PPCSPE, PPCISEL, PPCEFS, MULHW): Include PPC_OPCODE_VLE.
	(PPCVLE): New.
	(powerpc_opcodes): Add new VLE instructions.  Update existing
	instruction to include PPCVLE if supported.
	* ppc-dis.c (ppc_opts): Add vle entry.
	(get_powerpc_dialect): New function.
	(powerpc_init_dialect): VLE support.
	(print_insn_big_powerpc): Call get_powerpc_dialect.
	(print_insn_little_powerpc): Likewise.
	(operand_value_powerpc): Handle negative shift counts.
	(print_insn_powerpc): Handle 2-byte instruction lengths.
2012-05-14 19:45:30 +00:00
Alan Modra f08e82e2b4 daily update 2012-05-14 00:00:04 +00:00
Alan Modra 25a9d08579 daily update 2012-05-13 00:00:05 +00:00
Alan Modra 0649c0eaf2 daily update 2012-05-12 00:00:05 +00:00
Nick Clifton 99700d6feb PR 13503
* reloc.c: Add new ENUM for BFD_RELOC_AVR_8_LO,
	BFD_RELOC_AVR_8_HI, BFD_RELOC_AVR_8_HHI.
	* bfd-in2.h: Regenerate.
	* libbfd.h: Regenrate.
	* elf32-avr.c (elf_avr_howto_table): Add entries for
	R_AVR_8_LO8, R_AVR_8_HI8, R_AVR_8_HHI8.
	(avr_reloc_map): Add RELOC mappings for R_AVR_8_LO8, R_AVR_8_HI8,
	R_AVR_8_HHI8.

	* config/tc-avr.c (exp_mod_pm): Remove variable.
	(exp_mod_data_t): New typedef.
	(pexp_mod_data, exp_mod_data): New variables.
	(avr_parse_cons_expression): Scan through exp_mod_data[] to find
	data expression modifiers "pm", "gs", "lo8", hi8", "hhi8", "hh8"
	and set pexp_mod_data accordingly to be used in avr_cons_fix_new.
	(avr_cons_fix_new): Handle new data expression modifiers shipped
	in pexp_mod_data.
	(md_apply_fix): Handle BFD_RELOC_AVR_8_LO, BFD_RELOC_AVR_8_HI,
	BFD_RELOC_AVR_8_HHI.

	* elf/avr.h (RELOC_NUMBERS): Add values for R_AVR_8_LO8,
	R_AVR_8_HI8, R_AVR_8_HHI8.
2012-05-11 12:59:23 +00:00
H.J. Lu 268a8d3ac4 Use int and bfd_signed_vma in x32 addend overflow check
bfd/

	* elf64-x86-64.c (elf_x86_64_relocate_section): Use int in x32
	addend overflow check.

gas/

	* config/tc-i386.c (tc_gen_reloc): Use bfd_signed_vma in x32
	addend overflow check.
2012-05-11 00:50:43 +00:00
DJ Delorie 74b1e045f3 * elf32-rx.c (rx_elf_object_p): Ignore empty segments. 2012-05-11 00:01:58 +00:00