aboutsummaryrefslogtreecommitdiff
path: root/gold/merge.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2007-10-14 06:49:14 +0000
committerIan Lance Taylor <iant@google.com>2007-10-14 06:49:14 +0000
commit75f2446ec3c13eca3fe0c7cfdbb232e760d36596 (patch)
treea243e4c2c79cd8790a316a38b552507b62bf0421 /gold/merge.cc
parenteb4dfdd470e49ab56eed5cead19704e0926530d0 (diff)
downloadgdb-75f2446ec3c13eca3fe0c7cfdbb232e760d36596.zip
gdb-75f2446ec3c13eca3fe0c7cfdbb232e760d36596.tar.gz
gdb-75f2446ec3c13eca3fe0c7cfdbb232e760d36596.tar.bz2
Run all error handling through an Errors object. Delete output file
on error.
Diffstat (limited to 'gold/merge.cc')
-rw-r--r--gold/merge.cc18
1 files changed, 7 insertions, 11 deletions
diff --git a/gold/merge.cc b/gold/merge.cc
index dc293ab..f31b44e 100644
--- a/gold/merge.cc
+++ b/gold/merge.cc
@@ -169,7 +169,7 @@ Output_merge_data::add_constant(const unsigned char* p)
this->alc_ *= 2;
this->p_ = static_cast<unsigned char*>(realloc(this->p_, this->alc_));
if (this->p_ == NULL)
- gold_fatal("out of memory", true);
+ gold_nomem();
}
memcpy(this->p_ + this->len_, p, entsize);
@@ -251,11 +251,9 @@ Output_merge_string<Char_type>::do_add_input_section(Relobj* object,
if (len % sizeof(Char_type) != 0)
{
- fprintf(stderr,
- _("%s: %s: mergeable string section length not multiple of "
- "character size\n"),
- program_name, object->name().c_str());
- gold_exit(false);
+ object->error(_("mergeable string section length not multiple of "
+ "character size"));
+ return false;
}
len /= sizeof(Char_type);
@@ -268,11 +266,9 @@ Output_merge_string<Char_type>::do_add_input_section(Relobj* object,
++plen;
if (i + plen >= len)
{
- fprintf(stderr,
- _("%s: %s: entry in mergeable string section "
- "not null terminated\n"),
- program_name, object->name().c_str());
- gold_exit(false);
+ object->error(_("entry in mergeable string section "
+ "not null terminated"));
+ break;
}
}