summaryrefslogtreecommitdiff
path: root/gold
Commit message (Collapse)AuthorAgeFilesLines
* 2012-05-25 Sriraman Tallam <tmsriram@google.com>Sriraman Tallam2012-05-252-0/+6
| | | | | * symtab.cc (Symbol_table::define_special_symbol): Initialize *poldsym to prevent uninitialized variable errors.
* gold/Cary Coutant2012-05-242-3/+24
| | | | | | * layout.cc (Layout::section_name_mapping): Add rules to handle exact match on .data.rel.ro.local or .data.rel.ro. (Layout::output_section_name): Check for exact matches.
* gold/Cary Coutant2012-05-232-2/+7
| | | | | * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.* more carefully.
* gold/Cary Coutant2012-05-222-2/+8
| | | | | * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable object before exporting symbol.
* Include "config.h" firstH.J. Lu2012-05-213-2/+7
| | | | | * testsuite/tls_test.cc: Include "config.h" first. * testsuite/tls_test_c.c: Likewise.
* PR 14072Nick Clifton2012-05-174-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* gold/Cary Coutant2012-05-143-1/+13
| | | | | | * layout.cc (Layout::make_output_section): Mark .tdata section as RELRO. * testsuite/relro_test.cc: Add a TLS variable.
* Handle R_X86_64_64 properly for x32H.J. Lu2012-05-112-1/+10
| | | | | | | | | | | | | | elfcpp/ PR gold/14091 * x86_64.h (R_X86_64_RELATIVE64): New. gold/ PR gold/14091 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of R_X86_64_64.
* gold/Cary Coutant2012-05-082-5/+14
| | | | | * layout.cc (gdb_sections): Update GDB version, add .debug_addr. (lines_only_debug_sections): Likewise.
* * configure.ac (ENABLE_GOLD): Consider *-*-nacl* targets ELF.Roland McGrath2012-05-0221-2575/+4617
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * configure: Regenerate. gold/ * nacl.cc: New file. * nacl.h: New file. * Makefile.am (CCFILES, HFILES): Add them. * Makefile.in: Regenerate. * i386.cc (Output_data_plt_i386_nacl): New class. (Output_data_plt_i386_nacl_exec): New class. (Output_data_plt_i386_nacl_dyn): New class. (Target_i386_nacl): New class. (Target_selector_i386_nacl): New class. (target_selector_i386): Use it instead of Target_selector_i386. * x86_64.cc (Output_data_plt_x86_64_nacl): New class. (Target_x86_64_nacl): New class. (Target_selector_x86_64_nacl): New class. (target_selector_x86_64, target_selector_x32): Use it instead of Target_selector_x86_64. * arm.cc (Output_data_plt_arm_nacl): New class. (Target_arm_nacl): New class. (Target_selector_arm_nacl): New class. (target_selector_arm, target_selector_armbe): Use it instead of Target_selector_arm. * target-select.cc (select_target): Take new Input_file* and off_t arguments, pass them on to recognize method of selector. * object.cc (make_elf_sized_object): Update caller. * parameters.cc (parameters_force_valid_target): Likewise. * incremental.cc (make_sized_incremental_binary): Likewise. * target-select.h: Update decl. (Target_selector::recognize): Take new Input_file* argument, pass it on to do_recognize. (Target_selector::do_recognize): Take new Input_file* argument. * freebsd.h (Target_selector_freebsd::do_recognize): Likewise. * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise. * sparc.cc (Target_selector_sparc::do_recognize): Likewise. * testsuite/testfile.cc (Target_selector::do_recognize): Likewise. * target.h (Target::Target_info): New members isolate_execinstr and rosegment_gap. (Target::isolate_execinstr, Target::rosegment_gap): New methods. * arm.cc (Target_arm::arm_info): Update initializer. * i386.cc (Target_i386::i386_info): Likewise. * powerpc.cc (Target_powerpc::powerpc_info): Likewise. * sparc.cc (Target_sparc::sparc_info): Likewise. * x86_64.cc (Target_x86_64::x86_64_info): Likewise. * testsuite/testfile.cc (Target_test::test_target_info): Likewise. * layout.cc (Layout::attach_allocated_section_to_segment): Take new const Target* argument. If target->isolate_execinstr(), act like --rosegment. (Layout::find_first_load_seg): Take new const Target* argument; if target->isolate_execinstr(), reject PF_X segments. (Layout::relaxation_loop_body): Update caller. (Layout::set_segment_offsets): If target->isolate_execinstr(), reset file offset to zero when we hit LOAD_SEG, and then do a second loop over the segments before LOAD_SEG to reassign offsets after addresses have been determined. Handle target->rosegment_gap(). (Layout::attach_section_to_segment): Take new const Target* argument; pass it to attach_allocated_section_to_segment. (Layout::make_output_section): Update caller. (Layout::attach_sections_to_segments): Take new const Target* argument; pass it to attach_section_to_segment. * gold.cc (queue_middle_tasks): Update caller. * layout.h (Layout): Update method decls with new arguments. * arm.cc (Target_arm::Target_arm): Take optional argument for the Target_info pointer to use. (Target_arm::do_make_data_plt): New virtual method. (Target_arm::make_data_plt): New method that calls it. (Target_arm::make_plt_entry): Use it. (Output_data_plt_arm::Output_data_plt_arm): Take additional argument for the section alignment. (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual method. (Output_data_plt_arm::first_plt_entry_offset): Call it. (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual method. (Output_data_plt_arm::get_plt_entry_size): Call it. (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method. (Output_data_plt_arm::fill_plt_entry): New method that calls it. (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual method. (Output_data_plt_arm::fill_first_plt_entry): New method that calls it. (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size method instead of sizeof(plt_entry). (Output_data_plt_arm::add_entry): Likewise. Use first_plt_entry_offset method instead of sizeof(first_plt_entry). (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather than static method. (Target_arm::plt_entry_size): Likewise. (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry): Move to ... (Output_data_plt_arm_standard): ... here, new class. (Output_data_plt_arm::do_write): Move guts of PLT filling to... (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ... (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here. * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64): Take additional argument for the PLT entry size. (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Use get_plt_entry_size method rather than plt_entry_size variable. (Output_data_plt_x86_64::reserve_slot): Likewise. (Output_data_plt_x86_64::do_adjust_output_section): Likewise. (Output_data_plt_x86_64::add_entry): Likewise. (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise. (Output_data_plt_x86_64::address_for_global): Likewise. (Output_data_plt_x86_64::address_for_local): Likewise. (Output_data_plt_x86_64::set_final_data_size): Likewise. (Output_data_plt_x86_64::first_plt_entry_offset): Likewise. Make method non-static. (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual method. (Output_data_plt_x86_64::get_plt_entry_size): Just call that. (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method. (Output_data_plt_x86_64::add_eh_frame): New method to call it. (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract virtual method. (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it. (Output_data_plt_x86_64::do_fill_plt_entry): New abstract virtual method. (Output_data_plt_x86_64::fill_plt_entry): New method to call it. (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract virtual method. (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it. (Output_data_plt_x86_64::plt_entry_size) (Output_data_plt_x86_64::first_plt_entry) (Output_data_plt_x86_64::plt_entry) (Output_data_plt_x86_64::tlsdesc_plt_entry) (Output_data_plt_x86_64::plt_eh_frame_fde_size) (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ... (Output_data_plt_x86_64_standard): ... here, new class. (Target_x86_64::Target_x86_64): Take optional argument for the Target_info pointer to use. (Target_x86_64::do_make_data_plt): New virtual method. (Target_x86_64::make_data_plt): New method to call it. (Target_x86_64::init_got_plt_for_update): Use that. Call this->plt_->add_eh_frame method here. (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here. (Target_x86_64::first_plt_entry_offset): Call method on this->plt_ rather than static method. (Target_x86_64::plt_entry_size): Likewise. (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method rather than plt_entry_size variable. Move guts of PLT filling to... (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ... (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ... (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here. * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take additional argument for the section alignment. Don't do add_eh_frame_for_plt here. (Output_data_plt_i386::first_plt_entry_offset): Make the method non-static. Use get_plt_entry_size method rather than plt_entry_size variable. (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual method. (Output_data_plt_i386::get_plt_entry_size): Call it. (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method. (Output_data_plt_i386::add_eh_frame): New method to call it. (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual method. (Output_data_plt_i386::fill_first_plt_entry): New method to call it. (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual method. (Output_data_plt_i386::fill_plt_entry): New method to call it. (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size method instead of plt_entry_size. (Output_data_plt_i386::plt_entry_size) (Output_data_plt_i386::plt_eh_frame_fde_size) (Output_data_plt_i386::plt_eh_frame_fde): Move to ... (Output_data_plt_i386_standard): ... here, new class. (Output_data_plt_i386_exec): New class. (Output_data_plt_i386::exec_first_plt_entry): Move to ... (Output_data_plt_i386_exec::first_plt_entry): ... here. (Output_data_plt_i386::exec_plt_entry): Move to ... (Output_data_plt_i386_exec::plt_entry): ... here. (Output_data_plt_i386_dyn): New class. (Output_data_plt_i386::first_plt_entry): Move to ... (Output_data_plt_i386_dyn::first_plt_entry): ... here. (Output_data_plt_i386::dyn_plt_entry): Move to ... (Output_data_plt_i386_dyn::plt_entry): ... here. (Target_i386::Target_i386): Take optional argument for the Target_info pointer to use. (Target_i386::do_make_data_plt): New virtual method. (Target_i386::make_data_plt): New method to call it. (Target_i386::make_plt_section): Use that. Call this->plt_->add_eh_frame method here. (Output_data_plt_i386::add_entry): Use get_plt_entry_size method rather than plt_entry_size variable. (Output_data_plt_i386::add_local_ifunc_entry): Likewise. (Output_data_plt_i386::address_for_local): Likewise. (Output_data_plt_i386::do_write): Likewise. Move guts of PLT filling to... (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ... (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ... (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ... (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here. Change-Id: Id24b95600489835ff5e860a39c147203d4380c2b
* elfcpp/Cary Coutant2012-05-013-9/+11
| | | | | | | | | | | | | | | * dwarf.h (enum DW_TAG, enum DW_FORM, enum DW_AT, enum DW_ENCODING) (enum DW_OP, enum DW_CFA): Remove. Include dwarf2.def. gold/ * dwarf_reader.cc (Dwarf_die::read_attributes) (Dwarf_die::skip_attributes, Dwarf_die::int_attribute) (Dwarf_die::uint_attribute): Remove DW_FORM_null. * reduced_debug_output.cc (Output_reduced_debug_info_section::get_die_end): Remove DW_FORM_GNU_ref_index. Add default case.
* [Checking in missing files from previous commit.]Cary Coutant2012-05-012-0/+88
| | | | | * testsuite/gdb_index_test_3.c: New test source file. * testsuite/gdb_index_test_3.sh: New test source file.
* gold: Handle DW_AT_high_pc as offset from DW_AT_low_pc in gdb-index.cc.Mark Wielaard2012-05-016-24/+82
| | | | | | | | | | | | * dwarf_reader.cc (Dwarf_die::address_attribute): New function. * dwarf_reader.h (Dwarf_die::address_attribute): Likewise. * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle DW_AT_high_pc as offset from DW_AT_low_pc. * testsuite/Makefile.am (gdb_index_test_3.sh): New test case. * testsuite/Makefile.in: Regenerate. * testsuite/gdb_index_test_3.c: New test source file. * testsuite/gdb_index_test_3.sh: New test source file.
* * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a constIan Lance Taylor2012-04-266-11/+26
| | | | | | | | | | | | pointer. (Stub_addend_reader::operator()): Declare Arm_relocate_functions as a class, not a struct. (Target_arm::scan_span_for_cortex_a8_erratum): Likewise. (Target_arm::apply_cortex_a8_workaround): Likewise. * gc.h: Declare Reloc_types as a struct, not a class. * object.h: Declare Symbols_data as a struct. * reloc.h: Declare Read_relocs_data as a struct. * target.h: Declare Relocate_info as a struct.
* gold: Add linker relaxation of tail calls on sparc.David S. Miller2012-04-242-0/+158
| | | | | | | | gold/ * sparc.cc (Target_sparc::Relocate::relax_call): New function. (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30 and R_SPARC_WPLT30.
* * incremental-dump.cc (find_input_containing_global): ReplaceCary Coutant2012-04-244-34/+123
| | | | | | | | | | | | | | | | | | | | | | magic number with symbolic constant. (dump_incremental_inputs): Update version number. * incremental.cc (Output_section_incremental_inputs): Update version number; import symbolic constants from Incremental_inputs_reader. (Incremental_inputs::create_data_sections): Align relocations section correctly for 64-bit targets. (Output_section_incremental_inputs::set_final_data_size): Use symbolic constants; add padding. (Output_section_incremental_inputs::write_header): Add assert for header_size. (Output_section_incremental_inputs::write_input_files): Add assert for input_entry_size. (Output_section_incremental_inputs::write_info_blocks): Add padding; add assert for object_info_size, input_section_entry_size, global_sym_entry_size. * incremental.h (Incremental_inputs_reader): Add symbolic constants for data structure sizes; use them. (Incremental_input_entry_reader): Import symbolic constants from Incremental_inputs_reader; use them.
* gold: Maintain sparc ELF header bits properlyDavid S. Miller2012-04-232-1/+120
| | | | | | | | | | gold/ * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_, and elf_flags_set_. (Target_sparc::Target_sparc): Initialize new fields. (Target_sparc::do_make_elf_object): New function. (Target_sparc::do_adjust_elf_header): New function.
* elfcpp/Cary Coutant2012-04-232-2/+8
| | | | | | | | | * elfcpp_swap.h (struct Swap_aligned32): New template. gold/ * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing CU range table of gdb index.
* gold: Fix parameterization of do_adjust_elf_headerDavid S. Miller2012-04-202-2/+7
| | | | | | | gold/ * target.cc (Sized_target::do_adjust_elf_header): Use big_endian instead of false.
* gold: Add support for sparc GOTDATA optimizations in Gold.David S. Miller2012-04-172-1/+113
| | | | | | | | | | | | | | | gold/ * sparc.cc (Target_sparc::got_address): New function. (Sparc_relocate_functions::gdop_hix22): New function. (Sparc_relocate_functions::gdop_lox10): New function. (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA relocs. (Target_sparc::Scan::local): Likewise if the global symbol is not preemptible and is not IFUNC. (Target_sparc::Relocate::relocate): Perform GOTDATA code transformations for local and non-preemptible non-IFUNC global symbols.
* gold: Fix 64-bit sparc GOLD crash in gdb-index code.David S. Miller2012-04-172-2/+5
| | | | | | | gold/ * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when writing out 64-bit part of ranges.
* gold: Build Gold IFUNC tests with -fPIC/-fPIE instead of -fpic/-fpie.David S. Miller2012-04-173-36/+40
| | | | | | | | gold/ * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of -fpic and -fpie respectively. * Makefile.in: Regenerate.
* gold: Add sparc IFUNC support to Gold.David S. Miller2012-04-172-79/+553
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | elfcpp/ * sparc.h (R_SPARC_JMP_IREL): New relocation. gold/ * sparc.cc (class Target_sparc): Add rela_ifunc_. (Target_sparc::Target_sparc): Initialize new field. (Target_sparc::do_plt_section_for_global): New function. (Target_sparc::do_plt_section_for_local): New function. (Target_sparc::reloc_needs_plt_for_ifunc): New function. (Target_sparc::make_plt_section): New function, broken out of make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt". (Target_sparc::make_plt_entry): Call make_plt_section. (Target_sparc::make_local_ifunc_plt_entry): New function. (Target_sparc::rela_ifunc_section): New function. (Target_sparc::plt_section): Remove const. (Output_data_plt_sparc): Update declarations. Define Global_ifunc and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_, and ifunc_count_ fields. (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields. (Output_data_plt_sparc::add_entry): Handle IFUNC symbols. (Output_data_plt_sparc::add_local_ifunc_entry): New function. (Output_data_plt_sparc::rela_ifunc): New function. (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function. (Output_data_plt_sparc::has_ifunc_section): New function. (Output_data_plt_sparc::entry_count): Include ifunc_count_. (Output_data_plt_sparc::address_for_global): New function. (Output_data_plt_sparc::address_for_local): New function. (Output_data_plt_sparc::plt_index_to_offset): New function. (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset and entry_count. (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and entry_count. (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and R_SPARC_JMP_IREL to switch. (Target_sparc::Scan::check_non_pic): Likewise. (Target_sparc::Scan::local): Handle IFUNC symbols. (Target_sparc::Scan::local): Likewise. (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global and plt_address_for_local. (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs. Define __rel_iplt_start and __rel_iplt_end if doing a static link.
* gold: Allow use_plt_offset to be specified for global relocations.David S. Miller2012-04-176-43/+69
| | | | | | | | | | | | | | | gold/ * output.h (Output_reloc): Allow use_plt_offset for global relocs too. (class Output_data_reloc): Adjust calls to Output_reloc_type. (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset. * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for global relocs too. (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols. * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative calls. * sparc.cc (Target_sparc::Scan::global): Likewise. * x86_64.cc (Target_x86_64::Scan::global): Likewise.
* * archive.cc (Library_base::should_include_member): Check forCary Coutant2012-04-174-6/+60
| | | | | | | | | --export-dynamic-symbol. * options.h (class General_options): Add --export-dynamic-symbol. * symtab.cc (Symbol::should_add_dynsym_entry): Check for --export-dynamic-symbol. (Symbol_table::gc_mark_undef_symbols): Likewise. (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
* Support R_SPARC_WDISP10 and R_SPARC_H34.David S. Miller2012-04-122-0/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | include/ * elf/sparc.h (R_SPARC_WDISP10): New reloc. * opcode/sparc.h: Define '=' as generating R_SPARC_WDISP10. opcodes/ * sparc-dis.c (X_DISP10): Define. (print_insn_sparc): Handle '='. bfd/ * reloc.c (BFD_RELOC_SPARC_H34, BFD_RELOC_SPARC_SIZE32, BFD_RELOC_SPARC_SIZE64, BFD_RELOC_SPARC_WDISP10): New relocs. * libbfd.h: Regenerate. * bfd-in2.h: Likewise. * elfxx-sparc.c (sparc_elf_wdisp10_reloc): New function. (_bfd_sparc_elf_howto_table): Add entries for R_SPARC_H34, R_SPARC_SIZE32, R_SPARC_64, and R_SPARC_WDISP10. (_bfd_sparc_elf_reloc_type_lookup): Handle new relocs. (_bfd_sparc_elf_check_relocs): Likewise. (_bfd_sparc_elf_gc_sweep_hook): Likewise. (_bfd_sparc_elf_relocate_section): Likewise. gas/ * config/tc-sparc.c (sparc_ip): Handle '=', "%h34", "%l34", and BFD_RELOC_SPARC_H34. (md_apply_fix): Handle BFD_RELOC_SPARC_WDISP10 and BFD_RELOC_SPARC_H34. (tc_gen_reloc): Likewise. gas/testsuite/ * gas/sparc/reloc64.s: Add abs34 code model tests. * gas/sparc/reloc64.d: Update. elfcpp/ * sparc.h (R_SPARC_WDISP10): New relocation. gold/ * sparc.cc (Reloc::wdisp10): New relocation method. (Reloc::h34): Likewise. (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34. (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and R_SPARC_WDISP10. (Target_sparc::Scan::local): Likewise. (Target_sparc::Scan::global): Likewise. (Target_sparc::Relocate::relocate): Likewise.
* * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): AllowCary Coutant2012-04-092-1/+6
| | | | low_pc == 0.
* * timer.cc: #include <unistd.h>.Ian Lance Taylor2012-04-062-0/+6
|
* binutils/Roland McGrath2012-04-064-7/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2012-04-06 Roland McGrath <mcgrathr@google.com> * configure.in (AC_CHECK_HEADERS): Add locale.h. * config.in: Regenerate. * configure: Regenerate. gas/ 2012-04-06 Roland McGrath <mcgrathr@google.com> * configure.in (AC_CHECK_HEADERS): Add locale.h. * config.in: Regenerate. * configure: Regenerate. gold/ 2012-04-06 Roland McGrath <mcgrathr@google.com> * configure.in (AC_CHECK_HEADERS): Add locale.h. * config.in: Regenerate. * configure: Regenerate. ld/ 2012-04-06 Roland McGrath <mcgrathr@google.com> * configure.in (AC_CHECK_HEADERS): Add locale.h. * config.in: Regenerate. * configure: Regenerate.
* * configure.in (AC_CHECK_FUNCS): Add setlocale.Nick Clifton2012-04-055-0/+63
| | | | | | | (AM_LC_MESSAGES): Add. * aclocal.m4: Regenerate. * config.in: Regenerate. * configure: Regenerate.
* 2012-03-21 Cary Coutant <ccoutant@google.com>Cary Coutant2012-03-2124-168/+4486
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Makefile.am: Add gdb-index.cc, gdb-index.h. * Makefile.in: Regenerate. * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function. (Sized_elf_reloc_mapper::symbol_section): New function. (Sized_elf_reloc_mapper::do_get_reloc_target): New function. (make_elf_reloc_mapper): New function. (Dwarf_abbrev_table::clear_abbrev_codes): New function. (Dwarf_abbrev_table::do_read_abbrevs): New function. (Dwarf_abbrev_table::do_get_abbrev): New function. (Dwarf_ranges_table::read_ranges_table): New function. (Dwarf_ranges_table::read_range_list): New function. (Dwarf_pubnames_table::read_section): New function. (Dwarf_pubnames_table::read_header): New function. (Dwarf_pubnames_table::next_name): New function. (Dwarf_die::Dwarf_die): New function. (Dwarf_die::read_attributes): New function. (Dwarf_die::skip_attributes): New function. (Dwarf_die::set_name): New function. (Dwarf_die::set_linkage_name): New function. (Dwarf_die::attribute): New function. (Dwarf_die::string_attribute): New function. (Dwarf_die::int_attribute): New function. (Dwarf_die::uint_attribute): New function. (Dwarf_die::ref_attribute): New function. (Dwarf_die::child_offset): New function. (Dwarf_die::sibling_offset): New function. (Dwarf_info_reader::check_buffer): New function. (Dwarf_info_reader::parse): New function. (Dwarf_info_reader::do_parse): New function. (Dwarf_info_reader::do_read_string_table): New function. (Dwarf_info_reader::lookup_reloc): New function. (Dwarf_info_reader::get_string): New function. (Dwarf_info_reader::visit_compilation_unit): New function. (Dwarf_info_reader::visit_type_unit): New function. (Sized_dwarf_line_info::Sized_dwarf_line_info): Use Sized_elf_reloc_mapper. (Sized_dwarf_line_info::symbol_section): Remove function. (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper. (Sized_dwarf_line_info::read_line_mappings): Remove object parameter, adjust callers. (Sized_dwarf_line_info::format_file_lineno): Fix type of cast. * dwarf_reader.h: Include <sys/types.h>. (class Track_relocs): Remove forward declaration. (class Elf_reloc_mapper): New class. (class Sized_elf_reloc_mapper): New class. (class Dwarf_abbrev_table): New class. (class Dwarf_range_list): New class. (class Dwarf_ranges_table): New class. (class Dwarf_pubnames_table): New class. (class Dwarf_die): New class. (class Dwarf_info_reader): New class. (Sized_dwarf_line_info::read_line_mappings): Remove object parameter. (Sized_dwarf_line_info::symbol_section): Remove member function. * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from base class. * gdb-index.cc: New source file. * gdb-index.h: New source file. * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info and .debug_types sections, call Layout::add_to_gdb_index. (Sized_relobj_incr::do_section_name): Implement. (Sized_relobj_incr::do_section_contents): Adjust parameter list and return type; Implement. (Sized_incr_dynobj::do_section_contents): Adjust parameter list and return type. * incremental.h (Sized_relobj_incr::do_section_contents): Adjust parameter list and return type. (Sized_incr_dynobj::do_section_contents): Likewise. * layout.cc: Include gdb-index.h. (Layout::Layout): Initialize gdb_index_data_. (Layout::init_fixed_output_section): Check for .gdb_index section. (Layout::add_to_gdb_index): New function. Instantiate. * layout.h: Add forward declaration for class Gdb_index. (Layout::add_to_gdb_index): New member function. (Layout::gdb_index_data_): New data member. * main.cc: Include gdb-index.h. (main): Print statistics for gdb index. * object.cc (Object::section_contents): Move code into do_section_contents. (need_decompressed_section): Check for sections needed when building gdb index. (build_compressed_section_map): Likewise. (Sized_relobj_file::do_read_symbols): Need local symbols when building gdb index. (Sized_relobj_file::do_layout): Track .debug_info and .debug_types sections; call Layout::add_to_gdb_index. (Sized_relobj_file::do_decompressed_section_contents): Call do_section_contents directly. * object.h (Object::do_section_contents): Adjust parameter list and return type. (Object::do_decompressed_section_contents): Call do_section_contents directly. (Sized_relobj_file::do_section_contents): Adjust parameter list and return type. * options.h (class General_options): Add --gdb-index option. * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter list and return type. * plugin.h (Sized_pluginobj::do_section_contents): Likewise. * reloc.h (Track_relocs::checkpoint): New function. (Track_relocs::reset): New function. * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh): New test cases. * testsuite/Makefile.in: Regenerate. * testsuite/gdb_index_test.cc: New test source file. * testsuite/gdb_index_test_1.sh: New test source file. * testsuite/gdb_index_test_2.sh: New test source file.
* 2012-03-19 Doug Kwan <dougkwan@google.com>Doug Kwan2012-03-198-32/+116
| | | | | | | | | | | | | | | | | * arm.cc (Target_arm::do_define_standard_symbols): New method. (Target_arm::do_finalize_sections): Remove code which defines __exidx_start and __exidx_end. Make symbol table parameter anonymous as it is not used. * gold.cc (queue_middle_tasks): Call target hook to define any target-specific symbols. * target.h (Target::define_standard_symbols): New method. (Target::do_define_standard_symbols): Same. * testsuite/Makefile.am (arm_exidx_test): Dump relocations also. * testsuite/Makefile.in: Regenerate. * testsuite/arm_exidx.s: Generate data relocations for __exidx_start and __exidx_end. * testsuite/arm_exidx_test.sh: Check that no unused dynamic relocations are generated for __exidx_start and __exidx_end.
* 2012-03-16 Doug Kwan <dougkwan@google.com>Doug Kwan2012-03-173-24/+28
| | | | | * testsuite/Makefile.am: Disable test initpri3b. * testsuite/Makefile.in: Regenerate.
* 2012-03-15 Doug Kwan <dougkwan@google.com>Doug Kwan2012-03-152-2/+18
| | | | | * arm.cc (Target_arm::got_section): Make .got section read-only if -z now is given.
* PR gold/13850Ian Lance Taylor2012-03-152-10/+18
| | | | | * layout.cc (Layout::make_output_section): Correctly mark SHT_INIT_ARRAY, et. al., as relro.
* 2012-03-14 Doug Kwan <dougkwan@google.com>Doug Kwan2012-03-142-1/+8
| | | | | * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT dynamic relocations for protected symbols in shared objects.
* * resolve.cc (Symbol_table::resolve): When merging common symbols,Ian Lance Taylor2012-03-132-4/+20
| | | | keep the larger alignment.
* * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): FixCary Coutant2012-03-132-6/+10
| | | | handling of DW_LNE_define_file.
* elfcpp/Cary Coutant2012-03-132-1/+17
| | | | | | | | | | | | | | | | | | Update DWARF enums from ../include/dwarf2.h. * dwarf.h (enum DW_TAG): Add new DWARF-4 tags. (enum DW_FORM): Add new DWARF-4 and Fission extensions. (enum DW_AT): New enum. (enum DW_LINE_EXTENDED_OPS): Add new DWARF-4 opcode. (enum DW_ENCODING): Add new DWARF-4 encoding. (enum DW_OP): Add new DWARF-4 opcodes. (enum DW_CHILDREN): New enum. (enum DW_LANG): New enum. gold/ * reduced_debug_output.cc (Output_reduced_debug_info_section::get_die_end): Add new FORM codes to switch.
* * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.Cary Coutant2012-03-012-0/+8
|
* * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):Cary Coutant2012-02-297-66/+246
| | | | | | | | | | | | | | | | | | | | | | Call Object::decompressed_section_contents. * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info): New dtor. (Sized_dwarf_line_info::buffer_start_): New data member. * merge.cc (Output_merge_data::do_add_input_section): Call Object::decompressed_section_contents. (Output_merge_string::do_add_input_section): Likewise. * object.cc (need_decompressed_section): New function. (build_compressed_section_map): Decompress sections needed later. (Sized_relobj_file::do_decompressed_section_contents): New function. (Sized_relobj_file::do_discard_decompressed_sections): New function. * object.h (Object::decompressed_section_contents): New function. (Object::discard_decompressed_sections): New function. (Object::do_decompressed_section_contents): New function. (Object::do_discard_decompressed_sections): New function. (Compressed_section_info): New type. (Compressed_section_map): Include decompressed section contents. (Sized_relobj_file::do_decompressed_section_contents): New function. (Sized_relobj_file::do_discard_decompressed_sections): New function.
* * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.Cary Coutant2012-02-163-2/+7
| | | | * testsuite/Makefile.in: Regenerate.
* * options.cc (General_options::finalize): Disallow -pie and -static.Cary Coutant2012-02-152-0/+6
|
* 2012-02-03 Doug Kwan <dougkwan@google.com>Doug Kwan2012-02-033-16/+21
| | | | | | | | | | * arm.cc (Arm_relocate_functions::abs8, Arm_relocate_functions::abs16): Use Bits::has_signed_unsigned_overflow32. (Arm_relocate_functions::thm_abs8): Correct range of overflow check. * reloc.h (Bits class): Change minimum number of bits from 0 to 1 in assertions.
* 2012-02-02 Doug Kwan <dougkwan@google.com>Doug Kwan2012-02-022-5/+12
| | | | | * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all position independent outputs, not just shared objects.
* Check if -fpic -mtls-dialect=gnu2 worksH.J. Lu2012-01-303-4/+21
| | | | | | | 2012-01-30 H.J. Lu <hongjiu.lu@intel.com> * configure.ac: Check if -fpic -mtls-dialect=gnu2 works. * configure: Regenerated.
* * reloc.h (Bits): New class with static functions, copied fromIan Lance Taylor2012-01-283-104/+171
| | | | | | namespace utils in arm.cc. * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits instead.
* Update copyright year.Ian Lance Taylor2012-01-281-1/+1
|
* Correct incremental relocation offsetH.J. Lu2012-01-282-1/+6
| | | | | | 2012-01-27 H.J. Lu <hongjiu.lu@intel.com> * incremental.cc (write_info_blocks): Correct relocation offset.
* Support x32 GD->IE and GD->LE optimizationsH.J. Lu2012-01-272-17/+59
| | | | | | | 2012-01-27 H.J. Lu <hongjiu.lu@intel.com> * x86_64.cc (Relocate::tls_gd_to_ie): Support x32. (Relocate::tls_gd_to_le): Likewise.