Fix displacement of separate debug info files.
* objfiles.c (objfile_relocate): Rename to ...
(objfile_relocate1): ... here and make it static. Extend the comment.
(objfile_relocate): New function.
* solib-spu.c (spu_relocate_main_executable): Explicitly check if
SYMFILE_OBJFILE is NULL. Remove variables objfile and old_chain.
Remove following of SEPARATE_DEBUG_OBJFILE. new_offsets is now
allocated using alloca.
* symfile.c (copy_section_addr_info): Remove.
(build_section_addr_info_from_objfile): Make it global. New variables
addr_bit and mask, use them.
* symfile.h (build_section_addr_info_from_objfile): New prototype.
(copy_section_addr_info): Remove.
* procfs.c: #include "observer.h".
(procfs_inferior_created): New function, moving here the code
which unsets the syssgi syscall-exit notifications.
(procfs_create_inferior): Remove the code which unsets the syssgi
syscall-exit notifications. It is too early to do this here.
(_initialize_procfs): Attach the procfs_inferior_created observer.
* mips-tdep.c (mips_n32n64_return_value): Arrays whose size is
128 bits or smaller are returned the same way as structs
and unions of the the same size.
* arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
prev_data_size_ and prev_addralign_. Remove initializer for
deleted data member has_been_changed_.
(Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
to determine if the table is empty.
(Stub_table::has_been_changed, Stub_table_set_has_been_changed):
Remove.
(Stub_table::add_reloc_stub): Define method in class definition
instead of just declaring it there.
(Stub_table::add_cortex_a8_stub): New method definition.
(Stub_table::update_data_size_and_addralign): Ditto.
(Stub_table::finalize_stubs): Ditto.
(Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
(Stub_table::do_addralign_): Return address alignment in the
(Stub_table::do_reset_address_and_file_offset): Define method in
class definition instead of declaring it there. Set current data
size to be the data size of the previous pass.
(Stub_table::set_final_data_size): Use current data size as the
final data size.
(Stub_table::relocate_stub): Change parameter type of stub from
Reloc_stub pointer to Stub pointer.
(Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
(Stub_table::Cortex_a8_stub_list): New typedef.
(Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
Stub_table::prev_addralign_): New data member.
(Arm_relobj::Arm_relobj): Initialize data member
section_has_cortex_a8_workaround_.
(Arm_relobj::section_has_cortex_a8_workaround,
Arm_relobj::mark_section_for_cortex_a8_workaround): New method
definitions.
(Arm_relobj::section_has_cortex_a8_workaround_): New data member
declarations.
(Target_arm::relocate_stub): Change parameter type of stub from
Reloc_stub pointer to Stub pointer.
(Insn_template::size, Insn_template::alignment): Handle
THUMB16_SPECIAL_TYPE.
(Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
Stub_table::update_data_size_and_addralign,
Stub_table::apply_cortex_a8_workaround_to_address_range): New method
definitions.
(Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
(Stub_table::do_write): Ditto.
(Target_arm::do_relax): Adjust code for changes in Stub_table.
* gdb.base/corefile.exp: Move the core finding block out and call it as
core_find, new variable $corefile, replace corefile by $corefile and
[file tail $corefile] for usage vs. test names resp.
* lib/gdb.exp (core_find): Move it as a new function here. New
parameter binfile and deletefiles. New variable $destcore. Pre-delete
$destcore. Return "" on error.
* symtab.h (class Symbol): Remove fields is_target_special_ and
has_plt_offset_. Add field is_defined_in_discarded_section_.
(Symbol::is_defined_in_discarded_section): New function.
(Symbol::set_is_defined_in_discarded_section): New function.
(Symbol::has_plt_offset): Rewrite.
(Symbol::set_plt_offset): Verify that new offset is not -1U.
* symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
Don't initialize is_target_special_ or has_plt_offset_.
Initialize is_defined_in_discarded_section_.
(Symbol_table::add_from_relobj): If appropriate, set
is_defined_in_discarded_section.
* resolve.cc (Symbol::override_base_with_special): Don't test
is_target_special_. Change has_plt_offset_ to has_plt_offset().
* target-reloc.h (relocate_section): Do special handling for
symbols defined in discarded sections for global symbols as well
as local symbols.
Move some symfile code into subroutines.
* symfile.h (relative_addr_info_to_section_offsets)
(addr_info_make_relative): New prototypes.
* symfile.c (default_symfile_offsets): Move a part to ...
(relative_addr_info_to_section_offsets): ... this new function.
(default_symfile_offsets): Call it.
(syms_from_objfile <!mainline && addrs && addrs->other[0].name>): Move
this part to ...
(addr_info_make_relative): ... this new function.
* dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
dynamic symbol table, use the normal symbol table.
(Sized_dynobj::do_read_symbols): Remove assertion about type of
symbol table.
PR 11063
* i386.cc (class Target_i386): Change return type of plt_section
to be non-const.
(class Output_data_plt_i386): Add tls_desc_rel_ field.
(Output_data_plt_i386::Output_data_plt_i386): Initialize
tls_desc_rel_ field.
(Output_data_plt_i386::rel_tls_desc): New function.
(Target_i386::rel_tls_desc_section): New function.
(Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
(Target_i386::Scan::global): For R_386_TLS_GOTDESC put
R_386_TLS_DESC reloc in rel_tls_desc_section.
* x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
Define struct Tlsdesc_info.
(Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
(Target_x86_64::do_reloc_symbol_index): New function.
(Target_x86_64::add_tlsdesc_info): New function.
(class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
(Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
tlsdesc_rel_ field.
(Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
all callers.
(Output_data_plt_x86_64::rela_tlsdesc): New function.
(Target_x86_64::rela_tlsdesc_section): New function.
(Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
handling.
(Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
(Target_x86_64::do_reloc_addend): New function.
R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
* output.h (class Output_reloc) [SHT_REL]: Add new constructor
declarations. Define TARGET_CODE. Add arg field to u1_ union.
(Output_reloc::type): New function.
(Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
(Output_reloc::is_target_specific): New function.
(Output_reloc::target_arg): New function.
(class Output_reloc) [SHT_RELA]: Add four new constructors for
absolute relocs and target specific relocs.
(class Output_data_reloc) [SHT_REL]: Add add_absolute and
add_target_specific.
(class Output_data_reloc) [SHT_RELA]: Likewise.
* output.cc (Output_reloc::Output_reloc): Add four new versions
for absolute relocs and target specific relocs.
(Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
(Output_reloc::get_symbol_index): Likewise.
(Output_reloc::local_section_offset): Check that local_sym_index_
is not TARGET_CODE or 0.
(Output_reloc::symbol_value): Likewise.
(Output_reloc::write) [SHT_RELA]: Call target for target specific
reloc.
* target.h (class Target): Add reloc_symbol_index and reloc_addend
functions. Add do_reloc_symbol_index and do_reloc_addend virtual
functions.
* layout.cc (add_target_dynamic_tags): Use output section for
DT_PLTRELSZ and DT_JMPREL.
binutils/
2010-01-08 H.J. Lu <hongjiu.lu@intel.com>
* elfedit.c (input_elf_type): New.
(output_elf_type): Likewise.
(elf_type): Likewise.
(update_elf_header): Support updating ELF file type.
(command_line_switch): Add OPTION_INPUT_TYPE and
OPTION_OUTPUT_TYPE.
(options): Likewise.
(usage): Add --input-type and --output-type.
(main): Handle OPTION_INPUT_TYPE and OPTION_OUTPUT_TYPE. Check
one of --output-mach and --output-type must be specified.
* doc/binutils.texi: Document --input-type and --output-type
for elfedit.
binutils/testsuite/
2010-01-08 H.J. Lu <hongjiu.lu@intel.com>
* binutils-all/elfedit-2.d: New.
* binutils-all/elfedit.exp: Run elfedit-2.