This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: gold patch committed: Fix x86_64 Linux kernel build
- From: Ian Lance Taylor <iant at google dot com>
- To: Daniel Gutson <dgutson at codesourcery dot com>
- Cc: binutils at sourceware dot org
- Date: Wed, 24 Jun 2009 23:04:02 -0700
- Subject: Re: gold patch committed: Fix x86_64 Linux kernel build
- References: <m3prct2ywi.fsf@google.com> <4A42D561.9060507@codesourcery.com>
Daniel Gutson <dgutson@codesourcery.com> writes:
> Hi Ian, sorry my ignorance, question about:
>
> +// Create automatic note sections.
> +
> +void
> +Layout::create_notes()
> +{
> + this->create_gold_note();
> + this->create_executable_stack_info();
> + this->create_build_id();
> +}
> +
>
> Do those methods have a global version, so that's why you have to
> explicit this-> ?
This case would work without the explicit "this->". However, the gold
code is very template heavy. In templated code, the details of how a
name is resolved depend upon whether the the name is template parameter
dependent or not. To avoid any possible confusion, gold always uses an
explicit "this->" when referring to class members or functions.
A simple example:
int count;
struct Base
{
int count;
};
template <typename T>
class Derived : public Base
{
// Increments ::count, not Base::count!
void bump_count() { ++count; } // ++this->count works.
};
Ian