aboutsummaryrefslogtreecommitdiff
path: root/gold/options.h
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>2009-02-28 04:39:57 +0000
committerIan Lance Taylor <ian@airs.com>2009-02-28 04:39:57 +0000
commitfd9d194f0467de25e3d6e6131d641f179d7eb289 (patch)
treec99595f96a991235d7001c53d9ba332abae711a4 /gold/options.h
parent61edd21fa41ccf31fe391ee320c4812c4d45486a (diff)
downloadgdb-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/options.h')
-rw-r--r--gold/options.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/gold/options.h b/gold/options.h
index 1d30a56..7fd9a00 100644
--- a/gold/options.h
+++ b/gold/options.h
@@ -534,9 +534,22 @@ class Search_directory
is_in_sysroot() const
{ return this->is_in_sysroot_; }
+ // Return whether this is considered a system directory.
+ bool
+ is_system_directory() const
+ { return this->put_in_sysroot_ || this->is_in_sysroot_; }
+
private:
+ // The directory name.
std::string name_;
+ // True if the sysroot should be added as a prefix for this
+ // directory (if there is a sysroot). This is true for system
+ // directories that we search by default.
bool put_in_sysroot_;
+ // True if this directory is in the sysroot (if there is a sysroot).
+ // This is true if there is a sysroot and either 1) put_in_sysroot_
+ // is true, or 2) the directory happens to be in the sysroot based
+ // on a pathname comparison.
bool is_in_sysroot_;
};
@@ -962,6 +975,10 @@ class General_options
Object_format format_enum() const;
Object_format oformat_enum() const;
+ // Return whether FILENAME is in a system directory.
+ bool
+ is_in_system_directory(const std::string& name) const;
+
// These are the best way to get access to the execstack state,
// not execstack() and noexecstack() which are hard to use properly.
bool