aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoug Kwan <dougkwan@google.com>2009-12-12 01:26:12 +0000
committerDoug Kwan <dougkwan@google.com>2009-12-12 01:26:12 +0000
commitb0eec2ccdafc32f2d0d82d8582fe28d91ea5a679 (patch)
tree389b8f994b9bf250f380f78e2bebb9e0237f201e
parent759a05ce2497537aaf1982648a616ecd04127a4a (diff)
downloadgdb-b0eec2ccdafc32f2d0d82d8582fe28d91ea5a679.zip
gdb-b0eec2ccdafc32f2d0d82d8582fe28d91ea5a679.tar.gz
gdb-b0eec2ccdafc32f2d0d82d8582fe28d91ea5a679.tar.bz2
2009-12-11 Doug Kwan <dougkwan@google.com>
* arm.cc (Target_arm::do_finalize_sections): Fix build breakage due to -Wshadow. * attributes.cc (Object_attribute::size): Ditto. (Attributes_section_data::size): Ditto. (Attributes_section_data::Attributes_section_data): Ditto. (Output_attributes_section_data::do_write): Ditto. * attributes.h (Object_attribute::set_type): Ditto. * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
-rw-r--r--gold/ChangeLog11
-rw-r--r--gold/arm.cc7
-rw-r--r--gold/attributes.cc25
-rw-r--r--gold/attributes.h4
-rw-r--r--gold/testsuite/tls_test_main.cc8
5 files changed, 32 insertions, 23 deletions
diff --git a/gold/ChangeLog b/gold/ChangeLog
index 139dca5..a4ed9e8 100644
--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -1,3 +1,14 @@
+2009-12-11 Doug Kwan <dougkwan@google.com>
+
+ * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
+ due to -Wshadow.
+ * attributes.cc (Object_attribute::size): Ditto.
+ (Attributes_section_data::size): Ditto.
+ (Attributes_section_data::Attributes_section_data): Ditto.
+ (Output_attributes_section_data::do_write): Ditto.
+ * attributes.h (Object_attribute::set_type): Ditto.
+ * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
+
2009-12-11 Nick Clifton <nickc@redhat.com>
* archive.cc: Fix shadowed variable warnings.
diff --git a/gold/arm.cc b/gold/arm.cc
index f69593e..5faaf3c 100644
--- a/gold/arm.cc
+++ b/gold/arm.cc
@@ -4784,11 +4784,10 @@ Target_arm<big_endian>::do_finalize_sections(
}
// Create an .ARM.attributes section if there is not one already.
- Output_attributes_section_data* attributes_section =
+ Output_attributes_section_data* as =
new Output_attributes_section_data(*this->attributes_section_data_);
- layout->add_output_section_data(".ARM.attributes",
- elfcpp::SHT_ARM_ATTRIBUTES, 0,
- attributes_section, false);
+ alayout->add_output_section_data(".ARM.attributes",
+ elfcpp::SHT_ARM_ATTRIBUTES, 0, as, false);
}
// Return whether a direct absolute static relocation needs to be applied.
diff --git a/gold/attributes.cc b/gold/attributes.cc
index 6b2260d..7d82979 100644
--- a/gold/attributes.cc
+++ b/gold/attributes.cc
@@ -45,12 +45,12 @@ Object_attribute::size(int tag) const
if (this->is_default_attribute())
return 0;
- size_t size = get_length_as_unsigned_LEB_128(tag);
+ size_t uleb128_size = get_length_as_unsigned_LEB_128(tag);
if (Object_attribute::attribute_type_has_int_value(this->type_))
- size += get_length_as_unsigned_LEB_128(this->int_value_);
+ uleb128_size += get_length_as_unsigned_LEB_128(this->int_value_);
if (Object_attribute::attribute_type_has_string_value(this->type_))
- size += this->string_value_.size() + 1;
- return size;
+ uleb128_size += this->string_value_.size() + 1;
+ return uleb128_size;
}
// Whether this has the default value (0/"").
@@ -266,11 +266,11 @@ Attributes_section_data::size() const
}
// Construct an Attributes_section_data object by parsing section contents
-// specified by VIEW and SIZE.
+// specified by VIEW and VIEW_SIZE.
Attributes_section_data::Attributes_section_data(
const unsigned char* view,
- section_size_type size)
+ section_size_type view_size)
{
for (int vendor = OBJ_ATTR_FIRST; vendor <= OBJ_ATTR_LAST; ++vendor)
this->vendor_object_attributes_[vendor] =
@@ -280,16 +280,16 @@ Attributes_section_data::Attributes_section_data(
p = view;
if (*(p++) == 'A')
{
- size--;
- while (size > 0)
+ view_size--;
+ while (view_size > 0)
{
// Size of vendor attributes section.
section_size_type section_size =
convert_to_section_size_type(read_from_pointer<32>(&p));
- if (section_size > size)
- section_size = size;
- size -= section_size;
+ if (section_size > view_size)
+ section_size = view_size;
+ view_size -= section_size;
const char* section_name = reinterpret_cast<const char*>(p);
section_size_type section_name_size = strlen(section_name) + 1;
@@ -443,10 +443,9 @@ Attributes_section_data::write(std::vector<unsigned char>* buffer) const
void
Output_attributes_section_data::do_write(Output_file* of)
{
- off_t offset = this->offset();
const section_size_type oview_size =
convert_to_section_size_type(this->data_size());
- unsigned char* const oview = of->get_output_view(offset, oview_size);
+ unsigned char* const oview = of->get_output_view(this->offset(), oview_size);
std::vector<unsigned char> buffer;
this->attributes_section_data_.write(&buffer);
diff --git a/gold/attributes.h b/gold/attributes.h
index 7c4baf4..dbfba84 100644
--- a/gold/attributes.h
+++ b/gold/attributes.h
@@ -103,8 +103,8 @@ class Object_attribute
// Set attribute type.
void
- set_type(int type)
- { this->type_ = type; }
+ set_type(int at)
+ { this->type_ = at; }
// Return integer value.
unsigned int
diff --git a/gold/testsuite/tls_test_main.cc b/gold/testsuite/tls_test_main.cc
index 0ff02c6..877889c 100644
--- a/gold/testsuite/tls_test_main.cc
+++ b/gold/testsuite/tls_test_main.cc
@@ -33,16 +33,16 @@
#define safe_lock(muptr) \
do \
{ \
- int err = pthread_mutex_lock(muptr); \
- assert(err == 0); \
+ int pthread_err = pthread_mutex_lock(muptr); \
+ assert(pthread_err == 0); \
} \
while (0)
#define safe_unlock(muptr) \
do \
{ \
- int err = pthread_mutex_unlock(muptr); \
- assert(err == 0); \
+ int pthread_err = pthread_mutex_unlock(muptr); \
+ assert(pthread_err == 0); \
} \
while (0)