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...

00000948 <is_ctor_called_irelative>:
     948:       f001 bb2e       b.w     1fa8
<_ZN9libunwind13Registers_arm19restoreiWMMXControlEPj+0x14>
....
    1fa8:       46c04778                        ; <UNDEFINED> instruction:
0x46c04778
    1fac:       e59fc000        ldr     ip, [pc]        ; 1fb4
<_ZN9libunwind13Registers_arm19restoreiWMMXControlEPj+0x20>
    1fb0:       e08cf00f        add     pc, ip, pc
    1fb4:       ffffe96d                        ; <UNDEFINED> instruction:
0xffffe96d
    1fb8:       46c04778                        ; <UNDEFINED> instruction:
0x46c04778
    1fbc:       e59fc000        ldr     ip, [pc]        ; 1fc4
<_ZN9libunwind13Registers_arm19restoreiWMMXControlEPj+0x30>
    1fc0:       e08cf00f        add     pc, ip, pc
    1fc4:       ffffe7c4                        ; <UNDEFINED> instruction:
0xffffe7c4
    1fc8:       46c04778                        ; <UNDEFINED> instruction:
0x46c04778
    1fcc:       e59fc000        ldr     ip, [pc]        ; 1fd4
<_ZN9libunwind13Registers_arm19restoreiWMMXControlEPj+0x40>
    1fd0:       e08cf00f        add     pc, ip, pc
    1fd4:       ffffff4c                        ; <UNDEFINED> instruction:
0xffffff4c
    1fd8:       46c04778                        ; <UNDEFINED> instruction:
0x46c04778
    1fdc:       e59fc000        ldr     ip, [pc]        ; 1fe4
<_ZN9libunwind13Registers_arm19restoreiWMMXControlEPj+0x50>
    1fe0:       e08cf00f        add     pc, ip, pc
    1fe4:       ffffffac                        ; <UNDEFINED> instruction:
0xffffffac


which seems to be wrong.

Note that other platforms work fine and generate correct code for this - tested
arm64/x86/x86_64

Reply via email to