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

            Bug ID: 85915
           Summary: -mfunction-return=thunk causes multiple definition of
                    `__x86_return_thunk'
           Product: gcc
           Version: 8.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: Arfrever.FTA at GMail dot Com
                CC: hjl.tools at gmail dot com
  Target Milestone: ---

This is a regression in GCC 8.1.0.


$ gcc-7.3.0 -mfunction-return=thunk -o test -x c - <<< 'int main(){}'
$ gcc-8.1.0 -mfunction-return=thunk -o test -x c - <<< 'int main(){}'
/usr/lib64/libc_nonshared.a(elf-init.oS): In function `__x86_return_thunk':
(.text.__x86_indirect_thunk[__x86_indirect_thunk]+0x0): multiple definition of
`__x86_return_thunk'
/tmp/ccPGIDNm.o::(.text.__x86_return_thunk[__x86_return_thunk]+0x0): first
defined here
collect2: error: ld returned 1 exit status


I use glibc-2.27, binutils-2.30.
Most of my system (including glibc) was compiled with GCC 7.3.0 with CFLAGS /
CXXFLAGS including -mfunction-return=thunk -mindirect-branch=thunk
-mindirect-branch-register.
I suspect that this bug might be reproducible only when glibc was compiled with
-mfunction-return=thunk.

Reply via email to