This is the mail archive of the mailing list for the binutils project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [gold][aarch64]Patch for Relaxation

The problem seems to be the typedef for "This":

template<int size, bool big_endian>
class AArch64_relocate_functions
  typedef enum
    STATUS_OKAY, // No error during relocation.
    STATUS_OVERFLOW, // Relocation overflow.
    STATUS_BAD_RELOC, // Relocation cannot be applied.
  } Status;

  typedef AArch64_relocate_functions<size, big_endian> This;

Then inside AArch64_relocate_functions::maybe_apply_stub(), at line
4096, we use it to declare a This::Status:

  This::Status status = This::template
      rela_general<32>(view, branch_offset, 0, arp);

I reduced this down to a very small source and used the gcc 4.2.1 on
my Mac to reproduce (I don't have gold configured to build natively on
my Mac).

template<int size>
class A
  typedef enum { OK, BAD } Status;
  int foo();
  typedef A<size> This;
  int x;

template<int size>
int A<size>::foo()
  This::Status status = (x == size ? OK : BAD);
  return status == OK;

class A<32>;

If I change "This::Status" to just "Status", it compiles.

What puzzles me is that we use a similar typedef for "This" all over
gold, and I don't see offhand what's different about this one. (Maybe
this is just the first time the compiler runs into this problem, but
it seems unlikely, since the Makefile tends to build the target
sources last.

Any ideas?


On Thu, Oct 16, 2014 at 8:55 AM, Ian Lance Taylor <> wrote:
> On Thu, Oct 16, 2014 at 8:24 AM, Ryan Mansfield <> wrote:
>> I'm not aware of a documented required g++ version for binutils/gold. Is
>> there? I looked around but didn't find anything.
> There are some notes in gold/README.
> I think this is the first failure with GCC 4.2.  It would be nice to
> make it work, if possible.
> Ian

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]