[Bug binutils/30793] kvx_reassemble_bundle index 8 out of bounds

2023-09-07 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=30793

--- Comment #2 from cvs-commit at gcc dot gnu.org  ---
The master branch has been updated by Alan Modra :

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=dd39dcae8880f0ed298daa1e35d21a84f0a7bdec

commit dd39dcae8880f0ed298daa1e35d21a84f0a7bdec
Author: Alan Modra 
Date:   Thu Sep 7 20:08:57 2023 +0930

PR30793, kvx_reassemble_bundle index 8 out of bounds

While the patch already committed for pr30793 prevents the asan error,
there is a problem: Now the last element of bundle_words never gets
written.  That's very likely wrong, or KVXMAXBUNDLEWORDS is too big.
So this patch rearranges things a little to support writing of all of
bundle_words and does the parallel bit checking only when filling
bundle_words.  In the normal case, kvx_reassemble_bundle will see
bundle_words[word_count-1] with the parallel bit clear and all other
words having it set.  In the error case where all words in
bundle_words have the parallel bit set, kvx_reassemble_bundle will be
passed a wordcount of KVXMAXBUNDLEWORDS + 1.  I've also made
kvx_reassemble_bundle return true for success rather than zero, and
removed the unnecessary check for zero wordcount.

PR 30793
* kvx-dis.c (kvx_reassemble_bundle): Return bool, true on success.
Fail if wordcount is too large.  Don't check for wordcount zero.
Don't check kvx_has_parallel_bit.
(print_insn_kvx): Rewrite code reading bundle_words as a for loop.
Don't stop reading at KVXMAXBUNDLEWORDS - 1.
(decode_prologue_epilogue_bundle): Similarly.

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


[Bug gprofng/30834] improve disassembly output for call and branch instructions

2023-09-07 Thread vladimir.mezentsev at oracle dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=30834

Vladimir Mezentsev  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED

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


[Bug gprofng/30834] New: improve disassembly output for call and branch instructions

2023-09-07 Thread vladimir.mezentsev at oracle dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=30834

Bug ID: 30834
   Summary: improve disassembly output for call and branch
instructions
   Product: binutils
   Version: 2.42 (HEAD)
Status: NEW
  Severity: normal
  Priority: P2
 Component: gprofng
  Assignee: vladimir.mezentsev at oracle dot com
  Reporter: vladimir.mezentsev at oracle dot com
  Target Milestone: ---

gprofng only displays the hexadecimal address in call and jump instructions:
% gprofng  display src -dis main ./a.out | egrep 'call|jmp'
[23]   401eca:  call   0x1f68
[24]   401ee6:  call   0xfafa
[26]   401ef9:  jmp0x13f
[28]   401f0d:  call   0x3a2f
[29]   401f27:  call   0xfab9

Need to display the function name in the calling instruction, and the absolute
and relative address in the branch instruction.

For example, the output of gdb and er_src is:
% gdb -batch -ex 'file a.out' -ex 'disassemble main' 2>&1 | egrep 'call|jmp'
   0x00401eca <+8>: call   0x403e32 
   0x00401ee6 <+36>:call   0x4019e0 
   0x00401ef9 <+55>:jmp0x402038 
   0x00401f0d <+75>:call   0x40593c 
   0x00401f27 <+101>:   call   0x4019e0 


% er_src -dis main a.out | egrep 'call|jmp'
[23]   401eca:  callbfd_init [ 0x403e32, .+0x1f68 ]
[24]   401ee6:  call.-0x506 [ 0x4019e0 ]
[26]   401ef9:  jmp .+0x13f [ 0x402038 ]
[28]   401f0d:  callbfd_openr [ 0x40593c, .+0x3a2f ]
[29]   401f27:  call.-0x547 [ 0x4019e0 ]

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


[Bug gprofng/30808] gprofng tests failed

2023-09-07 Thread vladimir.mezentsev at oracle dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=30808

Vladimir Mezentsev  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|ASSIGNED|RESOLVED

--- Comment #2 from Vladimir Mezentsev  
---
Update status as resolved/fixed.

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


[Bug binutils/30830] New: stripping PE binary fails to delete security directory entry

2023-09-07 Thread medhefgo at web dot de
https://sourceware.org/bugzilla/show_bug.cgi?id=30830

Bug ID: 30830
   Summary: stripping PE binary fails to delete security directory
entry
   Product: binutils
   Version: 2.41
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: binutils
  Assignee: unassigned at sourceware dot org
  Reporter: medhefgo at web dot de
  Target Milestone: ---

Given a signed PE/EFI binary, running `strip` on it will remove the signatures
contained in it, but leave the security data directory entry inside the PE
optional header as-is. This renders the  binary unbootable as it gets rejected
by firmware/EDK2.

Using signed grub2 from debian as example:
$ qemu-system-x86_64 -bios /usr/share/edk2/x64/OVMF.fd -kernel
grubx64.efi.signed
(This boots to grub cmdline.)
$ strip grubx64.efi.signed
$ sbverify --list grubx64.efi.signed 
warning: checksum areas are greater than image size. Invalid section table?
No signature table present
$ qemu-system-x86_64 -bios /usr/share/edk2/x64/OVMF.fd -kernel
grubx64.efi.signed
(Fails to boot grub.)

Manually changing the security directory pointer and size to 0 will allow
booting again and also make sbverify happy again.

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