http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57366

--- Comment #4 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
Thank you. It seems that the weakref is simply not output into the file, so we
end up with undefined call.
What happens when you compile the following manually concatenated testcase w/o
LTO? If it links, can you attach the assembly? I am bit unsure how non-weakref
targets are supposed to behave in situations like this.

I convinced myself that for LTO one needs GNU binutils and thus weakref is
supported, but it is obviously not always the case ;)

Honza

int first = 0;
void abort (void);
int second = 0;
void callmealias (void)
{
  if (!first || !second)
   abort ();
}
void callmefirst (void)
{
  if (first)
    abort();
  first = 1;
}
void callmesecond (void)
{
  if (!first)
    abort();
  if (second)
    abort();
  second = 1;
}
main()
{
  c();
  b();
  return 0;
}
extern void callmesecond();
static void callmealias2() __attribute__((weakref ("callmesecond")));

b()
{
  callmealias2();
}
extern void callmefirst();
static void callmealias3() __attribute__((weakref ("callmefirst")));

c()
{
  callmealias3();
}

Reply via email to