This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [patch] Remove is_merge_section_for
- From: Cary Coutant <ccoutant at google dot com>
- To: Rafael EspÃndola <rafael dot espindola at gmail dot com>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Sat, 21 Mar 2015 12:08:38 -0700
- Subject: Re: [patch] Remove is_merge_section_for
- Authentication-results: sourceware.org; auth=none
- References: <CAG3jReLX_6ZV9oWeJHp8NVroph9WjB1brdeZHyUjLAVjPxcZjg at mail dot gmail dot com>
> Now that Input_merge_map has an Output_section_data, we can use it in
> implementing find_merge_section and replace the only use of
> is_merge_section_for with it.
@@ -151,6 +150,11 @@ class Object_merge_map
Input_merge_map*
get_input_merge_map(unsigned int shndx);
+ const Input_merge_map*
+ get_input_merge_map(unsigned int shndx) const {
+ return const_cast<Object_merge_map*>(this)->get_input_merge_map(shndx);
+ }
When you need both const and non-const versions of a method, have the
non-const version call the const version, instead of the other way
around.
+// Build the lookup maps for relaxed sections. This is needs
// to be declared as a const methods so that it is callable with a const
s/is needs/needs/
s/as a const methods/as a const method/
+ const Output_section_data* data = this->find_merge_section(object, shndx);
+ if (!data)
I prefer "if (data == NULL)".
This is OK, with a ChangeLog entry and those fixes.
Thanks!
-cary