public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [GOLD] warning fixes
@ 2016-09-26  8:52 Alan Modra
  0 siblings, 0 replies; 3+ messages in thread
From: Alan Modra @ 2016-09-26  8:52 UTC (permalink / raw)
  To: binutils

	* aarch64.cc (Target_aarch64::is_erratum_835769_sequence): Avoid
	compiler warning.
	* output.cc (Output_segment::set_section_addresses): Likewise.

diff --git a/gold/aarch64.cc b/gold/aarch64.cc
index ab7e563..310331c 100644
--- a/gold/aarch64.cc
+++ b/gold/aarch64.cc
@@ -8126,7 +8126,7 @@ Target_aarch64<size, big_endian>::is_erratum_835769_sequence(
     typename elfcpp::Swap<32,big_endian>::Valtype insn2)
 {
   uint32_t rt;
-  uint32_t rt2;
+  uint32_t rt2 = 0;
   uint32_t rn;
   uint32_t rm;
   uint32_t ra;
diff --git a/gold/output.cc b/gold/output.cc
index 0a9e58f..8e043d7 100644
--- a/gold/output.cc
+++ b/gold/output.cc
@@ -4398,7 +4398,7 @@ Output_segment::set_section_addresses(const Target* target,
   this->offset_ = orig_off;
 
   off_t off = 0;
-  uint64_t ret;
+  uint64_t ret = 0;
   for (int i = 0; i < static_cast<int>(ORDER_MAX); ++i)
     {
       if (i == static_cast<int>(ORDER_RELRO_LAST))

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [GOLD] warning fixes
  2013-03-20 23:55 Alan Modra
@ 2013-03-21  0:07 ` Ian Lance Taylor
  0 siblings, 0 replies; 3+ messages in thread
From: Ian Lance Taylor @ 2013-03-21  0:07 UTC (permalink / raw)
  To: Binutils

On Wed, Mar 20, 2013 at 4:55 PM, Alan Modra <amodra@gmail.com> wrote:
>
>         * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
>         comparison warning.
>         * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
>         uninitialized" warning.

This is OK.

Thanks.

Ian

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [GOLD] warning fixes
@ 2013-03-20 23:55 Alan Modra
  2013-03-21  0:07 ` Ian Lance Taylor
  0 siblings, 1 reply; 3+ messages in thread
From: Alan Modra @ 2013-03-20 23:55 UTC (permalink / raw)
  To: binutils

A couple of warning fixes.  The first was found with gcc-4.3.4, the
second with gcc-4.7.2 and -O3.  OK?

	* dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
	comparison warning.
	* layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
	uninitialized" warning.

Index: gold/dwp.cc
===================================================================
RCS file: /cvs/src/src/gold/dwp.cc,v
retrieving revision 1.7
diff -u -p -r1.7 dwp.cc
--- gold/dwp.cc	1 Mar 2013 23:05:27 -0000	1.7
+++ gold/dwp.cc	20 Mar 2013 23:45:41 -0000
@@ -1476,7 +1476,7 @@ Dwp_output_file::add_contribution(elfcpp
 				  int align)
 {
   const char* section_name = get_dwarf_section_name(section_id);
-  gold_assert(section_id < this->section_id_map_.size());
+  gold_assert(static_cast<size_t>(section_id) < this->section_id_map_.size());
   unsigned int shndx = this->section_id_map_[section_id];
 
   // Create the section if necessary.
Index: gold/layout.cc
===================================================================
RCS file: /cvs/src/src/gold/layout.cc,v
retrieving revision 1.246
diff -u -p -r1.246 layout.cc
--- gold/layout.cc	10 Mar 2013 23:08:18 -0000	1.246
+++ gold/layout.cc	20 Mar 2013 23:45:41 -0000
@@ -4158,7 +4158,7 @@ Layout::create_dynamic_symtab(const Inpu
 						       false,
 						       ORDER_DYNAMIC_LINKER,
 						       false);
-
+  *pdynstr = dynstr;
   if (dynstr != NULL)
     {
       Output_section_data* strdata = new Output_data_strtab(&this->dynpool_);
@@ -4174,8 +4174,6 @@ Layout::create_dynamic_symtab(const Inpu
 	  odyn->add_section_address(elfcpp::DT_STRTAB, dynstr);
 	  odyn->add_section_size(elfcpp::DT_STRSZ, dynstr);
 	}
-
-      *pdynstr = dynstr;
     }
 
   // Create the hash tables.

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-09-26  8:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-26  8:52 [GOLD] warning fixes Alan Modra
  -- strict thread matches above, loose matches on Subject: below --
2013-03-20 23:55 Alan Modra
2013-03-21  0:07 ` Ian Lance Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).