aboutsummaryrefslogtreecommitdiff
path: root/gold/fileread.h
AgeCommit message (Collapse)AuthorFilesLines
2008-09-19Add plugin functionality for link-time optimization (LTO).Cary Coutant1-0/+13
include/: * plugin-api.h: New file. gold/: * configure.ac (plugins): Add --enable-plugins option. * configure: Regenerate. * config.in: Regenerate. * Makefile.am (LIBDL): New variable. (CCFILES): Add plugin.cc. (HFILES): Add plugin.h. (ldadd_var): Add LIBDL. * Makefile.in: Regenerate. * archive.cc: Include "plugin.h". (Archive::setup): Don't preread archive symbols when using a plugin. (Archive::get_file_and_offset): Add memsize parameter. Change callers. (Archive::get_elf_object_for_member): Call plugin hooks for claiming files. (Archive::include_member): Add symbols from plugin objects. * archive.h (Archive::get_file_and_offset): Add memsize parameter. * descriptors.cc (Descriptors::open): Check for file descriptors abandoned by plugins. (Descriptors::claim_for_plugin): New function. * descriptors.h (Descriptors::claim_for_plugin): New function. (Open_descriptor::is_claimed): New field. (claim_descriptor_for_plugin): New function. * fileread.cc (File_read::claim_for_plugin): New function. * fileread.h (File_read::claim_for_plugin): New function. (File_read::descriptor): New function. * gold.cc: Include "plugin.h". (queue_initial_tasks): Add task to call plugin hooks for generating new object files. * main.cc: Include "plugin.h". (main): Load plugin libraries. * object.h (Pluginobj): Declare. (Object::pluginobj): New function. (Object::do_pluginobj): New function. (Object::set_target): New function. * options.cc: Include "plugin.h". (General_options::parse_plugin): New function. (General_options::General_options): Initialize plugins_ field. (General_options::add_plugin): New function. * options.h (Plugin_manager): Declare. (General_options): Add --plugin option. (General_options::has_plugins): New function. (General_options::plugins): New function. (General_options::add_plugin): New function. (General_options::plugins_): New field. * plugin.cc: New file. * plugin.h: New file. * readsyms.cc: Include "plugin.h". (Read_symbols::do_read_symbols): Check for archive before checking for ELF file. Call plugin hooks to claim files. * resolve.cc (Symbol_table::resolve): Record when symbol is referenced from a real object file; force override when processing replacement files. * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field. (Symbol::init_base_object): Likewise. (Symbol::init_base_output_data): Likewise. (Symbol::init_base_output_segment): Likewise. (Symbol::init_base_constant): Likewise. (Symbol::init_base_undefined): Likewise. (Symbol::output_section): Assert that object is not a plugin. (Symbol_table::add_from_pluginobj): New function. (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as undefined. (Symbol_table::sized_write_globals): Likewise. (Symbol_table::add_from_pluginobj): Instantiate template. * symtab.h (Sized_pluginobj): Declare. (Symbol::in_real_elf): New function. (Symbol::set_in_real_elf): New function. (Symbol::in_real_elf_): New field. (Symbol_table::add_from_pluginobj): New function. * testsuite/Makefile.am (AM_CFLAGS): New variable. (LIBDL): New variable. (LDADD): Add LIBDL. (check_PROGRAMS): Add plugin_test_1 and plugin_test_2. (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh. (check_DATA): Add plugin_test_1.err and plugin_test_2.err. (MOSTLYCLEANFILES): Likewise. * testsuite/Makefile.in: Regenerate. * testsuite/plugin_test.c: New file. * testsuite/plugin_test_1.sh: New file. * testsuite/plugin_test_2.sh: New file.
2008-07-25 PR 5990Ian Lance Taylor1-11/+16
* descriptors.cc: New file. * descriptors.h: New file. * gold-threads.h (class Hold_optional_lock): New class. * fileread.cc: Include "descriptors.h". (File_read::~File_read): Release descriptor rather than closing it. (File_read::open) [file]: Call open_descriptor rather than open. Set is_descriptor_opened_. (File_read::open) [memory]: Assert that descriptor is not open. (File_read::reopen_descriptor): New function. (File_read::release): Release descriptor. (File_read::do_read): Make non-const. Reopen descriptor. (File_read::read): Make non-const. (File_read::make_view): Reopen descriptor. (File_read::do_readv): Likewise. * fileread.h (class File_read): Add is_descriptor_opened_ field. Update declarations. * layout.cc: Include "descriptors.h". (Layout::create_build_id): Use open_descriptor rather than open. * output.cc: Include "descriptors.h". (Output_file::open): Use open_descriptor rather than open. * archive.cc (Archive::const_iterator): Change Archive to be non-const. (Archive::begin, Archive::end): Make non-const. (Archive::count_members): Likewise. * archive.h (class Archive): Update declarations. * object.h (Object::read): Make non-const. * Makefile.am (CCFILES): Add descriptors.cc. (HFILES): Add descriptors.h. * Makefile.in: Rebuild.
2008-04-02 * fileread.cc (File_read::find_view): Add byteshift and vshiftedIan Lance Taylor1-17/+57
parameters. Update for new key type to views_. Change all callers. (File_read::read): Adjust for byteshift in returned view. (File_read::add_view): New function, broken out of find_and_make_view. (File_read::make_view): New function, broken out of find_and_make_view. (File_read::find_or_make_view): Add offset and aligned parameters. Rewrite accordingly. Change all callers. (File_read::get_view): Add offset and aligned parameters. Adjust for byteshift in return value. (File_read::get_lasting_view): Likewise. * fileread.h (class File_read): Update declarations. (class File_read::View): Add byteshift_ field. Add byteshift to constructor. Add byteshift method. * archive.h (Archive::clear_uncached_views): New function. (Archive::get_view): Add aligned parameter. Change all callers. * object.h (Object::get_view): Add aligned parameter. Change all callers. (Object::get_lasting_view): Likewise. * fileread.cc (File_read::release): Don't call clear_views if there are multiple objects. * fileread.h (File_read::clear_uncached_views): New function. * archive.cc (Add_archive_symbols::run): Call clear_uncached_views on the archive.
2008-03-13Update copyright years. Update language files.Ian Lance Taylor1-1/+1
2008-02-13Support selecting target by name.Ian Lance Taylor1-1/+2
2008-02-08Add support for --format binary for input files.Ian Lance Taylor1-0/+4
2008-02-07Implement --just-symbols, including -R FILE. Fix symbol values whenIan Lance Taylor1-0/+4
doing a relocatable link.
2008-01-22Include <vector>.Ian Lance Taylor1-0/+1
2008-01-18Don't include options.h in fileread.h. Remove General_optionsIan Lance Taylor1-5/+4
reference from Output_file class.
2008-01-02Reduce the number of system calls. Use readv instead of pread. DoIan Lance Taylor1-3/+69
better handling of cached views.
2007-12-20Convert more instances of off_t to be 32-bit types.Ian Lance Taylor1-2/+2
2007-12-18Add section_size_type and section_offset_type, use them to replace aIan Lance Taylor1-8/+8
lot of instances of off_t.
2007-12-14Rewrite workqueue. This version eliminates the master thread, andIan Lance Taylor1-17/+37
reduces the amount of locking required to find a new thread to run.
2007-12-14Add const to Object::read and Object::sized_target.Ian Lance Taylor1-1/+5
2007-12-14Make some File_read methods const.Ian Lance Taylor1-3/+3
2007-10-14Run all error handling through an Errors object. Delete output fileIan Lance Taylor1-2/+3
on error.
2007-10-12Add --stats option to print runtime and memory usage statistics.Ian Lance Taylor1-1/+22
2007-10-09Fix soname for library found in search path.Ian Lance Taylor1-3/+17
2007-10-04Full support for --sysroot.Ian Lance Taylor1-1/+10
2007-09-25Use mmap to read from input files.Ian Lance Taylor1-3/+5
2007-09-25Add cache parameter to get_view. Discard uncached views on unlock.Ian Lance Taylor1-12/+22
Fix bug this exposed in archive armap symbol name handling.
2007-09-25Rework File_read interface. Get file size. Use pread whenIan Lance Taylor1-10/+14
available.
2007-09-25Remove get_view_and_size.Ian Lance Taylor1-8/+1
2007-09-25Break out default pbytes argument to read and get_view routines,Ian Lance Taylor1-13/+26
adding new routines.
2007-09-22Add licensing text to every source file.Ian Lance Taylor1-0/+20
2007-09-22From Andrew Chatham: Make File_read::View::data_ a const pointer.Ian Lance Taylor1-3/+3
2007-08-21Implement --whole-archive.Ian Lance Taylor1-3/+9
2006-11-30Added a testsuite. More support for COPY relocations.Ian Lance Taylor1-9/+23
2006-11-03Can now do a full static link of hello, world in C or C++Ian Lance Taylor1-5/+38
2006-09-21New drop, with first cut of section layout code.Ian Lance Taylor1-16/+0
2006-08-04Initial CVS checkin of goldIan Lance Taylor1-0/+226