bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/30930] Broken BTI veneers: ld-2.41 links mame in a way which get


From: nsz at gcc dot gnu.org
Subject: [Bug ld/30930] Broken BTI veneers: ld-2.41 links mame in a way which gets stuck on aarch64
Date: Tue, 10 Oct 2023 16:08:02 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=30930

--- Comment #25 from Szabolcs Nagy <nsz at gcc dot gnu.org> ---
for the record i built a mame binary where

$ readelf -aW mame |grep
_ZN3emu6detail16device_registrar15register_deviceERNS0_21device_type_impl_baseE
885688: 00000000084323c8    12 FUNC    LOCAL  DEFAULT   14
___ZN3emu6detail16device_registrar15register_deviceERNS0_21device_type_impl_baseE_bti_veneer
1532712: 000000000964dc40   120 FUNC    GLOBAL DEFAULT   14
_ZN3emu6detail16device_registrar15register_deviceERNS0_21device_type_impl_baseE
$ objdump -d mame |grep -A5
'_ZN3emu6detail16device_registrar15register_deviceERNS0_21device_type_impl_baseE_bti_veneer>:'
00000000084323c8
<___ZN3emu6detail16device_registrar15register_deviceERNS0_21device_type_impl_baseE_bti_veneer>:
 84323c8:       90000010        adrp    x16, 8432000
<___ZN24device_execute_interface7suspendEjb_bti_veneer+0x10>
 84323cc:       910f2210        add     x16, x16, #0x3c8
 84323d0:       d61f0200        br      x16
        ...
$ objdump -d mame |grep -A4
'_ZN3emu6detail16device_registrar15register_deviceERNS0_21device_type_impl_baseE>:'
000000000c35b570
<_ZN3emu6detail16device_registrar15register_deviceERNS0_21device_type_impl_baseE>:
 c35b570:       d503245f        bti     c
 c35b574:       b0045701        adrp    x1, 14e3c000
<_ZN34option_guide_impl_dsk_option_guideL6actualE+0x10>
 c35b578:       d503233f        paciasp
 c35b57c:       a9bf7bfd        stp     x29, x30, [sp, #-16]!

this is broken in multiple ways:
- there is no *_veneer, only *_bti_veneer and
- *_bti_veneer is global symbol (not local)
- the code of the bti veneer is not the expected "bti c; b target" but an adrp
veneer that calls itself.
- bti veneer should not be emitted as the target has bti (opened bug 30957 )
and
- '_veneer' and '_bti_veneer' are attached to the symbol version instead of the
symbol (not sure yet if this causes problems), e.g.:

00000000005775b8 <___ZNSirsERi@@GLIBCXX_3.4_bti_veneer>:
  5775b8:       d503245f        bti     c
  5775bc:       17ffedbd        b       572cb0 <_ZNSirsERi@plt>

(it will take a few more days for me before i can look at it so i record the
issues in case somebody else has an idea what's going on)

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]