aboutsummaryrefslogtreecommitdiff
path: root/gold/reloc.h
AgeCommit message (Collapse)AuthorFilesLines
2009-01-282009-01-20 Sriraman Tallam <tmsriram@google.com>Sriraman Tallam1-1/+40
* Makefile.am (CCFILES): Add gc.cc. (HFILES): Add gc.h. * Makefile.in: Regenerate. * gold.cc (Gc_runner): New class. (queue_initial_tasks): Call garbage collection related tasks when corresponding options are invoked. (queue_middle_gc_tasks): New function. (queue_middle_tasks): Reorder tasks to allow relocs to be read and processed early before laying out sections during garbage collection. * gold.h (queue_middle_gc_tasks): New function. (is_prefix_of): Move from "layout.cc". * i386.cc (Target_i386::gc_process_relocs): New function. * layout.cc (is_prefix_of): Remove. Move to "gold.h" * main.cc (main): Create object of class "Garbage_collection". * object.cc (Relobj::copy_symbols_data): New function. (Relobj::is_section_name_included): New function. (Sized_relobj::do_layout): Allow this function to be called twice during garbage collection and defer layout of section during the first call. * object.h (Relobj::get_symbols_data): New function. (Relobj::is_section_name_included): New function. (Relobj::copy_symbols_data): New function. (Relobj::set_symbols_data): New function. (Relobj::get_relocs_data): New function. (Relobj::set_relocs_data): New function. (Relobj::is_output_section_offset_invalid): New pure virtual function. (Relobj::gc_process_relocs): New function. (Relobj::do_gc_process_relocs): New pure virtual function. (Relobj::sd_): New data member. (Sized_relobj::is_output_section_offset_invalid): New function. (Sized_relobj::do_gc_process_relocs): New function. * options.h (General_options::gc_sections): Modify to not be a no-op. (General_options::print_gc_sections): New option. * plugin.cc (Plugin_finish::run): Remove function call to Plugin_manager::layout_deferred_objects. Move it to "gold.cc". * powerpc.cc (Target_powerpc::gc_process_relocs): New function. * reloc.cc (Read_relocs::run): Add task to process relocs and determine unreferenced sections when doing garbage collection. (Gc_process_relocs): New class. (Sized_relobj::do_gc_process_relocs): New function. (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for sections that are garbage collected. * reloc.h (Gc_process_relocs): New class. * sparc.cc (Target_sparc::gc_process_relocs): New function. * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for symbols whose corresponding sections are garbage collected. (Symbol_table::Symbol_table): Add new parameter for the garbage collection object. (Symbol_table::gc_mark_undef_symbols): New function. (Symbol_table::gc_mark_symbol_for_shlib): New function. (Symbol_table::gc_mark_dyn_syms): New function. (Symbol_table::resolve): Do not treat symbols seen in dynamic objects as garbage. (Symbol_table::add_from_object): Likewise. (Symbol_table::add_from_relobj): When building shared objects, do not treat externally visible symbols as garbage. (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol table information for static and relocatable links. * symtab.h (Symbol_table::set_gc): New function. (Symbol_table::gc): New function. (Symbol_table::gc_mark_undef_symbols): New function. (Symbol_table::gc_mark_symbol_for_shlib): New function. (Symbol_table::gc_mark_dyn_syms): New function. (Symbol_table::gc_): New data member. * target.h (Sized_target::gc_process_relocs): New pure virtual function. * x86_64.cc (Target_x86_64::gc_process_relocs): New function. * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
2008-04-16 * copy-relocs.cc: New file.Ian Lance Taylor1-96/+0
* copy-relocs.h: New file. * reloc.cc: Remove Copy_relocs code. * reloc.h: Likewise. * reloc-types.h (struct Reloc_types) [both versions]: Add get_reloc_addend_noerror. * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add variants of add_global which take an addend which must be zero. * i386.cc: Include "copy-relocs.h". (class Target_i386): Change type of copy_relocs_ to variable, update initializer. (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class. Change all callers. (Target_i386::do_finalize_sections): Change handling of copy_relocs_. * sparc.cc: Include "copy-relocs.h". (class Target_sparc): Change type of copy_relocs_ to variable, update initializer. (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class. Change all callers. (Target_sparc::do_finalize_sections): Change handling of copy_relocs_. * x86_64.cc: Include "copy-relocs.h". (class Target_x86_64): Change type of copy_relocs_ to variable, update initializer. (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs class. Change all callers. (Target_x86_64::do_finalize_sections): Change handling of copy_relocs_. * Makefile.am (CCFILES): Add copy-relocs.cc. (HFILES): Add copy-relocs.h.
2008-03-13Update copyright years. Update language files.Ian Lance Taylor1-1/+1
2008-02-27Implement -q/--emit-relocs.Ian Lance Taylor1-0/+3
2008-02-06Initial -r support.Ian Lance Taylor1-0/+95
2007-12-18Add section_size_type and section_offset_type, use them to replace aIan Lance Taylor1-2/+2
lot of instances of off_t.
2007-12-14Rewrite workqueue. This version eliminates the master thread, andIan Lance Taylor1-16/+13
reduces the amount of locking required to find a new thread to run.
2007-11-22Add threading support.Ian Lance Taylor1-0/+9
2007-11-15From Cary Coutant: Count textrel with output sections rather thanIan Lance Taylor1-3/+7
setting a flag as we add each reloc in the target code.
2007-11-12From Craig Silverstein: Track_relocs doesn't need to hold onto theIan Lance Taylor1-5/+4
object.
2007-11-09From Craig Silverstein: Use relocations in reporting error messageIan Lance Taylor1-0/+1
locations.
2007-11-09Generate a complete exception frame header. Discard duplicateIan Lance Taylor1-2/+56
exception frame information.
2007-10-01Cleanups from Craig Silverstein.Ian Lance Taylor1-46/+0
2007-10-01Add Signed_valtype and use it for sign extension. Fix names of rela8.Ian Lance Taylor1-7/+13
2007-10-01Add RELA versions of the relocation routines. Original patch fromIan Lance Taylor1-2/+172
Craig Silverstein, with Symbol_value<> versions added.
2007-09-28From Andrew Chatham: add signedrel<>, rel32s and friends.Ian Lance Taylor1-0/+40
2007-09-22Add licensing text to every source file.Ian Lance Taylor1-0/+20
2007-05-16Add support for SHF_MERGE sections.Ian Lance Taylor1-31/+105
2006-11-30Added a testsuite. More support for COPY relocations.Ian Lance Taylor1-1/+94
2006-11-29Hash tables, dynamic section, i386 PLT, gold_assert.Ian Lance Taylor1-0/+8
2006-11-06Split Object into Dynobj and Relobj, incorporate elfcpp swapping changes.Ian Lance Taylor1-333/+19
2006-11-03Can now do a full static link of hello, world in C or C++Ian Lance Taylor1-6/+9
2006-10-20Framework for relocation scanning. Implement simple static TLSIan Lance Taylor1-3/+503
relocations.
2006-09-29Snapshot. Now able to produce a minimal executable which actuallyIan Lance Taylor1-0/+45
runs.