[Bug target/85915] New: -mfunction-return=thunk causes multiple definition of `__x86_return_thunk'

Arfrever.FTA at GMail dot Com gcc-bugzilla@gcc.gnu.org
Fri May 25 05:20:00 GMT 2018


            Bug ID: 85915
           Summary: -mfunction-return=thunk causes multiple definition of
           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
/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
I suspect that this bug might be reproducible only when glibc was compiled with

More information about the Gcc-bugs mailing list