The branch, master has been updated via 6d89063b0f0516a9f0a2a37bc5993500657b3226 (commit) via 94da686fad1206d5fd38fa21609d190674b3415b (commit) via 9b6b99998323938ff118d9c404f3baffc796c23f (commit) via e7640b907487435f9d7d5ef2f925599c2eea8fbc (commit) via 37056fbfde6270be1a3bc595025547c40c77be5b (commit) via a45341a136e969b2a4309d07452c33e7337ca8b5 (commit) via 9f3553be74e02172922f1bfcefc542a8c1f7d7d9 (commit) via eba100049746bf8c553c77affa3c8a8e21c54287 (commit) via a370fc7627bc6adf2665b85de50ea05489ae60e0 (commit) via a9c8179039fe508e0f5fc362b083155de2f41892 (commit) via aa2614659d7863f1afe4da2251312f7da9236ea5 (commit) via e7a84eb6873575517586ae3df2844a35c7d031fc (commit) via 8435b254d22a62b1a4e537b18cec010cb0b8ade6 (commit) via 213e093d3b0fbe8b52024ad28892cab2b39a0455 (commit) via 4e6a437edec4ba7e7cacd842609d5e135a88c1a3 (commit) via 160e19fb73b12a2443449e6877128f24d20734c5 (commit) via 25f71650b47bf744dbc0db9d7172d480bab70ca5 (commit) via 7ffaaf0b44f165c6cc6fbdeff174b00fd49e6dd7 (commit) via ed24c49cb890e7772c48fb98d7133570375d9595 (commit) via 7f31375a50e871439e50731d07318067fb691e20 (commit) via 1abda060264bdc93ad5b045a87db30f4dbeb9100 (commit) via 2cc889266c1508528db63c8097804641bf5729cc (commit) via bbd627c4c83a4c171cb8d7f0e640651895c1a22a (commit) via d93dfc0bbbaed6bc0d11bc8578cdfafdaee467a7 (commit) via ab1b1b96208eb40d09840b98eaadfb542bb7229c (commit) via 50fb8ed721c25968e8ff5c3aedb5ea15683b940c (commit) via 70874fa323b9508eaf629ebed78989a759c14e6f (commit) via 0c81b48fed900c9641baf75f10d01c8fe4bec32e (commit) via ade92dfc7e035dd4d0d345b2e1682fa4ba56a3f6 (commit) via 0364c11c42693466e2db937882fc156e38f78afc (commit) via e8010a2e92a32324b09b11654fe2b2830477c523 (commit) via cb652f647e478b00acb7782de5a4ec9cf360f669 (commit) via 6abd2acc51e4dfd8699be098e92c9e5285e84ecf (commit) via b696cfffd82b61393f14a642f2bff596b24ee37a (commit) via c7e212eda75d70cfef8f54e2b4ca6470c2672db8 (commit) via 0cee6aca2246d89f8fbfe7310366f3ddc3f72f5e (commit) via 69f25a38c9151df559a0c326425788bc64f393dc (commit) via 998a2ee4eec3583a8ef31675dec8fbd880e14f64 (commit) via 3363422556d95de01c4a262489fec8d6b5506d01 (commit) via 28cfc710ba3d9959cedd0f345bb212666cc6890f (commit) via cf9fe5cf2be8b76820a05c966cdca6df5c2eee24 (commit) via 3b7149376604e22488c7cd8fa1835500f14123cb (commit) via a75176511797cf00c5d30d1ce4de460e3a7e93e7 (commit) via 2f4ebefb529248bd4b9342deaf725ad3850e776f (commit) via 07c0d258de6546976d81de85ff6b838631ef79d2 (commit) via 5996813199e48b2a39e4ee233624cf0e92afb165 (commit) via 2162fa558a006758db2f2b2cc4e863d5cfc37a70 (commit) via 3f5f43e44adb3cc5fd3e262c9c053888379fc106 (commit) via f4b94fa4c6f6db0fe0d9f6a39e8ac9061e1e6952 (commit) via 205148e7c30b927881094a02483218c8bd8df64b (commit) via 118b5358b53238935035a69fc53b1b58146a882e (commit) via f30af08ff7ed71e4a098a3aa0168a08e8488f43d (commit) via f714c2bce86c209089d11c14abcb5fc809dcfc79 (commit) via 052d997d8e842324347d84f38e1beeeb72a18d2c (commit) via 4a73d497fc452a2e851451967dab4ac546494837 (commit) via 63fdd5f738504701b67d5ab3567e4f9b8834f6f2 (commit) via 76dc1f75c17730fd15e7cfb04a566374878438b9 (commit) via 66ea253c5a0da89a2acd5994521ce3ed5cbe3368 (commit) from 698ebd33374890ea9f5396d54d25584beec7ce4c (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit 6d89063b0f0516a9f0a2a37bc5993500657b3226 Merge: 698ebd33374890ea9f5396d54d25584beec7ce4c 94da686fad1206d5fd38fa21609d190674b3415b Author: Jan Kratochvil Date: Tue Jul 20 20:50:52 2010 +0200 Merge remote branch 'gdb/master' commit 94da686fad1206d5fd38fa21609d190674b3415b Author: sezero Date: Tue Jul 20 18:20:27 2010 +0000 * gdb/gdbserver/server.c (handle_query): strcpy() the returned string from paddress() instead of sprintf(). commit 9b6b99998323938ff118d9c404f3baffc796c23f Author: sezero Date: Tue Jul 20 18:10:52 2010 +0000 * gdb/gdbserver/utils.c (paddress): Return phex_nz(). commit e7640b907487435f9d7d5ef2f925599c2eea8fbc Author: Alan Modra Date: Tue Jul 20 14:08:30 2010 +0000 include/elf/ * internal.h (ELF_TBSS_SPECIAL): New macro, extracted from.. (ELF_SECTION_SIZE): ..here. (ELF_SECTION_IN_SEGMENT_1): Add "strict" arg. (ELF_SECTION_IN_SEGMENT_STRICT): New macro. bfd/ * elf.c (assign_file_positions_for_load_sections): Check that zero size sections are allocated in segments too. (assign_file_positions_for_non_load_sections): Warn if zero size alloc sections are found here. (copy_elf_program_header): Don't drop zero size sections from segment map. (copy_private_bfd_data): Check for changes in zero size sections. binutils/ * readelf.c (process_program_headers): Don't ignore all zero size sections. ld/testsuite/ * ld-powerpc/tlsexe.r: Update. * ld-powerpc/tlsexetoc.r: Update. * ld-powerpc/tlsso.r: Update. * ld-powerpc/tlstocso.r: Update. commit 37056fbfde6270be1a3bc595025547c40c77be5b Author: Jan Kratochvil Date: Tue Jul 20 12:54:57 2010 +0000 gdb/ * linux-nat.c (linux_handle_extended_wait): Handle case when event == PTRACE_EVENT_CLONE && stopping && WSTOPSIG (status) != SIGSTOP. commit a45341a136e969b2a4309d07452c33e7337ca8b5 Author: Jan Kratochvil Date: Tue Jul 20 12:33:29 2010 +0000 gdb/ Code cleanup. * linux-nat.c (linux_nat_wait_1): Reset STATUS after calling linux_nat_wait_1. Use always LP->STATUS afterwards. commit 9f3553be74e02172922f1bfcefc542a8c1f7d7d9 Author: Hui Zhu Date: Tue Jul 20 05:58:52 2010 +0000 2010-07-20 Hui Zhu * inf-ptrace.c (inf_ptrace_create_inferior): Initialize back_to. (inf_ptrace_attach): Ditto. commit eba100049746bf8c553c77affa3c8a8e21c54287 Author: gdbadmin Date: Tue Jul 20 00:00:33 2010 +0000 *** empty log message *** commit a370fc7627bc6adf2665b85de50ea05489ae60e0 Author: Alan Modra Date: Tue Jul 20 00:00:05 2010 +0000 daily update commit a9c8179039fe508e0f5fc362b083155de2f41892 Author: Jan Kratochvil Date: Mon Jul 19 18:11:31 2010 +0000 gdb/doc/ * gdb.texinfo (Active Targets): Fix wrong comma placement. commit aa2614659d7863f1afe4da2251312f7da9236ea5 Author: Jan Kratochvil Date: Mon Jul 19 17:51:22 2010 +0000 gdb/ Make core files the process_stratum. * corefile.c (core_target): New variable. (core_file_command): Remove variable t, use core_target. * corelow.c (core_ops): Make it static. (init_core_ops): Change to process_stratum. Initialize CORE_TARGET. * defs.h (make_cleanup_unpush_target): New prototype. * gdbarch.h: Regenerate. * gdbarch.sh (core_pid_to_str): Remove core_stratum from its comment. * gdbcore.h (core_target): New declaration. * inf-ptrace.c (inf_ptrace_create_inferior, inf_ptrace_attach): New variables ops_already_pushed and back_to. Use push_target, make_cleanup_unpush_target and discard_cleanups calls. * record.c (record_open): Replace core_stratum by a core_bfd check. * target.c (target_is_pushed): New function. (find_core_target): Remove. * target.h (enum strata) : Remove. (target_is_pushed): New declaration. (find_core_target): Remove declaration. * tracepoint.c (init_tfile_ops) : Remove comment. * utils.c (do_unpush_target, make_cleanup_unpush_target): New functions. gdb/doc/ Make core files the process_stratum. * gdb.texinfo (Active Targets): Remove core_stratum. Include record_stratum example. gdb/testsuite/ Make core files the process_stratum. * gdb.base/corefile.exp (run: load core again) (run: sanity check we see the core file, run: with core) (run: core file is cleared, attach: load core again) (attach: sanity check we see the core file, attach: with core) (attach: core file is cleared): New tests. * gdb.base/coremaker.c (main): New parameters. Implement "sleep" argv. commit e7a84eb6873575517586ae3df2844a35c7d031fc Author: Hui Zhu Date: Mon Jul 19 07:55:41 2010 +0000 2010-07-19 Hui Zhu * breakpoint.c (single_step_breakpoints_inserted): New function. * breakpoint.h (single_step_breakpoints_inserted): Extern. * infrun.c (maybe_software_singlestep): Add check code. * record.c (record_resume): Add code for software single step. (record_wait): Ditto. commit 8435b254d22a62b1a4e537b18cec010cb0b8ade6 Author: Alan Modra Date: Mon Jul 19 00:00:05 2010 +0000 daily update commit 213e093d3b0fbe8b52024ad28892cab2b39a0455 Author: gdbadmin Date: Mon Jul 19 00:00:04 2010 +0000 *** empty log message *** commit 4e6a437edec4ba7e7cacd842609d5e135a88c1a3 Author: Jan Kratochvil Date: Sun Jul 18 21:21:52 2010 +0000 gdb/ * linux-nat.c (linux_handle_extended_wait): Move variable new_lp into a more inner block. Remove its unused declaration initializer. commit 160e19fb73b12a2443449e6877128f24d20734c5 Author: Paolo Bonzini Date: Sun Jul 18 08:12:39 2010 +0000 2010-07-17 Jack Howarth PR target/44862 * Makefile.tpl (POSTSTAGE1_CXX_EXPORT): Provide -B option to allow for link spec %s substitutions for libstdc++.a on darwin. * Makefile.in: Regenerate. commit 25f71650b47bf744dbc0db9d7172d480bab70ca5 Author: gdbadmin Date: Sun Jul 18 00:00:33 2010 +0000 *** empty log message *** commit 7ffaaf0b44f165c6cc6fbdeff174b00fd49e6dd7 Author: Alan Modra Date: Sun Jul 18 00:00:05 2010 +0000 daily update commit ed24c49cb890e7772c48fb98d7133570375d9595 Author: Alan Modra Date: Sat Jul 17 03:10:49 2010 +0000 * elf.c (_bfd_elf_map_sections_to_segments): Force new segment for sections with overlapping LMAs. (assign_file_positions_for_load_sections): Catch overlap for sections that wrap around the address space. Replace a warning that duplicates ld's --check-sections error with a warning that lma has been adjusted for overlapping sections. commit 7f31375a50e871439e50731d07318067fb691e20 Author: Alan Modra Date: Sat Jul 17 00:00:05 2010 +0000 daily update commit 1abda060264bdc93ad5b045a87db30f4dbeb9100 Author: gdbadmin Date: Sat Jul 17 00:00:03 2010 +0000 *** empty log message *** commit 2cc889266c1508528db63c8097804641bf5729cc Author: Thiago Jung Bauermann Date: Fri Jul 16 23:19:37 2010 +0000 * NEWS: Mention support for the new ptrace interface and hardware accelerated watchpoint conditions on powerpc-linux. commit bbd627c4c83a4c171cb8d7f0e640651895c1a22a Author: sezero Date: Fri Jul 16 20:04:41 2010 +0000 * target.c (debug_to_insert_breakpoint): Instead of casting to unsigned long and %ld, use core_addr_to_string() and %s to print CORE_ADDR vars and host_address_to_string() and %s for pointers. (debug_to_remove_breakpoint): Likewise. (debug_to_region_ok_for_hw_watchpoint): Likewise. (debug_to_can_accel_watchpoint_condition): Likewise. (debug_to_stopped_data_address): Likewise. (debug_to_watchpoint_addr_within_range): Likewise. (debug_to_insert_hw_breakpoint): Likewise. (debug_to_remove_hw_breakpoint): Likewise. (debug_to_insert_watchpoint): Likewise. (debug_to_remove_watchpoint): Likewise. commit d93dfc0bbbaed6bc0d11bc8578cdfafdaee467a7 Author: swagiaal Date: Fri Jul 16 19:23:56 2010 +0000 Use allocated cplus_specific for cplus symbols. 2010-07-16 Sami Wagiaalla * symtab.h (symbol_set_demangled_name): Now takes an optional objfile* argument. (cplus_specific): New struct. * symtab.c (symbol_set_demangled_name): Updated. Use cplus_specific for cplus symbols. (symbol_get_demangled_name): Retrive the name from the cplus_specific struct for cplus symbols. (symbol_init_language_specific): Set cplus_specific for cplus symbols. (symbol_set_names): Pass objfile to symbol_set_demangled_name. * symtab.c (symbol_init_cplus_specific): New function. commit ab1b1b96208eb40d09840b98eaadfb542bb7229c Author: swagiaal Date: Fri Jul 16 19:00:55 2010 +0000 Use setter and getter for demangled_name. 2010-07-16 Sami Wagiaalla * symtab.h (symbol_set_demangled_name): New function. (symbol_get_demangled_name): New function. * symtab.c (symbol_set_demangled_name): New function. (symbol_get_demangled_name): New function. (symbol_init_language_specific): Use demangled_name setter and getter. (symbol_set_names): Ditto. (symbol_natural_name): Ditto. (symbol_demangled_name): Ditto. * dwarf2read.c (new_symbol): Ditto. commit 50fb8ed721c25968e8ff5c3aedb5ea15683b940c Author: swagiaal Date: Fri Jul 16 18:39:09 2010 +0000 Rename cplus_specific mangled_lang. 2010-07-16 Sami Wagiaalla * symtab.h: Renamed cplus_specific to mangled_lang. * symtab.c (symbol_init_language_specific): Updated. (symbol_set_names): Updated. (symbol_natural_name): Updated. (symbol_demangled_name): Updated. * ada-lang.c (ada_decode_symbol): Updated. * dwarf2read.c (new_symbol): Updated. commit 70874fa323b9508eaf629ebed78989a759c14e6f Author: gdbadmin Date: Fri Jul 16 00:00:33 2010 +0000 *** empty log message *** commit 0c81b48fed900c9641baf75f10d01c8fe4bec32e Author: Alan Modra Date: Fri Jul 16 00:00:05 2010 +0000 daily update commit ade92dfc7e035dd4d0d345b2e1682fa4ba56a3f6 Author: gdbadmin Date: Thu Jul 15 00:00:33 2010 +0000 *** empty log message *** commit 0364c11c42693466e2db937882fc156e38f78afc Author: Alan Modra Date: Thu Jul 15 00:00:05 2010 +0000 daily update commit e8010a2e92a32324b09b11654fe2b2830477c523 Author: Cary Coutant Date: Wed Jul 14 22:18:06 2010 +0000 PR ld/11817 * dwarf2.c (read_section): Revert patch for compressed debug sections. (find_line): Likewise. (read_and_uncompress_section): Remove. commit cb652f647e478b00acb7782de5a4ec9cf360f669 Author: kwerner Date: Wed Jul 14 14:54:57 2010 +0000 gdb/ChangeLog:* valops.c (value_assign): Do not call to value_coerce_to_target.(value_must_coerce_to_target): Return 0 in case of TYPE_VECTOR.gdb/testsuite/ChangeLog:* gdb.arch/altivec-abi.exp: New tests. commit 6abd2acc51e4dfd8699be098e92c9e5285e84ecf Author: kwerner Date: Wed Jul 14 14:30:35 2010 +0000 * MAINTAINERS: Add myself for write after approval privileges. commit b696cfffd82b61393f14a642f2bff596b24ee37a Author: Tom Tromey Date: Wed Jul 14 14:13:53 2010 +0000 2010-07-13 Emmanuel Thomé * c-valprint.c (c_val_print): Add embedded_offset to address in call to val_print_array_elements. 2010-07-13 Tom Tromey * gdb.python/py-prettyprint.c (struct arraystruct): New struct. (main): Use it. * gdb.python/py-prettyprint.exp (run_lang_tests): Add test. commit c7e212eda75d70cfef8f54e2b4ca6470c2672db8 Author: H.J. Lu Date: Wed Jul 14 00:30:55 2010 +0000 Don't allocate .got.plt section if there are no GOT nor PLT entries. bfd/ 2010-07-13 H.J. Lu PR ld/11812 * elf32-i386.c (elf_i386_size_dynamic_sections): Don't allocate .got.plt section if there are no GOT nor PLT entries. * elf64-x86-64.c (elf64_x86_64_size_dynamic_sections): Likewise. ld/testsuite/ 2010-07-13 H.J. Lu PR ld/11812 * ld-elf/exclude3b.d: Don't run on ia64-*-*. Replace .got with .dynamic. * ld-elf/exclude3d.d: New. * ld-i386/nogot1.d: Likewise. * ld-i386/nogot1.s: Likewise. * ld-x86-64/nogot1.d: Likewise. * ld-x86-64/nogot1.s: Likewise. * ld-i386/i386.exp: Run nogot1. * ld-x86-64/x86-64.exp: Likewise. commit 0cee6aca2246d89f8fbfe7310366f3ddc3f72f5e Author: Alan Modra Date: Wed Jul 14 00:00:05 2010 +0000 daily update commit 69f25a38c9151df559a0c326425788bc64f393dc Author: gdbadmin Date: Wed Jul 14 00:00:03 2010 +0000 *** empty log message *** commit 998a2ee4eec3583a8ef31675dec8fbd880e14f64 Author: Tom Tromey Date: Tue Jul 13 22:02:03 2010 +0000 * dwarf2read.c (dwarf2_read_index): Correctly set 'total_size'. commit 3363422556d95de01c4a262489fec8d6b5506d01 Author: Tom Tromey Date: Tue Jul 13 21:06:48 2010 +0000 * dwarf2read.c (dwarf2_per_cu_text_offset): Fix reference to objfile. commit 28cfc710ba3d9959cedd0f345bb212666cc6890f Author: Tom Tromey Date: Tue Jul 13 20:52:52 2010 +0000 * symfile.c (set_initial_language): Update. (deduce_language_from_filename): Argument type now const. * symtab.h (find_main_filename): Update. (deduce_language_from_filename): Update. * symtab.c (find_main_filename): Make result const. * dwarf2read.c (dw2_find_symbol_file): Change return type. * psymtab.c (find_symbol_file_from_partial): Change return type. * symfile.h (struct quick_symbol_functions) : Make result const. commit cf9fe5cf2be8b76820a05c966cdca6df5c2eee24 Author: Tom Tromey Date: Tue Jul 13 20:51:33 2010 +0000 gdb * breakpoint.c (save_cmdlist): No longer static. * gdbcmd.h (save_cmdlist): Declare. * symfile.c (symbol_file_add_with_addrs_or_offsets): Set OBJF_READNOW on objfile if readnow_symbol_files. * elfread.c (elf_symfile_read): Use dwarf2_initialize_objfile. (elf_sym_fns_gdb_index): New global. * dwarf2read.c: Include exceptions.h. (offset_type): New. (struct mapped_index): New. (dwarf2_per_cu_data_ptr): New typedef. (struct dwarf2_per_objfile) : New fields. (GDB_INDEX_SECTION): New define. (struct dwarf2_per_cu_quick_data): New. (struct dwarf2_per_cu_data) : New field. : Removed. : New field. (byte_swap): New function. (MAYBE_SWAP): New macro. (INDEX_SUFFIX): New macro. (dw2_do_instantiate_symtab): New function. (dw2_instantiate_symtab): Likewise. (create_cus_from_index): Likewise. (create_addrmap_from_index): Likewise. (mapped_index_string_hash): Likewise. (find_slot_in_mapped_hash): Likewise. (dwarf2_read_index): Likewise. (dw2_setup): Likewise. (dw2_require_line_header): Likewise. (dw2_require_full_path): Likewise. (dw2_find_last_source_symtab): Likewise. (dw2_forget_cached_source_info): Likewise. (dw2_lookup_symtab): Likewise. (dw2_lookup_symbol): Likewise. (dw2_do_expand_symtabs_matching): Likewise. (dw2_pre_expand_symtabs_matching): Likewise. (dw2_print_stats): Likewise. (dw2_dump): Likewise. (dw2_relocate): Likewise. (dw2_expand_symtabs_for_function): Likewise. (dw2_expand_all_symtabs): Likewise. (dw2_expand_symtabs_with_filename): Likewise. (dw2_find_symbol_file): Likewise. (dw2_map_ada_symtabs): Likewise. (dw2_expand_symtabs_matching): Likewise. (dw2_find_pc_sect_symtab): Likewise. (dw2_map_symbol_names): Likewise. (dw2_map_symbol_filenames): Likewise. (dw2_has_symbols): Likewise. (dwarf2_gdb_index_functions): New global. (dwarf2_initialize_objfile): New function. (process_psymtab_comp_unit): Update. (add_partial_subprogram): Likewise. (dwarf2_psymtab_to_symtab): Likewise. (psymtab_to_symtab_1): Use dw2_do_instantiate_symtab. (process_full_comp_unit): Update. (find_file_and_directory): New function. (read_file_scope): Use find_file_and_directory. (dwarf2_per_cu_objfile): Update. (dwarf2_per_cu_addr_size): Update. (dwarf2_per_cu_offset_size): Update. (dwarf2_free_objfile): Free the index, if needed. (dwarf2_per_objfile_free): Unmap the index, if needed. (struct strtab_entry): New. (hash_strtab_entry): New function. (eq_strtab_entry): Likewise. (create_strtab): Likewise. (add_string): Likewise. (struct symtab_index_entry): New. (struct mapped_symtab): New. (hash_symtab_entry): New function. (eq_symtab_entry): Likewise. (delete_symtab_entry): Likewise. (create_index_table): Likewise. (create_mapped_symtab): Likewise. (cleanup_mapped_symtab): Likewise. (find_slot): Likewise. (hash_expand): Likewise. (add_index_entry): Likewise. (add_indices_to_cpool): Likewise. (write_hash_table): Likewise. (add_address_entry): Likewise. (write_psymbols): Likewise. (write_obstack): Likewise. (unlink_if_set): Likewise. (write_psymtabs_to_index): Likewise. (save_gdb_index_command): Likewise. (_initialize_dwarf2_read): Install "save gdb-index" command. (create_all_comp_units): Initialize 'objfile' field of CU. (dwarf2_locate_sections): Check for .gdb_index. * psymtab.h (dwarf2_gdb_index_functions): Declare. * symfile.h (dwarf2_initialize_objfile): Declare. gdb/doc * gdb.texinfo (Index Files): New node. commit 3b7149376604e22488c7cd8fa1835500f14123cb Author: Tom Tromey Date: Tue Jul 13 20:49:25 2010 +0000 * symtab.c (lookup_symbol_aux_symtabs): Call pre-expand hook. (basic_lookup_transparent_type): Likewise. * symfile.h (struct quick_symbol_functions) : New field. * psymtab.c (pre_expand_symtabs_matching_psymtabs): New function. (psym_functions): Update. commit a75176511797cf00c5d30d1ce4de460e3a7e93e7 Author: Tom Tromey Date: Tue Jul 13 20:32:43 2010 +0000 * gdb.texinfo (GDB/MI Variable Objects): Remove extra 'for'. commit 2f4ebefb529248bd4b9342deaf725ad3850e776f Author: Tom Tromey Date: Tue Jul 13 20:07:40 2010 +0000 gdb PR breakpoints/8357: * symtab.h (domain_enum_tag) : Update comment. * linespec.c (decode_line_1): Update comment. Call decode_label. (decode_label): New function. (symbol_found): Handle LOC_LABEL. * dwarf2read.c (new_symbol) : Set symbol's type and domain. Call add_symbol_to_list. gdb/doc * gdb.texinfo (Specify Location): Document labels. gdb/testsuite * gdb.base/label.exp: New file. * gdb.base/label.c: New file. commit 07c0d258de6546976d81de85ff6b838631ef79d2 Author: H.J. Lu Date: Tue Jul 13 16:59:09 2010 +0000 Support garbage collection against STT_GNU_IFUNC symbols. bfd/ 2010-07-13 H.J. Lu PR ld/11791 * elf-ifunc.c (_bfd_elf_allocate_ifunc_dyn_relocs): Support garbage collection against STT_GNU_IFUNC symbols. * elf32-i386.c (elf_i386_get_local_sym_hash): Don't set elf.plt.offset/elf.got.offset to -1. (elf_i386_tls_transition): Skip TLS transition for functions. (elf_i386_gc_sweep_hook): Support STT_GNU_IFUNC symbols. * elf64-x86-64.c (elf64_x86_64_get_local_sym_hash): Don't set elf.plt.offset/elf.got.offset to -1. (elf64_x86_64_tls_transition): Skip TLS transition for functions. (elf64_x86_64_gc_sweep_hook): Support STT_GNU_IFUNC symbols. ld/testsuite/ 2010-07-13 H.J. Lu PR ld/11791 * ld-ifunc/ifunc-10-i386.d: New. * ld-ifunc/ifunc-10-i386.s: Likewise. * ld-ifunc/ifunc-10-x86-64.d: Likewise. * ld-ifunc/ifunc-10-x86-64.s: Likewise. * ld-ifunc/ifunc-11-i386.d: Likewise. * ld-ifunc/ifunc-11-i386.s: Likewise. * ld-ifunc/ifunc-11-x86-64.d: Likewise. * ld-ifunc/ifunc-11-x86-64.s: Likewise. commit 5996813199e48b2a39e4ee233624cf0e92afb165 Author: Tom Tromey Date: Tue Jul 13 15:09:03 2010 +0000 * dwarf2loc.h (dwarf2_per_cu_text_offset): Declare. * dwarf2loc.c (find_location_expression): Use dwarf2_per_cu_text_offset. (dwarf2_evaluate_loc_desc): Likewise. (dwarf2_loc_desc_needs_frame): Likewise. (compile_dwarf_to_ax): Likewise. (loclist_describe_location): Likewise. * dwarf2read.c (dwarf2_per_cu_text_offset): New function. (dwarf2_per_cu_objfile): Update comment. commit 2162fa558a006758db2f2b2cc4e863d5cfc37a70 Author: gdbadmin Date: Tue Jul 13 00:00:33 2010 +0000 *** empty log message *** commit 3f5f43e44adb3cc5fd3e262c9c053888379fc106 Author: Alan Modra Date: Tue Jul 13 00:00:05 2010 +0000 daily update commit f4b94fa4c6f6db0fe0d9f6a39e8ac9061e1e6952 Author: H.J. Lu Date: Mon Jul 12 21:13:24 2010 +0000 Re-indent elf32-i386.c. 2010-07-12 H.J. Lu * elf32-i386.c (elf_i386_check_relocs): Re-indent. (elf_i386_relocate_section): Likewise. commit 205148e7c30b927881094a02483218c8bd8df64b Author: H.J. Lu Date: Mon Jul 12 17:33:14 2010 +0000 Add is_ilp32_target/is_lp64_target. 2010-07-12 Ulrich Weigand H.J. Lu * lib/gdb.exp (is_ilp32_target): New. (is_lp64_target): Likewise. * gdb.arch/amd64-byte.exp: Use is_lp64_target to check 64bit target. * gdb.arch/amd64-disp-step.exp: Likewise. * gdb.arch/amd64-dword.exp: Likewise. * gdb.arch/amd64-i386-address.exp: Likewise. * gdb.arch/amd64-word.exp: Likewise. * gdb.arch/i386-avx.exp: Use is_ilp32_target to check for 32bit target. * gdb.arch/i386-bp_permanent.exp: Likewise. * gdb.arch/i386-byte.exp: Likewise. * gdb.arch/i386-disp-step.exp: Likewise. * gdb.arch/i386-gnu-cfi.exp: Likewise. * gdb.arch/i386-prologue.exp: Likewise. * gdb.arch/i386-size-overlap.exp: Likewise. * gdb.arch/i386-size.exp: Likewise. * gdb.arch/i386-sse.exp: Likewise. * gdb.arch/i386-unwind.exp: Likewise. * gdb.arch/i386-word.exp: Likewise. * gdb.arch/ppc64-atomic-inst.exp: Use is_lp64_target to execute test only when building 64-bit executables. Do not hard-code -m64 option. commit 118b5358b53238935035a69fc53b1b58146a882e Author: Jan Kratochvil Date: Mon Jul 12 17:07:10 2010 +0000 gdb/ * dwarf2read.c (read_subrange_type): Call read_subrange_type. * p-lang.c (pascal_printstr): Likewise. commit f30af08ff7ed71e4a098a3aa0168a08e8488f43d Author: gdbadmin Date: Mon Jul 12 00:00:33 2010 +0000 *** empty log message *** commit f714c2bce86c209089d11c14abcb5fc809dcfc79 Author: Alan Modra Date: Mon Jul 12 00:00:06 2010 +0000 daily update commit 052d997d8e842324347d84f38e1beeeb72a18d2c Author: gdbadmin Date: Sun Jul 11 00:00:33 2010 +0000 *** empty log message *** commit 4a73d497fc452a2e851451967dab4ac546494837 Author: Alan Modra Date: Sun Jul 11 00:00:05 2010 +0000 daily update commit 63fdd5f738504701b67d5ab3567e4f9b8834f6f2 Author: Alan Modra Date: Sat Jul 10 00:00:06 2010 +0000 daily update commit 76dc1f75c17730fd15e7cfb04a566374878438b9 Author: gdbadmin Date: Sat Jul 10 00:00:03 2010 +0000 *** empty log message *** commit 66ea253c5a0da89a2acd5994521ce3ed5cbe3368 Author: Tom Tromey Date: Fri Jul 9 20:29:56 2010 +0000 * python/py-prettyprint.c (gdbpy_get_display_hint): Don't use 'hint' if it is NULL. ----------------------------------------------------------------------- Summary of changes: ChangeLog | 8 + Makefile.in | 1 + Makefile.tpl | 1 + bfd/ChangeLog | 55 + bfd/dwarf2.c | 92 +- bfd/elf-ifunc.c | 9 + bfd/elf.c | 46 +- bfd/elf32-i386.c | 64 +- bfd/elf64-x86-64.c | 48 +- bfd/version.h | 2 +- gdb/ChangeLog | 280 ++++ gdb/MAINTAINERS | 1 + gdb/NEWS | 15 + gdb/ada-lang.c | 2 +- gdb/breakpoint.c | 12 +- gdb/breakpoint.h | 1 + gdb/c-valprint.c | 3 +- gdb/corefile.c | 13 +- gdb/corelow.c | 10 +- gdb/defs.h | 3 + gdb/doc/ChangeLog | 23 + gdb/doc/gdb.texinfo | 91 +- gdb/dwarf2loc.c | 17 +- gdb/dwarf2loc.h | 10 +- gdb/dwarf2read.c | 1720 ++++++++++++++++++++++++- gdb/elfread.c | 29 +- gdb/gdbarch.h | 3 +- gdb/gdbarch.sh | 3 +- gdb/gdbcmd.h | 4 + gdb/gdbcore.h | 2 + gdb/gdbserver/ChangeLog | 6 + gdb/gdbserver/server.c | 4 +- gdb/gdbserver/utils.c | 20 +- gdb/inf-ptrace.c | 31 +- gdb/infrun.c | 3 +- gdb/linespec.c | 38 +- gdb/linux-nat.c | 28 +- gdb/p-lang.c | 6 +- gdb/psymtab.c | 11 +- gdb/psymtab.h | 4 +- gdb/python/py-prettyprint.c | 8 +- gdb/record.c | 66 +- gdb/symfile.c | 9 +- gdb/symfile.h | 12 +- gdb/symtab.c | 135 ++- gdb/symtab.h | 28 +- gdb/target.c | 100 +- gdb/target.h | 7 +- gdb/testsuite/ChangeLog | 55 + gdb/testsuite/gdb.arch/altivec-abi.exp | 10 + gdb/testsuite/gdb.arch/amd64-byte.exp | 2 +- gdb/testsuite/gdb.arch/amd64-disp-step.exp | 2 +- gdb/testsuite/gdb.arch/amd64-dword.exp | 2 +- gdb/testsuite/gdb.arch/amd64-i386-address.exp | 2 +- gdb/testsuite/gdb.arch/amd64-word.exp | 2 +- gdb/testsuite/gdb.arch/i386-avx.exp | 2 +- gdb/testsuite/gdb.arch/i386-bp_permanent.exp | 2 +- gdb/testsuite/gdb.arch/i386-byte.exp | 2 +- gdb/testsuite/gdb.arch/i386-disp-step.exp | 2 +- gdb/testsuite/gdb.arch/i386-gnu-cfi.exp | 2 +- gdb/testsuite/gdb.arch/i386-prologue.exp | 2 +- gdb/testsuite/gdb.arch/i386-size-overlap.exp | 2 +- gdb/testsuite/gdb.arch/i386-size.exp | 2 +- gdb/testsuite/gdb.arch/i386-sse.exp | 2 +- gdb/testsuite/gdb.arch/i386-unwind.exp | 2 +- gdb/testsuite/gdb.arch/i386-word.exp | 2 +- gdb/testsuite/gdb.arch/ppc64-atomic-inst.exp | 6 +- gdb/testsuite/gdb.base/corefile.exp | 59 + gdb/testsuite/gdb.base/coremaker.c | 8 +- gdb/testsuite/gdb.base/label.c | 21 + gdb/testsuite/gdb.base/label.exp | 59 + gdb/testsuite/gdb.python/py-prettyprint.c | 11 + gdb/testsuite/gdb.python/py-prettyprint.exp | 2 + gdb/testsuite/lib/gdb.exp | 77 ++ gdb/tracepoint.c | 2 - gdb/utils.c | 18 + gdb/valops.c | 6 +- gdb/version.in | 2 +- include/elf/ChangeLog | 7 + include/elf/internal.h | 54 +- 80 files changed, 3127 insertions(+), 386 deletions(-) create mode 100644 gdb/testsuite/gdb.base/label.c create mode 100644 gdb/testsuite/gdb.base/label.exp First 500 lines of diff: diff --git a/ChangeLog b/ChangeLog index 5759b30..2bfa992 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2010-07-17 Jack Howarth + + PR target/44862 + * Makefile.tpl (POSTSTAGE1_CXX_EXPORT): + Provide -B option to allow for link spec %s substitutions for + libstdc++.a on darwin. + * Makefile.in: Regenerate. + 2010-06-10 Alexandre Oliva * Makefile.def (configure-gcc): Depend on all-libelf. diff --git a/Makefile.in b/Makefile.in index 22a77d2..3268a30 100644 --- a/Makefile.in +++ b/Makefile.in @@ -235,6 +235,7 @@ POSTSTAGE1_CXX_EXPORT = \ POSTSTAGE1_CXX_EXPORT = \ CXX="$(STAGE_CC_WRAPPER) $$r/$(HOST_SUBDIR)/prev-gcc/g++$(exeext) \ -B$$r/$(HOST_SUBDIR)/prev-gcc/ -B$(build_tooldir)/bin/ -nostdinc++ \ + -B$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/src/.libs \ -I$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/include/$(TARGET_SUBDIR) \ -I$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/include \ -I$$s/libstdc++-v3/libsupc++ \ diff --git a/Makefile.tpl b/Makefile.tpl index 98b526c..1f0419c 100644 --- a/Makefile.tpl +++ b/Makefile.tpl @@ -238,6 +238,7 @@ POSTSTAGE1_CXX_EXPORT = \ POSTSTAGE1_CXX_EXPORT = \ CXX="$(STAGE_CC_WRAPPER) $$r/$(HOST_SUBDIR)/prev-gcc/g++$(exeext) \ -B$$r/$(HOST_SUBDIR)/prev-gcc/ -B$(build_tooldir)/bin/ -nostdinc++ \ + -B$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/src/.libs \ -I$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/include/$(TARGET_SUBDIR) \ -I$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/include \ -I$$s/libstdc++-v3/libsupc++ \ diff --git a/bfd/ChangeLog b/bfd/ChangeLog index ea86440..aa36284 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,58 @@ +2010-07-20 Alan Modra + + * elf.c (assign_file_positions_for_load_sections): Check that + zero size sections are allocated in segments too. + (assign_file_positions_for_non_load_sections): Warn if zero + size alloc sections are found here. + (copy_elf_program_header): Don't drop zero size sections from + segment map. + (copy_private_bfd_data): Check for changes in zero size sections. + +2010-07-17 Alan Modra + + * elf.c (_bfd_elf_map_sections_to_segments): Force new segment + for sections with overlapping LMAs. + (assign_file_positions_for_load_sections): Catch overlap for + sections that wrap around the address space. Replace a + warning that duplicates ld's --check-sections error with a + warning that lma has been adjusted for overlapping sections. + +2010-07-14 Cary Coutant + + PR ld/11817 + * dwarf2.c (read_section): Revert patch for compressed debug sections. + (find_line): Likewise. + (read_and_uncompress_section): Remove. + +2010-07-13 H.J. Lu + + PR ld/11812 + * elf32-i386.c (elf_i386_size_dynamic_sections): Don't + allocate .got.plt section if there are no GOT nor PLT + entries. + * elf64-x86-64.c (elf64_x86_64_size_dynamic_sections): Likewise. + +2010-07-13 H.J. Lu + + PR ld/11791 + * elf-ifunc.c (_bfd_elf_allocate_ifunc_dyn_relocs): Support + garbage collection against STT_GNU_IFUNC symbols. + + * elf32-i386.c (elf_i386_get_local_sym_hash): Don't set + elf.plt.offset/elf.got.offset to -1. + (elf_i386_tls_transition): Skip TLS transition for functions. + (elf_i386_gc_sweep_hook): Support STT_GNU_IFUNC symbols. + + * elf64-x86-64.c (elf64_x86_64_get_local_sym_hash): Don't set + elf.plt.offset/elf.got.offset to -1. + (elf64_x86_64_tls_transition): Skip TLS transition for functions. + (elf64_x86_64_gc_sweep_hook): Support STT_GNU_IFUNC symbols. + +2010-07-12 H.J. Lu + + * elf32-i386.c (elf_i386_check_relocs): Re-indent. + (elf_i386_relocate_section): Likewise. + 2010-07-06 H.J. Lu * dwarf2.c (add_line_info): Initialize prev_line. diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c index 6983a1c..1285833 100644 --- a/bfd/dwarf2.c +++ b/bfd/dwarf2.c @@ -405,54 +405,6 @@ lookup_info_hash_table (struct info_hash_table *hash_table, const char *key) return entry ? entry->head : NULL; } -/* Read a section, uncompress it if necessary, and relocate it. */ - -static bfd_boolean -read_and_uncompress_section (bfd * abfd, - asection * msec, - bfd_boolean section_is_compressed, - asymbol ** syms, - bfd_byte ** section_buffer, - bfd_size_type * section_size) -{ - /* Get the unrelocated contents of the section. */ - *section_buffer = (bfd_byte *) bfd_malloc (*section_size); - if (! *section_buffer) - return FALSE; - if (! bfd_get_section_contents (abfd, msec, *section_buffer, - 0, *section_size)) - return FALSE; - - if (section_is_compressed) - { - if (! bfd_uncompress_section_contents (section_buffer, section_size)) - { - (*_bfd_error_handler) (_("Dwarf Error: unable to decompress %s section."), - bfd_get_section_name (abfd, msec)); - bfd_set_error (bfd_error_bad_value); - return FALSE; - } - } - - if (syms) - { - /* We want to relocate the data we've already read (and - decompressed), so we store a pointer to the data in - the bfd_section, and tell it that the contents are - already in memory. */ - BFD_ASSERT (msec->contents == NULL && (msec->flags & SEC_IN_MEMORY) == 0); - msec->contents = *section_buffer; - msec->flags |= SEC_IN_MEMORY; - msec->size = *section_size; - *section_buffer - = bfd_simple_get_relocated_section_contents (abfd, msec, NULL, syms); - if (! *section_buffer) - return FALSE; - } - - return TRUE; -} - /* Read a section into its appropriate place in the dwarf2_debug struct (indicated by SECTION_BUFFER and SECTION_SIZE). If SYMS is not NULL, use bfd_simple_get_relocated_section_contents to read the @@ -488,10 +440,32 @@ read_section (bfd * abfd, } *section_size = msec->rawsize ? msec->rawsize : msec->size; + if (syms) + { + *section_buffer + = bfd_simple_get_relocated_section_contents (abfd, msec, NULL, syms); + if (! *section_buffer) + return FALSE; + } + else + { + *section_buffer = (bfd_byte *) bfd_malloc (*section_size); + if (! *section_buffer) + return FALSE; + if (! bfd_get_section_contents (abfd, msec, *section_buffer, + 0, *section_size)) + return FALSE; + } - if (! read_and_uncompress_section (abfd, msec, section_is_compressed, - syms, section_buffer, section_size)) - return FALSE; + if (section_is_compressed) + { + if (! bfd_uncompress_section_contents (section_buffer, section_size)) + { + (*_bfd_error_handler) (_("Dwarf Error: unable to decompress %s section."), compressed_section_name); + bfd_set_error (bfd_error_bad_value); + return FALSE; + } + } } /* It is possible to get a bad value for the offset into the section @@ -3269,17 +3243,23 @@ find_line (bfd *abfd, { bfd_size_type size = msec->size; bfd_byte *buffer, *tmp; - bfd_boolean is_compressed = - strcmp (msec->name, DWARF2_COMPRESSED_DEBUG_INFO) == 0; if (size == 0) continue; - if (! read_and_uncompress_section (debug_bfd, msec, - is_compressed, symbols, - &buffer, &size)) + buffer = (bfd_simple_get_relocated_section_contents + (debug_bfd, msec, NULL, symbols)); + if (! buffer) goto done; + if (strcmp (msec->name, DWARF2_COMPRESSED_DEBUG_INFO) == 0) + { + if (! bfd_uncompress_section_contents (&buffer, &size)) + { + free (buffer); + goto done; + } + } tmp = (bfd_byte *) bfd_realloc (stash->info_ptr_memory, total_size + size); if (tmp == NULL) diff --git a/bfd/elf-ifunc.c b/bfd/elf-ifunc.c index 0de236f..760fc26 100644 --- a/bfd/elf-ifunc.c +++ b/bfd/elf-ifunc.c @@ -187,6 +187,15 @@ _bfd_elf_allocate_ifunc_dyn_relocs (struct bfd_link_info *info, htab = elf_hash_table (info); + /* Support garbage collection against STT_GNU_IFUNC symbols. */ + if (h->plt.refcount <= 0 && h->got.refcount <= 0) + { + h->got = htab->init_got_offset; + h->plt = htab->init_plt_offset; + *head = NULL; + return TRUE; + } + /* Return and discard space for dynamic relocations against it if it is never referenced in a non-shared object. */ if (!h->ref_regular) diff --git a/bfd/elf.c b/bfd/elf.c index 0fa75d2..e7651ba 100644 --- a/bfd/elf.c +++ b/bfd/elf.c @@ -3736,6 +3736,13 @@ _bfd_elf_map_sections_to_segments (bfd *abfd, struct bfd_link_info *info) segment. */ new_segment = TRUE; } + else if (hdr->lma < last_hdr->lma + last_size + || last_hdr->lma + last_size < last_hdr->lma) + { + /* If this section has a load address that makes it overlap + the previous section, then we need a new segment. */ + new_segment = TRUE; + } /* In the next test we have to be careful when last_hdr->lma is close to the end of the address space. If the aligned address wraps around to the start of the address space, then there are no more @@ -4457,15 +4464,19 @@ assign_file_positions_for_load_sections (bfd *abfd, && ((this_hdr->sh_flags & SHF_TLS) == 0 || p->p_type == PT_TLS)))) { - bfd_vma adjust = sec->lma - (p->p_paddr + p->p_memsz); + bfd_vma p_start = p->p_paddr; + bfd_vma p_end = p_start + p->p_memsz; + bfd_vma s_start = sec->lma; + bfd_vma adjust = s_start - p_end; - if (sec->lma < p->p_paddr + p->p_memsz) + if (s_start < p_end + || p_end < p_start) { (*_bfd_error_handler) - (_("%B: section %A lma 0x%lx overlaps previous sections"), - abfd, sec, (unsigned long) sec->lma); + (_("%B: section %A lma %#lx adjusted to %#lx"), abfd, sec, + (unsigned long) s_start, (unsigned long) p_end); adjust = 0; - sec->lma = p->p_paddr + p->p_memsz; + sec->lma = p_end; } p->p_memsz += adjust; @@ -4578,8 +4589,7 @@ assign_file_positions_for_load_sections (bfd *abfd, sec = m->sections[i]; this_hdr = &(elf_section_data(sec)->this_hdr); - if (this_hdr->sh_size != 0 - && !ELF_SECTION_IN_SEGMENT_1 (this_hdr, p, check_vma)) + if (!ELF_SECTION_IN_SEGMENT_1 (this_hdr, p, check_vma, 0)) { (*_bfd_error_handler) (_("%B: section `%A' can't be allocated in segment %d"), @@ -4629,13 +4639,12 @@ assign_file_positions_for_non_load_sections (bfd *abfd, BFD_ASSERT (hdr->sh_offset == hdr->bfd_section->filepos); else if ((hdr->sh_flags & SHF_ALLOC) != 0) { - if (hdr->sh_size != 0) - ((*_bfd_error_handler) - (_("%B: warning: allocated section `%s' not in segment"), - abfd, - (hdr->bfd_section == NULL - ? "*unknown*" - : hdr->bfd_section->name))); + (*_bfd_error_handler) + (_("%B: warning: allocated section `%s' not in segment"), + abfd, + (hdr->bfd_section == NULL + ? "*unknown*" + : hdr->bfd_section->name)); /* We don't need to page align empty sections. */ if ((abfd->flags & D_PAGED) != 0 && hdr->sh_size != 0) off += vma_page_aligned_bias (hdr->sh_addr, off, @@ -5857,8 +5866,7 @@ copy_elf_program_header (bfd *ibfd, bfd *obfd) section = section->next) { this_hdr = &(elf_section_data(section)->this_hdr); - if (this_hdr->sh_size != 0 - && ELF_SECTION_IN_SEGMENT (this_hdr, segment)) + if (ELF_SECTION_IN_SEGMENT (this_hdr, segment)) { if (!first_section) first_section = lowest_section = section; @@ -5937,8 +5945,7 @@ copy_elf_program_header (bfd *ibfd, bfd *obfd) section = section->next) { this_hdr = &(elf_section_data(section)->this_hdr); - if (this_hdr->sh_size != 0 - && ELF_SECTION_IN_SEGMENT (this_hdr, segment)) + if (ELF_SECTION_IN_SEGMENT (this_hdr, segment)) { map->sections[isec++] = section->output_section; if (isec == section_count) @@ -6015,8 +6022,7 @@ copy_private_bfd_data (bfd *ibfd, bfd *obfd) /* Check if this section is covered by the segment. */ this_hdr = &(elf_section_data(section)->this_hdr); - if (this_hdr->sh_size != 0 - && ELF_SECTION_IN_SEGMENT (this_hdr, segment)) + if (ELF_SECTION_IN_SEGMENT (this_hdr, segment)) { /* FIXME: Check if its output section is changed or removed. What else do we need to check? */ diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c index 7964c4f..0ff3147 100644 --- a/bfd/elf32-i386.c +++ b/bfd/elf32-i386.c @@ -789,8 +789,6 @@ elf_i386_get_local_sym_hash (struct elf_i386_link_hash_table *htab, ret->elf.indx = sec->id; ret->elf.dynstr_index = ELF32_R_SYM (rel->r_info); ret->elf.dynindx = -1; - ret->elf.plt.offset = (bfd_vma) -1; - ret->elf.got.offset = (bfd_vma) -1; *slot = ret; } return &ret->elf; @@ -1162,6 +1160,12 @@ elf_i386_tls_transition (struct bfd_link_info *info, bfd *abfd, unsigned int to_type = from_type; bfd_boolean check = TRUE; + /* Skip TLS transition for functions. */ + if (h != NULL + && (h->type == STT_FUNC + || h->type == STT_GNU_IFUNC)) + return TRUE; + switch (from_type) { case R_386_TLS_GD: @@ -1330,8 +1334,7 @@ elf_i386_check_relocs (bfd *abfd, /* Check relocation against local STT_GNU_IFUNC symbol. */ if (ELF32_ST_TYPE (isym->st_info) == STT_GNU_IFUNC) { - h = elf_i386_get_local_sym_hash (htab, abfd, rel, - TRUE); + h = elf_i386_get_local_sym_hash (htab, abfd, rel, TRUE); if (h == NULL) return FALSE; @@ -1820,6 +1823,23 @@ elf_i386_gc_sweep_hook (bfd *abfd, break; } } + else + { + /* A local symbol. */ + Elf_Internal_Sym *isym; + + isym = bfd_sym_from_r_symndx (&htab->sym_cache, + abfd, r_symndx); + + /* Check relocation against local STT_GNU_IFUNC symbol. */ + if (isym != NULL + && ELF32_ST_TYPE (isym->st_info) == STT_GNU_IFUNC) + { + h = elf_i386_get_local_sym_hash (htab, abfd, rel, FALSE); + if (h == NULL) + abort (); + } + } r_type = ELF32_R_TYPE (rel->r_info); if (! elf_i386_tls_transition (info, abfd, sec, NULL, @@ -1846,6 +1866,11 @@ elf_i386_gc_sweep_hook (bfd *abfd, { if (h->got.refcount > 0) h->got.refcount -= 1; + if (h->type == STT_GNU_IFUNC) + { + if (h->plt.refcount > 0) + h->plt.refcount -= 1; + } } else if (local_got_refcounts != NULL) { @@ -1868,6 +1893,16 @@ elf_i386_gc_sweep_hook (bfd *abfd, } break; + case R_386_GOTOFF: + if (h != NULL && h->type == STT_GNU_IFUNC) + { + if (h->got.refcount > 0) + h->got.refcount -= 1; + if (h->plt.refcount > 0) + h->plt.refcount -= 1; + } + break; + default: break; } @@ -2520,6 +2555,23 @@ elf_i386_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, if (htab->elf.srelplt) htab->sgotplt_jump_table_size = htab->next_tls_desc_index * 4; + if (htab->elf.sgotplt) + { + /* Don't allocate .got.plt section if there are no GOT nor PLT + entries. */ + if ((htab->elf.sgotplt->size + == get_elf_backend_data (output_bfd)->got_header_size) + && (htab->elf.splt == NULL + || htab->elf.splt->size == 0) + && (htab->elf.sgot == NULL + || htab->elf.sgot->size == 0) + && (htab->elf.iplt == NULL + || htab->elf.iplt->size == 0) + && (htab->elf.igotplt == NULL + || htab->elf.igotplt->size == 0)) + htab->elf.sgotplt->size = 0; + } + /* We now have determined the sizes of the various dynamic sections. Allocate memory for them. */ relocs = FALSE; @@ -2934,8 +2986,8 @@ elf_i386_relocate_section (bfd *output_bfd, && ELF32_ST_TYPE (sym->st_info) == STT_GNU_IFUNC) { /* Relocate against local STT_GNU_IFUNC symbol. */ - h = elf_i386_get_local_sym_hash (htab, input_bfd, - rel, FALSE); + h = elf_i386_get_local_sym_hash (htab, input_bfd, rel, + FALSE); if (h == NULL) abort (); diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c index 21524fa..b0bc5c0 100644 --- a/bfd/elf64-x86-64.c +++ b/bfd/elf64-x86-64.c @@ -603,8 +603,6 @@ elf64_x86_64_get_local_sym_hash (struct elf64_x86_64_link_hash_table *htab, ret->elf.indx = sec->id; ret->elf.dynstr_index = ELF64_R_SYM (rel->r_info); ret->elf.dynindx = -1; - ret->elf.plt.offset = (bfd_vma) -1; - ret->elf.got.offset = (bfd_vma) -1; *slot = ret; } return &ret->elf; @@ -951,6 +949,12 @@ elf64_x86_64_tls_transition (struct bfd_link_info *info, bfd *abfd, unsigned int to_type = from_type; bfd_boolean check = TRUE; + /* Skip TLS transition for functions. */ + if (h != NULL + && (h->type == STT_FUNC + || h->type == STT_GNU_IFUNC)) + return TRUE; + switch (from_type) { case R_X86_64_TLSGD: hooks/post-receive -- Repository for Project Archer.