aboutsummaryrefslogtreecommitdiff
path: root/gold/dynobj.cc
AgeCommit message (Collapse)AuthorFilesLines
2008-07-24 * dynobj.cc (Versions::Versions): Update comment.Ian Lance Taylor1-4/+1
2008-07-24 * dynobj.cc (Versions::Versions): If there is an soname, use it asIan Lance Taylor1-2/+4
the base version name.
2008-07-22 * cref.cc: New file.Ian Lance Taylor1-2/+37
* cref.h: New file. * options.h (class General_options): Add --print-symbol-counts. * main.cc (main): Issue defined symbol report if requested. * archive.cc (Archive::interpret_header): Make into a const member function. (Archive::add_symbols): Call Input_objects::archive_start and archive_stop. (Archive::const_iterator): Define new class. (Archive::begin, Archive::end): New functions. (Archive::include_all_members): Rewrite to use iterator. (Archive::count_members): New function. * archive.h (class Archive): Update declarations. (Archive::filename): New function. * object.cc: Include "cref.h". (Sized_relobj::Sized_relobj): Initialize defined_count_. (Sized_relobj::do_get_global_symbol_counts): New function. (Input_objects::add_object): Add object to cross-referencer. (Input_objects::archive_start): New function. (Input_objects::archive_stop): New function. (Input_objects::print_symbol_counts): New function. * object.h: Declare Cref and Archive. (Object::get_global_symbol_counts): New function. (Object::do_get_global_symbol_counts): New pure virtual function. (class Sized_relobj): Add defined_count_ field. Update declarations. (class Input_objects): Add cref_ field. Update constructor. Update declarations. * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and defined_count_. (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing symbol counts. (Sized_dynobj::do_get_global_symbol_counts): New function. * dynobj.h (class Sized_dynobj): Add fields symbols_ and defined_count_. Update declarations. Define Symbols typedef. * symtab.cc (Symbol_table::add_from_relobj): Add defined parameter. Change all callers. (Symbol_table::add_from_dynobj): Add sympointers and defined parameters. Change all callers. * symtab.h (class Symbol_table): Update declarations. * Makefile.am (CCFILES): Add cref.cc. (HFILES): Add cref.h. * Makefile.in: Rebuild.
2008-07-18 * dynobj.cc (Versions::add_def): If we give an error about aIan Lance Taylor1-5/+2
missing version, go ahead and create the version anyhow.
2008-04-19 * object.cc (Xindex::initialize_symtab_xindex): New function.Ian Lance Taylor1-15/+49
(Xindex::read_symtab_xindex): New function. (Xindex::sym_xindex_to_shndx): New function. (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if available. (Sized_relobj::do_initialize_xindex): New function. (Sized_relobj::do_read_symbols): Adjust section links. (Sized_relobj::symbol_section_and_value): Add is_ordinary parameter. Change all callers. (Sized_relobj::include_section_group): Adjust section links and symbol section indexes. (Sized_relobj::do_layout): Adjust section links. (Sized_relobj::do_count_local_symbols): Adjust section links and symbol section indexes. (Sized_relobj::do_finalize_local_symbols): Distinguish between ordinary and special symbols. (Sized_relobj::write_local_symbols): Add symtab_xindex and dynsym_xindex parameters. Change all callers. Adjust section links. Use SHN_XINDEX when needed. (Sized_relobj::get_symbol_location_info): Adjust section links. Don't get fooled by special symbols. * object.h (class Xindex): Define. (class Object): Add xindex_ parameter. Declare virtual functoin do_initialize_xindex. (Object::adjust_sym_shndx): New function. (Object::set_xindex): New protected function. (class Symbol_value): Add is_ordinary_shndx_ field. (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_. (Symbol_value::value): Assert ordinary section. (Symbol_value::initialize_input_to_output_map): Likewise. (Symbol_value::set_input_shndx): Add is_ordinary parameter. Change all callers. (Symbol_value::input_shndx): Add is_ordinary parameter. Change all callers. (class Sized_relobj): Update declarations. (Sized_relobj::local_symbol_input_shndx): Add is_ordinary parameter. Change all callers. (Sized_relobj::adjust_shndx): New function. * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_ field. (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section for SHT_DYNSYM section if available. Set dynsym_shndx_ field. (Sized_dynobj::read_dynsym_section): Adjust section links. (Sized_dynobj::read_dynamic): Likewise. (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust section links. (Sized_dynobj::do_initialize_xindex): New function. * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare do_initialize_xindex. (Sized_dynobj::adjust_shndx): New function. * layout.cc (Layout::Layout): Initialize symtab_xindex_ and dynsym_xindex_ fields. (Layout::finalize): Add a call to set_section_indexes before creating the symtab sections. (Layout::set_section_indexes): Don't do anything if the section already has a section index. (Layout::create_symtab_sections): Add shnum parameter. Change caller. Create .symtab_shndx section if needed. (Layout::create_shdrs): Add shstrtab_section parameter. Change caller. (Layout::allocated_output_section_count): New function. (Layout::create_dynamic_symtab): Create .dynsym_shndx section if needed. * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_ fields. Update declarations. (Layout::symtab_xindex): New function. (Layout::dynsym_xindex): New function. (class Write_symbols_task): Add layout_ field. (Write_symbols_task::Write_symbols_task): Add layout parameter. Change caller. * output.cc (Output_section_headers::Output_section_headers): Add shstrtab_section parameter. Change all callers. (Output_section_headers::do_sized_write): Store overflow values for section count and section string table section index in section header zero. (Output_file_header::do_sized_write): Check for overflow of section count and section string table section index. (Output_symtab_xindex::do_write): New function. (Output_symtab_xindex::endian_do_write): New function. * output.h (class Output_section_headers): Add shstrtab_section_. Update declarations. (class Output_symtab_xindex): Define. (Output_section::has_out_shndx): New function. * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_ field. (Symbol::init_base): Add st_shndx and is_ordinary parameters. Change all callers. (Sized_symbol::init): Likewise. (Symbol::output_section): Check for ordinary symbol. (Symbol_table::add_from_object): Remove orig_sym parameter. Add st_shndx, is_ordinary, and orig_st_shndx parameters. Change all callers. (Symbol_table::add_from_relobj): Add symndx_offset parameter. Change all callers. Simplify handling of symbols from sections not included in the link. (Symbol_table::add_from_dynobj): Handle ordinary symbol distinction. (Weak_alias_sorter::operator()): Assert that symbols are ordinary. (Symbol_table::sized_finalize_symbol): Handle ordinary symbol distinction. (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex parameters. Change all callers. (Symbol_table::sized_write_globals): Likewise. Handle ordinary symbol distinction. Use SHN_XINDEX when needed. (Symbol_table::write_section_symbol): Add symtab_xindex parameter. Change all callers. (Symbol_table::sized_write_section_symbol): Likewise. Use SHN_XINDEX when needed. * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update declarations. (Symbol::shndx): Add is_ordinary parameter. Change all callers. (Symbol::is_defined): Check is_ordinary. (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise. (Symbol::is_absolute, Symbol::is_common): Likewise. (class Sized_symbol): Update declarations. (class Symbol_table): Update declarations. * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary parameters. Change all callers. (Sized_symbol::override): Likewise. (Symbol_table::override): Likewise. (symbol_to_bits): Add is_ordinary parameter. Change all callers. (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx, is_ordinary, and orig_st_shndx parameters. Change all callers. * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol to be in an ordinary section. * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add object and is_ordinary parameters. Change all callers. (Sized_dwarf_line_info::read_relocs): Add object parameter. Change all callers. Don't add undefined or non-ordinary symbols to reloc_map_. (Sized_dwarf_line_info::read_line_mappings): Add object parameter. Change all callers. * dwarf_reader.h (class Sized_dwarf_line_info): Update declarations. * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol. * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links. (Sized_relobj::relocate_sections): Likewise. * target-reloc.h (scan_relocs): Adjust section symbol index. (scan_relocatable_relocs): Likewise. * i386.cc (Scan::local): Check for ordinary symbols. * sparc.cc (Scan::local): Likewise. * x86_64.cc (Scan::local): Likewise. * testsuite/binary_unittest.cc (Sized_binary_test): Update calls to symbol_section_and_value. * testsuite/many_sections_test.cc: New file. * testsuite/Makefile.am (BUILT_SOURCES): Define. (check_PROGRAMS): Add many_sections_test. (many_sections_test_SOURCES): Define. (many_sections_test_DEPENDENCIES): Define. (many_sections_test_LDFLAGS): Define. (BUILT_SOURCES): Add many_sections_define.h. (many_sections_define.h): New target. (BUILT_SOURCES): Add many_sections_check.h. (many_sections_check.h): New target. (check_PROGRAMS): Add many_sections_r_test. (many_sections_r_test_SOURCES): Define. (many_sections_r_test_DEPENDENCIES): Define. (many_sections_r_test_LDFLAGS): Define. (many_sections_r_test_LDADD): Define. (many_sections_r_test.o): New target. * testsuite/Makefile.in: Rebuild.
2008-04-02 * fileread.cc (File_read::find_view): Add byteshift and vshiftedIan Lance Taylor1-5/+7
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-07Increase maximum bucket size for dynamic hash tables.Ian Lance Taylor1-2/+2
2008-03-07From Craig Silverstein: implement --hash-bucket-empty-fraction for real.Ian Lance Taylor1-1/+3
2008-02-29Remove gcc 3.2 compatibility hacks.Ian Lance Taylor1-39/+23
2008-02-28From Craig Silverstein: Have Parameters point to General_options.Ian Lance Taylor1-10/+10
2008-02-26From Craig Silverstein: rework handling of Script_options.Ian Lance Taylor1-4/+4
2008-02-13Assignments in linker scripts override definitions from object files.Ian Lance Taylor1-1/+1
2008-01-26Don't pass around the target in order to define symbols; get it fromIan Lance Taylor1-3/+3
the parameters instead.
2008-01-24Originally from Craig Silverstein, with changes: support using aIan Lance Taylor1-4/+1
version script to force symbols to be local.
2008-01-18Don't include options.h in fileread.h. Remove General_optionsIan Lance Taylor1-0/+2
reference from Output_file class.
2008-01-15From Andrew Chatham and Craig Silverstein: Add support for versionIan Lance Taylor1-13/+51
scripts.
2008-01-02Reduce the number of system calls. Use readv instead of pread. DoIan Lance Taylor1-1/+5
better handling of cached views.
2007-12-21From Cary Coutant: Fix handling of versioned symbols, add some tests.Ian Lance Taylor1-0/+1
2007-12-19Avoid some warnings which showed up in 64-bit mode.Ian Lance Taylor1-16/+22
2007-12-18Add section_size_type and section_offset_type, use them to replace aIan Lance Taylor1-9/+11
lot of instances of off_t.
2007-11-15From Craig Silverstein: Add support for --demangle.Ian Lance Taylor1-1/+1
2007-11-14Warn about undefined references in shared libraries if we have seenIan Lance Taylor1-41/+54
all the DT_NEEDED entries for that library.
2007-11-09Generate a complete exception frame header. Discard duplicateIan Lance Taylor1-0/+2
exception frame information.
2007-11-07From Craig Silverstein: Handle a .so file in a .a file.Ian Lance Taylor1-3/+26
2007-10-23Add support for PT_GNU_STACK.Ian Lance Taylor1-6/+5
2007-10-22Fix versions of copied symbols.Ian Lance Taylor1-13/+30
2007-10-14Run all error handling through an Errors object. Delete output fileIan Lance Taylor1-110/+61
on error.
2007-10-12Add an option for Stringpools to not copy strings.Ian Lance Taylor1-2/+2
2007-10-09Fix soname for library found in search path.Ian Lance Taylor1-1/+1
2007-10-02From Craig Silverstein: avoid some signed/unsigned warnings from gcc 4.2.Ian Lance Taylor1-1/+1
2007-09-26Put size and endianness in parameters.Ian Lance Taylor1-29/+65
2007-09-25Add cache parameter to get_view. Discard uncached views on unlock.Ian Lance Taylor1-5/+7
Fix bug this exposed in archive armap symbol name handling.
2007-09-22Add licensing text to every source file.Ian Lance Taylor1-0/+20
2007-09-21Add global parameters.Ian Lance Taylor1-14/+8
2007-09-12Don't try to find version definition index when creating an executable.Ian Lance Taylor1-4/+14
2007-09-11Only create a version definition for a shared library. Set theIan Lance Taylor1-1/+5
dynamic symbol index for a version definition when finalizing versions.
2007-09-04Add support for --enable-target to control which templateIan Lance Taylor1-0/+32
specializations we generate.
2006-12-06Don't emit symbols seen only in dynamic object, don't read duplicateIan Lance Taylor1-6/+6
dynamic object.
2006-12-06gcc 3.2.2 and 4.1.0 portability hacks.Ian Lance Taylor1-70/+95
2006-12-06Generate version information.Ian Lance Taylor1-148/+693
2006-11-29Hash tables, dynamic section, i386 PLT, gold_assert.Ian Lance Taylor1-14/+421
2006-11-14More dynamic object support, initial scripting support.Ian Lance Taylor1-0/+670