https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77957

            Bug ID: 77957
           Summary: [6/7 Regression] Undefined .LCTOC0 with
                    -fstack-protector-strong -mminimal-toc -O0 on ppc64le
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jakub at gcc dot gnu.org
  Target Milestone: ---

void
foo (void)
{
  unsigned long x = 0;
  asm volatile ("" : : "r" (&x) : "memory");
}

int
main ()
{
  foo ();
  return 0;
}

fails to link on powerpc64le-linux with -fstack-protector-strong -mminimal-toc
-O0:
gcc -fstack-protector-strong -mminimal-toc -O0 -o /tmp/test{,.c}
/tmp/ccldrAkU.o: In function `foo':
test.c:(.text+0x20): undefined reference to `.LCTOC0'
collect2: error: ld returned 1 exit status

I can reproduce also with a cross-compiler, the important trigger is that
TARGET_LIBC_PROVIDES_SSP must be defined to 1.  This compiled fine with 4.8,
fails with 6.2 and current trunk.

Reply via email to