Commit Graph

9761 Commits

Author SHA1 Message Date
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