This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [patch 6/7] [gold] Add initial source code for dwp utility.
- From: Cary Coutant <ccoutant at google dot com>
- To: Ian Lance Taylor <iant at google dot com>, binutils at sourceware dot org
- Date: Thu, 18 Oct 2012 14:55:23 -0700
- Subject: Re: [patch 6/7] [gold] Add initial source code for dwp utility.
- References: <20121018181651.9A3A2E0AA0@ccoutant.mtv.corp.google.com>
On Thu, Oct 18, 2012 at 11:16 AM, Cary Coutant <ccoutant@google.com> wrote:
> This patch adds the new source files for the dwp utility itself, and updates
> the gold Makefiles to build it.
>
> gold/
> * dwp.h: New header file.
> * dwp.cc: New source file.
> * Makefile.am: Add dwp.
> * Makefile.in: Regenerate.
I usually build and test with --enable-targets=all, so when I built
this with a restricted set of targets, I discovered that I need to add
ifdefs to guard calls to the various instantiations of
sized_make_object(); otherwise, I get unresolved references to
uninstantiated versions of that function.
I also discovered that I was initializing an int with NULL, and fixed
that. Here's an incremental diff relative to what I posted earlier.
Let me know if you'd like me to post the revised patch in its
entirety.
-cary
diff --git a/gold/dwp.cc b/gold/dwp.cc
index d847594..edab234 100644
--- a/gold/dwp.cc
+++ b/gold/dwp.cc
@@ -413,7 +413,7 @@ class Dwp_output_file
abiversion_(0), fd_(NULL), next_file_offset_(0), shnum_(1), sections_(),
shoff_(0), shstrndx_(0), have_strings_(false), stringpool_(),
shstrtab_(), cu_index_(), tu_index_(), last_type_sig_(0),
- last_tu_slot_(NULL)
+ last_tu_slot_(0)
{
this->stringpool_.set_no_zero_null();
}
@@ -938,16 +938,32 @@ Dwo_file::make_object
if (size == 32)
{
if (big_endian)
+#ifdef HAVE_TARGET_32_BIG
return this->sized_make_object<32, true>(p, input_file, output_file);
+#else
+ gold_unreachable();
+#endif
else
+#ifdef HAVE_TARGET_32_LITTLE
return this->sized_make_object<32, false>(p, input_file, output_file);
+#else
+ gold_unreachable();
+#endif
}
else if (size == 64)
{
if (big_endian)
+#ifdef HAVE_TARGET_64_BIG
return this->sized_make_object<64, true>(p, input_file, output_file);
+#else
+ gold_unreachable();
+#endif
else
+#ifdef HAVE_TARGET_64_LITTLE
return this->sized_make_object<64, false>(p, input_file, output_file);
+#else
+ gold_unreachable();
+#endif
}
else
gold_unreachable();