aboutsummaryrefslogtreecommitdiff
path: root/gold/options.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2008-03-07 07:00:48 +0000
committerIan Lance Taylor <iant@google.com>2008-03-07 07:00:48 +0000
commitc18476e7f14b56840771a64f13889078ccce685a (patch)
tree4f74513ded0d3023affed4d9bd5ce1da27112a41 /gold/options.cc
parentfb57e4dc7b25cad875af7fbdec1c05a5a50909ee (diff)
downloadgdb-c18476e7f14b56840771a64f13889078ccce685a.zip
gdb-c18476e7f14b56840771a64f13889078ccce685a.tar.gz
gdb-c18476e7f14b56840771a64f13889078ccce685a.tar.bz2
Recognize --hash-bucket-empty-fraction.
Diffstat (limited to 'gold/options.cc')
-rw-r--r--gold/options.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/gold/options.cc b/gold/options.cc
index b27afe8..916ccf4 100644
--- a/gold/options.cc
+++ b/gold/options.cc
@@ -172,6 +172,17 @@ parse_uint64(const char* option_name, const char* arg, uint64_t *retval)
}
void
+parse_double(const char* option_name, const char* arg, double* retval)
+{
+ char* endptr;
+ *retval = strtod(arg, &endptr);
+ if (*endptr != '\0')
+ gold_fatal(_("%s: invalid option value "
+ "(expected a floating point number): %s"),
+ option_name, arg);
+}
+
+void
parse_string(const char* option_name, const char* arg, const char** retval)
{
if (*arg == '\0')
@@ -661,6 +672,13 @@ General_options::finalize()
&& (this->shared() || this->relocatable()))
gold_fatal(_("binary output format not compatible with -shared or -r"));
+ if (this->user_set_hash_bucket_empty_fraction()
+ && (this->hash_bucket_empty_fraction() < 0.0
+ || this->hash_bucket_empty_fraction() >= 1.0))
+ gold_fatal(_("--hash-bucket-empty-fraction value %g out of range "
+ "[0.0, 1.0)"),
+ this->hash_bucket_empty_fraction());
+
// FIXME: we can/should be doing a lot more sanity checking here.
}