diff options
author | Ian Lance Taylor <ian@airs.com> | 2009-02-28 04:39:57 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 2009-02-28 04:39:57 +0000 |
commit | fd9d194f0467de25e3d6e6131d641f179d7eb289 (patch) | |
tree | c99595f96a991235d7001c53d9ba332abae711a4 /gold/symtab.cc | |
parent | 61edd21fa41ccf31fe391ee320c4812c4d45486a (diff) | |
download | gdb-fd9d194f0467de25e3d6e6131d641f179d7eb289.zip gdb-fd9d194f0467de25e3d6e6131d641f179d7eb289.tar.gz gdb-fd9d194f0467de25e3d6e6131d641f179d7eb289.tar.bz2 |
PR 6811
* options.h (class Search_directory): Add is_system_directory.
(class General_options): Declare is_in_system_directory.
* options.cc (get_relative_sysroot): Make static.
(get_default_sysroot): Make static.
(General_optoins::is_in_system_directory): New function.
* fileread.cc (Input_file::is_in_system_directory): New function.
* fileread.h (class Input_file): Declare is_in_system_directory.
* object.h (class Object): Add is_in_system_directory.
(class Input_objects): Remove system_library_directory_ field.
* object.cc (Input_objects::add_object): Don't set
system_library_directory_.
(input_objects::found_in_system_library_directory): Remove.
* symtab.cc (Symbol_table::write_globals): Remove input_objects
parameter. Change all callers.
(Symbol_table::sized_write_globals): Likewise.
(Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
Call Object::is_in_system_directory.
* symtab.h (class Symbol_table): Update declarations.
Diffstat (limited to 'gold/symtab.cc')
-rw-r--r-- | gold/symtab.cc | 35 |
1 files changed, 13 insertions, 22 deletions
diff --git a/gold/symtab.cc b/gold/symtab.cc index dcbb46e..46bed68 100644 --- a/gold/symtab.cc +++ b/gold/symtab.cc @@ -2373,8 +2373,7 @@ Symbol_table::sized_finalize_symbol(Symbol* unsized_sym) // Write out the global symbols. void -Symbol_table::write_globals(const Input_objects* input_objects, - const Stringpool* sympool, +Symbol_table::write_globals(const Stringpool* sympool, const Stringpool* dynpool, Output_symtab_xindex* symtab_xindex, Output_symtab_xindex* dynsym_xindex, @@ -2384,29 +2383,25 @@ Symbol_table::write_globals(const Input_objects* input_objects, { #ifdef HAVE_TARGET_32_LITTLE case Parameters::TARGET_32_LITTLE: - this->sized_write_globals<32, false>(input_objects, sympool, - dynpool, symtab_xindex, + this->sized_write_globals<32, false>(sympool, dynpool, symtab_xindex, dynsym_xindex, of); break; #endif #ifdef HAVE_TARGET_32_BIG case Parameters::TARGET_32_BIG: - this->sized_write_globals<32, true>(input_objects, sympool, - dynpool, symtab_xindex, + this->sized_write_globals<32, true>(sympool, dynpool, symtab_xindex, dynsym_xindex, of); break; #endif #ifdef HAVE_TARGET_64_LITTLE case Parameters::TARGET_64_LITTLE: - this->sized_write_globals<64, false>(input_objects, sympool, - dynpool, symtab_xindex, + this->sized_write_globals<64, false>(sympool, dynpool, symtab_xindex, dynsym_xindex, of); break; #endif #ifdef HAVE_TARGET_64_BIG case Parameters::TARGET_64_BIG: - this->sized_write_globals<64, true>(input_objects, sympool, - dynpool, symtab_xindex, + this->sized_write_globals<64, true>(sympool, dynpool, symtab_xindex, dynsym_xindex, of); break; #endif @@ -2419,8 +2414,7 @@ Symbol_table::write_globals(const Input_objects* input_objects, template<int size, bool big_endian> void -Symbol_table::sized_write_globals(const Input_objects* input_objects, - const Stringpool* sympool, +Symbol_table::sized_write_globals(const Stringpool* sympool, const Stringpool* dynpool, Output_symtab_xindex* symtab_xindex, Output_symtab_xindex* dynsym_xindex, @@ -2456,7 +2450,7 @@ Symbol_table::sized_write_globals(const Input_objects* input_objects, Sized_symbol<size>* sym = static_cast<Sized_symbol<size>*>(p->second); // Possibly warn about unresolved symbols in shared libraries. - this->warn_about_undefined_dynobj_symbol(input_objects, sym); + this->warn_about_undefined_dynobj_symbol(sym); unsigned int sym_index = sym->symtab_index(); unsigned int dynsym_index; @@ -2621,16 +2615,13 @@ Symbol_table::sized_write_symbol( // entry, we aren't going to be able to reliably report whether the // symbol is undefined. -// We also don't warn about libraries found in the system library -// directory (the directory were we find libc.so); we assume that -// those libraries are OK. This heuristic avoids problems in -// GNU/Linux, in which -ldl can have undefined references satisfied by -// ld-linux.so. +// We also don't warn about libraries found in a system library +// directory (e.g., /lib or /usr/lib); we assume that those libraries +// are OK. This heuristic avoids problems on GNU/Linux, in which -ldl +// can have undefined references satisfied by ld-linux.so. inline void -Symbol_table::warn_about_undefined_dynobj_symbol( - const Input_objects* input_objects, - Symbol* sym) const +Symbol_table::warn_about_undefined_dynobj_symbol(Symbol* sym) const { bool dummy; if (sym->source() == Symbol::FROM_OBJECT @@ -2639,7 +2630,7 @@ Symbol_table::warn_about_undefined_dynobj_symbol( && sym->binding() != elfcpp::STB_WEAK && !parameters->options().allow_shlib_undefined() && !parameters->target().is_defined_by_abi(sym) - && !input_objects->found_in_system_library_directory(sym->object())) + && !sym->object()->is_in_system_directory()) { // A very ugly cast. Dynobj* dynobj = static_cast<Dynobj*>(sym->object()); |