[Bug ld/30938] [RISCV]linking erro with lp64f

2023-10-10 Thread sch...@linux-m68k.org
https://sourceware.org/bugzilla/show_bug.cgi?id=30938

--- Comment #3 from Andreas Schwab  ---
crt1.o is part of libc, you need to build it for all multilibs.

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


[Bug libsframe/30956] A potential null_pointer_deference bug

2023-10-10 Thread nickc at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=30956

Nick Clifton  changed:

   What|Removed |Added

 CC||nickc at redhat dot com
 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |MOVED

--- Comment #1 from Nick Clifton  ---
Hi 姜瑞霖 

  Thank you for reporting these problems.  Unfortunately the libiberty library 
  is not managed by the GNU Binutils project.  We use the sources, but they are
  maintained by the GCC project, so please could you refile this bug report
here:

https://gcc.gnu.org/bugzilla/enter_bug.cgi?product=gcc

  Thank you.

Cheers
  Nick

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


[Bug gas/30850] gas arm: Strange behaviors while handling operator `[]`.

2023-10-10 Thread nickc at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=30850

Nick Clifton  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |NOTABUG
 CC||nickc at redhat dot com

--- Comment #2 from Nick Clifton  ---
Yes, this is the intended behaviour.

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


[Bug ld/30930] Broken BTI veneers: ld-2.41 links mame in a way which gets stuck on aarch64

2023-10-10 Thread carlos at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=30930

Carlos O'Donell  changed:

   What|Removed |Added

Summary|ld-2.41 links mame in a way |Broken BTI veneers: ld-2.41
   |which gets stuck on aarch64 |links mame in a way which
   ||gets stuck on aarch64

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


[Bug ld/30957] New: aarch64: unnecessary bti veneer

2023-10-10 Thread nsz at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=30957

Bug ID: 30957
   Summary: aarch64: unnecessary bti veneer
   Product: binutils
   Version: 2.41
Status: NEW
  Severity: normal
  Priority: P2
 Component: ld
  Assignee: unassigned at sourceware dot org
  Reporter: nsz at gcc dot gnu.org
  Target Milestone: ---

bti veneer is only needed if the target instruction is not bti (or
paciasp,...), but bfd ld sometimes emits the veneer unnecessarily. (gnu
property is for BTI marking)

(introduced by the fix for bug 30076 and causes large number of bti veneers in
large executables that uncovered other veneer issues see bug 30930 )

$ cat a.s
.section.a.text,"ax",@progbits
.align  2
.global a_func
.type   a_func, %function
a_func:
hint34 // bti c
b   b_func

.section.note.gnu.property,"a"
.align  3
.word   4
.word   16
.word   5
.string "GNU"
.word   3221225472
.word   4
.word   1
.align  3
$ cat b.s
.section.b.text,"ax",@progbits
.align  2
.global b_func
.type   b_func, %function
nop // offset the function so it is not at section start
b_func:
hint34 // bti c
ret
.global _start
.type   _start, %function
_start:
b   a_func

.section.note.gnu.property,"a"
.align  3
.word   4
.word   16
.word   5
.string "GNU"
.word   3221225472
.word   4
.word   1
.align  3
$ as -o a.o a.s
$ as -o b.o b.s
$ ld --section-start=.a.text=0x0004 --section-start=.b.text=0x08041000 a.o
b.o
$ objdump -d a.out
a.out: file format elf64-littleaarch64


Disassembly of section .a.text:

0004 :
   4:   d503245fbti c
   40004:   1405b   40018 <__b_func_veneer>
   40008:   140ab   40030 <__b_func_veneer+0x18>
   4000c:   d503201fnop

00040010 <__a_func_bti_veneer>:
   40010:   d503245fbti c
   40014:   17fbb   4 

00040018 <__b_func_veneer>:
   40018:   b0040010adrpx16, 8041000 <__bss_end__+0x7c30e88>
   4001c:   9100c210add x16, x16, #0x30
   40020:   d61f0200br  x16
...

Disassembly of section .b.text:

08041000 :
 8041000:   d503201fnop

08041004 :
 8041004:   d503245fbti c
 8041008:   d65f03c0ret

0804100c <_start>:
 804100c:   1403b   8041018 <__a_func_veneer>
 8041010:   140ab   8041038 <__b_func_bti_veneer+0x8>
 8041014:   d503201fnop

08041018 <__a_func_veneer>:
 8041018:   f0fbfff0adrpx16, 4 
 804101c:   91004210add x16, x16, #0x10
 8041020:   d61f0200br  x16
...

08041030 <__b_func_bti_veneer>:
 8041030:   d503245fbti c
 8041034:   17f4b   8041004 

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


[Bug ld/30930] Broken BTI veneers: ld-2.41 links mame in a way which gets stuck on aarch64

2023-10-10 Thread nsz at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=30930

--- Comment #25 from Szabolcs Nagy  ---
for the record i built a mame binary where

$ readelf -aW mame |grep
_ZN3emu6detail16device_registrar15register_deviceERNS0_21device_type_impl_baseE
885688: 084323c812 FUNCLOCAL  DEFAULT   14
___ZN3emu6detail16device_registrar15register_deviceERNS0_21device_type_impl_baseE_bti_veneer
1532712: 0964dc40   120 FUNCGLOBAL DEFAULT   14
_ZN3emu6detail16device_registrar15register_deviceERNS0_21device_type_impl_baseE
$ objdump -d mame |grep -A5
'_ZN3emu6detail16device_registrar15register_deviceERNS0_21device_type_impl_baseE_bti_veneer>:'
084323c8
<___ZN3emu6detail16device_registrar15register_deviceERNS0_21device_type_impl_baseE_bti_veneer>:
 84323c8:   9010adrpx16, 8432000
<___ZN24device_execute_interface7suspendEjb_bti_veneer+0x10>
 84323cc:   910f2210add x16, x16, #0x3c8
 84323d0:   d61f0200br  x16
...
$ objdump -d mame |grep -A4
'_ZN3emu6detail16device_registrar15register_deviceERNS0_21device_type_impl_baseE>:'
0c35b570
<_ZN3emu6detail16device_registrar15register_deviceERNS0_21device_type_impl_baseE>:
 c35b570:   d503245fbti c
 c35b574:   b0045701adrpx1, 14e3c000
<_ZN34option_guide_impl_dsk_option_guideL6actualE+0x10>
 c35b578:   d503233fpaciasp
 c35b57c:   a9bf7bfdstp 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.:

005775b8 <___ZNSirsERi@@GLIBCXX_3.4_bti_veneer>:
  5775b8:   d503245fbti c
  5775bc:   17ffedbdb   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.


[Bug ld/30930] Broken BTI veneers: ld-2.41 links mame in a way which gets stuck on aarch64

2023-10-10 Thread nsz at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=30930

--- Comment #26 from Szabolcs Nagy  ---
(In reply to Szabolcs Nagy from comment #25)
> - *_bti_veneer is global symbol (not local)

sorry this is wrong, the sym binding is local as expected.

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