From 9e2dcb779c27737af88468b29aa1d2a15b0b770f Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor <iant@google.com> Date: Wed, 10 Oct 2007 19:02:56 +0000 Subject: Implement -s and -S options which strip symbols. --- gold/options.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'gold/options.h') diff --git a/gold/options.h b/gold/options.h index 159e7b2..1e850cf 100644 --- a/gold/options.h +++ b/gold/options.h @@ -134,6 +134,16 @@ class General_options is_relocatable() const { return this->is_relocatable_; } + // -s: Strip all symbols. + bool + strip_all() const + { return this->strip_ == STRIP_ALL; } + + // -S: Strip debugging information. + bool + strip_debug() const + { return this->strip_ == STRIP_ALL || this->strip_ == STRIP_DEBUG; } + // --eh-frame-hdr: Whether to generate an exception frame header. bool create_eh_frame_hdr() const @@ -172,6 +182,17 @@ class General_options friend class Command_line; friend class options::Command_line_options; + // Which symbols to strip. + enum Strip + { + // Don't strip any symbols. + STRIP_NONE, + // Strip all symbols. + STRIP_ALL, + // Strip debugging information. + STRIP_DEBUG + }; + void set_export_dynamic() { this->export_dynamic_ = true; } @@ -201,6 +222,14 @@ class General_options { this->is_relocatable_ = true; } void + set_strip_all() + { this->strip_ = STRIP_ALL; } + + void + set_strip_debug() + { this->strip_ = STRIP_DEBUG; } + + void set_create_eh_frame_hdr() { this->create_eh_frame_hdr_ = true; } @@ -238,6 +267,7 @@ class General_options int optimization_level_; const char* output_file_name_; bool is_relocatable_; + Strip strip_; bool create_eh_frame_hdr_; Dir_list rpath_; Dir_list rpath_link_; -- cgit v1.1