diff options
author | Ian Lance Taylor <iant@google.com> | 2007-10-16 22:38:36 +0000 |
---|---|---|
committer | Ian Lance Taylor <iant@google.com> | 2007-10-16 22:38:36 +0000 |
commit | 0c5e9c22aa5e70354471a6314c9c624c22719266 (patch) | |
tree | b94bce685c6afa90a8a7fe7edd88fe8e558c1219 /gold/options.h | |
parent | 928a4139f6eedb83ca83a58d42c2ba54ab8dd536 (diff) | |
download | gdb-0c5e9c22aa5e70354471a6314c9c624c22719266.zip gdb-0c5e9c22aa5e70354471a6314c9c624c22719266.tar.gz gdb-0c5e9c22aa5e70354471a6314c9c624c22719266.tar.bz2 |
From Craig Silverstein: implement -Ttext.
Diffstat (limited to 'gold/options.h')
-rw-r--r-- | gold/options.h | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/gold/options.h b/gold/options.h index 9848639..d32dd4a 100644 --- a/gold/options.h +++ b/gold/options.h @@ -169,7 +169,7 @@ class General_options is_static() const { return this->is_static_; } - // --statis: Print resource usage statistics. + // --stats: Print resource usage statistics. bool print_stats() const { return this->print_stats_; } @@ -179,6 +179,16 @@ class General_options sysroot() const { return this->sysroot_; } + // -Ttext: The address of the .text section + uint64_t + text_segment_address() const + { return this->text_segment_address_; } + + // Whether -Ttext was used. + bool + user_set_text_segment_address() const + { return this->text_segment_address_ != -1U; } + private: // Don't copy this structure. General_options(const General_options&); @@ -265,6 +275,20 @@ class General_options { this->sysroot_ = arg; } void + set_text_segment_address(const char* arg) + { + char* endptr; + this->text_segment_address_ = strtoull(arg, &endptr, 0); + if (*endptr != '\0' + || this->text_segment_address_ == -1U) + { + fprintf(stderr, _("%s: invalid argument to -Ttext: %s\n"), + program_name, arg); + ::exit(1); + } + } + + void ignore(const char*) { } @@ -286,6 +310,7 @@ class General_options bool is_static_; bool print_stats_; std::string sysroot_; + uint64_t text_segment_address_; }; // The current state of the position dependent options. |