[Bug binutils/28662] New: use-of-uninitialized-value in dwarf2.c:read_ranges

2021-12-06 Thread shaohua.li at inf dot ethz.ch
https://sourceware.org/bugzilla/show_bug.cgi?id=28662

Bug ID: 28662
   Summary: use-of-uninitialized-value in dwarf2.c:read_ranges
   Product: binutils
   Version: 2.38 (HEAD)
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: binutils
  Assignee: unassigned at sourceware dot org
  Reporter: shaohua.li at inf dot ethz.ch
  Target Milestone: ---

Created attachment 13827
  --> https://sourceware.org/bugzilla/attachment.cgi?id=13827&action=edit
uninitialize_poc

Hi there,

I found an use-of-uninitialized-value in dwarf2.c:read_ranges when I was
fuzzing `objdump -S`. A direct consequence of this issue is : If you compile
binutils with `clang -O0` and `clang -O2`, the `objdump -S` would emit
different output on the given input file.

- Compiler: clang-13

- Platform: Ubuntu 20.04.4 LTS, x86_64

- Reproduce: compile with MemorySanitizer, then run `objdump -S
uninitialize_poc`.

MemorySanitizer report:
==1956831==WARNING: MemorySanitizer: use-of-uninitialized-value
#0 0x165dba3 in read_ranges
/objdump/analysis/debug/mem/binutils-gdb/bfd/./dwarf2.c:3096:7
#1 0x165cc33 in read_rangelist
/objdump/analysis/debug/mem/binutils-gdb/bfd/./dwarf2.c:3213:12
#2 0x166c1ae in parse_comp_unit
/objdump/analysis/debug/mem/binutils-gdb/bfd/./dwarf2.c:3802:9
#3 0x1635c0a in stash_comp_unit
/objdump/analysis/debug/mem/binutils-gdb/bfd/./dwarf2.c:4832:32
#4 0x1631b5b in _bfd_dwarf2_find_nearest_line
/objdump/analysis/debug/mem/binutils-gdb/bfd/./dwarf2.c:5139:18
#5 0x1453ab5 in _bfd_elf_find_nearest_line
/objdump/analysis/debug/mem/binutils-gdb/bfd/elf.c:9205:7
#6 0x4e1bc3 in show_line
/objdump/analysis/debug/mem/binutils-gdb/binutils/./objdump.c:1922:9
#7 0x4d8703 in disassemble_bytes
/objdump/analysis/debug/mem/binutils-gdb/binutils/./objdump.c:2908:6
#8 0x4ca056 in disassemble_section
/objdump/analysis/debug/mem/binutils-gdb/binutils/./objdump.c:3593:4
#9 0x12c7b7b in bfd_map_over_sections
/objdump/analysis/debug/mem/binutils-gdb/bfd/section.c:1383:5
#10 0x4b4587 in disassemble_data
/objdump/analysis/debug/mem/binutils-gdb/binutils/./objdump.c:3737:3
#11 0x4ab3aa in dump_bfd
/objdump/analysis/debug/mem/binutils-gdb/binutils/./objdump.c:5147:5
#12 0x4a8b1d in display_object_bfd
/objdump/analysis/debug/mem/binutils-gdb/binutils/./objdump.c:5209:7
#13 0x4a8a21 in display_any_bfd
/objdump/analysis/debug/mem/binutils-gdb/binutils/./objdump.c:5299:5
#14 0x4a5dad in display_file
/objdump/analysis/debug/mem/binutils-gdb/binutils/./objdump.c:5320:3
#15 0x4a1b1d in main
/objdump/analysis/debug/mem/binutils-gdb/binutils/./objdump.c:5688:6
#16 0x7fe3f51ae0b2 in __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x270b2)
#17 0x41d57d in _start
(/shared/targets/objdump/analysis/debug/mem/binutils-gdb/binutils/objdump+0x41d57d)

SUMMARY: MemorySanitizer: use-of-uninitialized-value
/objdump/analysis/debug/mem/binutils-gdb/bfd/./dwarf2.c:3096:7 in read_ranges
Exiting

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


[Bug binutils/27931] objcopy --localize-hidden/--keep-global-symbol: drop GRP_COMDAT if the signature symbol becomes local?

2021-12-06 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=27931

H.J. Lu  changed:

   What|Removed |Added

   Last reconfirmed||2021-12-06
 Ever confirmed|0   |1
 CC||hjl.tools at gmail dot com
 Status|UNCONFIRMED |NEW

--- Comment #3 from H.J. Lu  ---
A patch is posted at

https://sourceware.org/pipermail/binutils/2021-December/118824.html

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


[Bug binutils/26206] Add pei-aarch64 support for native EFI support

2021-12-06 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=26206

--- Comment #27 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=d91c67e8730354c43fae86fa98fe593925882365

commit d91c67e8730354c43fae86fa98fe593925882365
Author: Alan Modra 
Date:   Tue Dec 7 12:36:31 2021 +1030

Re: Add support for AArch64 EFI (efi-*-aarch64)

Commit b69c9d41e8 was broken in multiple ways regarding the realloc
of the target string, most notably in that "-little" wasn't actually
appended to the input_target or output_target.  This caused asan
errors and "FAIL: Check if efi app format is recognized".  I also
noticed that the input_target string wasn't being copied but rather
the output_target when dealing with the input target.  Fix that too.

PR 26206
* objcopy.c (convert_efi_target): Rewrite.  Allocate modified
target strings here..
(copy_main): ..rather than here.  Do handle input_target,
not output_target for input.

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