From Craig Silverstein: implement -Ttext.

This commit is contained in:
Ian Lance Taylor
2007-10-16 22:38:36 +00:00
parent 928a4139f6
commit 0c5e9c22aa
7 changed files with 64 additions and 31 deletions

View File

@@ -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&);
@@ -264,6 +274,20 @@ class General_options
set_sysroot(const char* arg)
{ 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.