https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71922
Bug ID: 71922
Summary: arm: ifuncs are broken in for arm (gcc generates
incorrect code in object file)
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: dimitry at google dot com
Target Milestone: ---
This is code in question:
https://android.googlesource.com/platform/bionic/+/master/tests/libs/dlopen_testlib_ifunc.c
This library is used to test ifunc functionality in android-linker.
after compiling an object file looks like this...
0948 :
948: f001 bb2e b.w 1fa8
<_ZN9libunwind13Registers_arm19restoreiWMMXControlEPj+0x14>
1fa8: 46c04778; instruction:
0x46c04778
1fac: e59fc000ldr ip, [pc]; 1fb4
<_ZN9libunwind13Registers_arm19restoreiWMMXControlEPj+0x20>
1fb0: e08cf00fadd pc, ip, pc
1fb4: e96d; instruction:
0xe96d
1fb8: 46c04778; instruction:
0x46c04778
1fbc: e59fc000ldr ip, [pc]; 1fc4
<_ZN9libunwind13Registers_arm19restoreiWMMXControlEPj+0x30>
1fc0: e08cf00fadd pc, ip, pc
1fc4: e7c4; instruction:
0xe7c4
1fc8: 46c04778; instruction:
0x46c04778
1fcc: e59fc000ldr ip, [pc]; 1fd4
<_ZN9libunwind13Registers_arm19restoreiWMMXControlEPj+0x40>
1fd0: e08cf00fadd pc, ip, pc
1fd4: ff4c; instruction:
0xff4c
1fd8: 46c04778; instruction:
0x46c04778
1fdc: e59fc000ldr ip, [pc]; 1fe4
<_ZN9libunwind13Registers_arm19restoreiWMMXControlEPj+0x50>
1fe0: e08cf00fadd pc, ip, pc
1fe4: ffac; instruction:
0xffac
which seems to be wrong.
Note that other platforms work fine and generate correct code for this - tested
arm64/x86/x86_64