gold patch committed: Fix x86_64 Linux kernel build
Ian Lance Taylor
iant@google.com
Thu Jun 25 09:20:00 GMT 2009
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
More information about the Binutils
mailing list