This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch 6/7] [gold] Add initial source code for dwp utility.


On Wed, Oct 24, 2012 at 5:10 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> 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.
>> ---
>>  gold/Makefile.am |    6 +-
>>  gold/Makefile.in |   22 +-
>>  gold/dwp.cc      | 2036 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
>>  gold/dwp.h       |  222 ++++++
>>  4 files changed, 2280 insertions(+), 6 deletions(-)
>>  create mode 100644 gold/dwp.cc
>>  create mode 100644 gold/dwp.h
>>
>
> It failed to build on 32-bit host:
>
> g++ -m32  -DHAVE_CONFIG_H -I.
> -I/export/linux/src/binutils/binutils/gold
> -I/export/linux/src/binutils/binutils/gold
> -I/export/linux/src/binutils/binutils/gold/../include
> -I/export/linux/src/binutils/binutils/gold/../elfcpp
> -DLOCALEDIR="\"/usr/local32/share/locale\""
> -DBINDIR="\"/usr/local32/bin\""
> -DTOOLBINDIR="\"/usr/local32/i686-linux/bin\""
> -DTOOLLIBDIR="\"/usr/local32/i686-linux/lib\""   -W -Wall    -Werror
> -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -frandom-seed=dwp.o -g -O2
> -MT dwp.o -MD -MP -MF .deps/dwp.Tpo -c -o dwp.o
> /export/linux/src/binutils/binutils/gold/dwp.cc
> /export/linux/src/binutils/binutils/gold/dwp.cc: In member function
> ‘unsigned int gold::Dwo_file::remap_str_offset(unsigned int)’:
> /export/linux/src/binutils/binutils/gold/dwp.cc:1334:54: error:
> comparison between signed and unsigned integer expressions
> [-Werror=sign-compare]
> /export/linux/src/binutils/binutils/gold/dwp.cc:1339:7: error:
> comparison between signed and unsigned integer expressions
> [-Werror=sign-compare]
>

This patch works for me.  Tested on Linux/x86-64 and Linux/ia32.
OK to install?

Thanks.

-- 
H.J.
---
diff --git a/gold/ChangeLog b/gold/ChangeLog
index 2256744..f0f53c2 100644
--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -1,3 +1,8 @@
+2012-10-24  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
+	on val.
+
 2012-10-23  Cary Coutant  <ccoutant@google.com>

 	* testsuite/Makefile.am (TEST_OBJCOPY): New macro.
diff --git a/gold/dwp.cc b/gold/dwp.cc
index 445d1af..aaee465 100644
--- a/gold/dwp.cc
+++ b/gold/dwp.cc
@@ -159,7 +159,7 @@ class Dwo_file
   // Remap a single string offsets from an offset in the input string table
   // to an offset in the output string table.
   unsigned int
-  remap_str_offset(unsigned int val);
+  remap_str_offset(section_offset_type val);

   // Add a set of .debug_info and related sections to OUTPUT_FILE.
   void
@@ -1321,7 +1321,7 @@ Dwo_file::sized_remap_str_offsets(const unsigned
char* contents,
 }

 unsigned int
-Dwo_file::remap_str_offset(unsigned int val)
+Dwo_file::remap_str_offset(section_offset_type val)
 {
   Str_offset_map_entry entry;
   entry.first = val;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]