diff options
author | Cary Coutant <ccoutant@google.com> | 2011-06-08 03:50:12 +0000 |
---|---|---|
committer | Cary Coutant <ccoutant@google.com> | 2011-06-08 03:50:12 +0000 |
commit | 26d3c67de1d0e6434dabb908e5a6fa002f5b1db8 (patch) | |
tree | adebe5713f81ac6e6f85f353dcc70e83ad4d8a65 /gold/x86_64.cc | |
parent | b8e9bd6c6461ea6a53d5a48bad21aab75cd1e9e5 (diff) | |
download | gdb-26d3c67de1d0e6434dabb908e5a6fa002f5b1db8.zip gdb-26d3c67de1d0e6434dabb908e5a6fa002f5b1db8.tar.gz gdb-26d3c67de1d0e6434dabb908e5a6fa002f5b1db8.tar.bz2 |
* copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
instead of emit_copy_reloc.
(Copy_relocs::emit_copy_reloc): Refactor.
(Copy_relocs::make_copy_reloc): New function.
(Copy_relocs::add_copy_reloc): Remove.
* copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
section.
(Copy_relocs::make_copy_reloc): New function.
(Copy_relocs::add_copy_reloc): Remove.
* gold.cc (queue_middle_tasks): Emit old COPY relocations from
unchanged input files.
* incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
* incremental.cc (Sized_incremental_binary::do_reserve_layout):
Reserve BSS space for COPY relocations.
(Sized_incremental_binary::do_emit_copy_relocs): New function.
(Output_section_incremental_inputs::write_info_blocks): Record
whether a symbol is copied from a shared object.
(Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
* incremental.h (enum Incremental_shlib_symbol_flags): New type.
(INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
(Incremental_input_entry_reader::get_output_symbol_index): Add
is_copy parameter.
(Incremental_binary::emit_copy_relocs): New function.
(Incremental_binary::do_emit_copy_relocs): New function.
(Sized_incremental_binary::Sized_incremental_binary): Initialize
new data member.
(Sized_incremental_binary::add_copy_reloc): New function.
(Sized_incremental_binary::do_emit_copy_relocs): New function.
(Sized_incremental_binary::Copy_reloc): New struct.
(Sized_incremental_binary::Copy_relocs): New typedef.
(Sized_incremental_binary::copy_relocs_): New data member.
* symtab.cc (Symbol_table::add_from_incrobj): Change return type.
* symtab.h (Symbol_table::add_from_incrobj): Change return type.
* target.h (Sized_target::emit_copy_reloc): New function.
* x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
Diffstat (limited to 'gold/x86_64.cc')
-rw-r--r-- | gold/x86_64.cc | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/gold/x86_64.cc b/gold/x86_64.cc index a447d38..0a6a960 100644 --- a/gold/x86_64.cc +++ b/gold/x86_64.cc @@ -405,10 +405,13 @@ class Target_x86_64 : public Target_freebsd<64, false> unsigned int got_type); // Register an existing PLT entry for a global symbol. - // A target needs to implement this to support incremental linking. void register_global_plt_entry(unsigned int plt_index, Symbol* gsym); + // Force a COPY relocation for a given symbol. + void + emit_copy_reloc(Symbol_table*, Symbol*, Output_section*, off_t); + // Apply an incremental relocation. void apply_relocation(const Relocate_info<64, false>* relinfo, @@ -1389,6 +1392,19 @@ Target_x86_64::register_global_plt_entry(unsigned int plt_index, this->plt_->add_relocation(gsym, got_offset); } +// Force a COPY relocation for a given symbol. + +void +Target_x86_64::emit_copy_reloc( + Symbol_table* symtab, Symbol* sym, Output_section* os, off_t offset) +{ + this->copy_relocs_.emit_copy_reloc(symtab, + symtab->get_sized_symbol<64>(sym), + os, + offset, + this->rela_dyn_section(NULL)); +} + // Define the _TLS_MODULE_BASE_ symbol in the TLS segment. void |