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

            Bug ID: 88279
           Summary: unresolvable R_X86_64_DTPOFF32 relocation against
                    symbol `__gcov_indirect_call'
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hubicka at gcc dot gnu.org
  Target Milestone: ---

$ cat test.c
int (*ptr)(void);
static
int test2(void)
{
}
test()
{
  test3();
  ptr();
}
$ cat test2.c
int (*ptr)(void);
static
int test2(void)
{
}
test3()
{
  ptr();
}
$ ~/trunk-install/bin/gcc test.c  --shared -fPIC -lpthread -o dso1.so
-fprofile-generate -L ./ -O2 
test.c:6:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
    6 | test()
      | ^~~~
test.c: In function ‘test’:
test.c:8:3: warning: implicit declaration of function ‘test3’; did you mean
‘test’? [-Wimplicit-function-declaration]
    8 |   test3();
      |   ^~~~~
      |   test
$ ~/trunk-install/bin/gcc test2.c  --shared -fPIC dso1.so -o dso2.so
-fprofile-generate -L ./ -O2  --save-temps  -lpthread   -fuse-ld=bfd
test2.c:6:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
    6 | test3()
      | ^~~~~
/usr/bin/ld.bfd: test2.o(.text+0x10): unresolvable R_X86_64_DTPOFF32 relocation
against symbol `__gcov_indirect_call'
/usr/bin/ld.bfd: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status

Reply via email to