[Bug binutils/26218] Invalid coff/pe arm machine type creating EFI binary

2021-10-29 Thread tnfchris at sourceware dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=26218

Tamar Christina  changed:

   What|Removed |Added

   Assignee|unassigned at sourceware dot org   |tnfchris at sourceware 
dot org
 Status|WAITING |ASSIGNED
Version|2.32|2.38 (HEAD)

-- 
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-10-29 Thread tnfchris at sourceware dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=26206

--- Comment #23 from Tamar Christina  ---
(In reply to pjo...@redhat.com from comment #22)
> Created attachment 13739 [details]
> add aarch64_pei_vec to aarch64-*-linux* as well
> 
> I had to add the attached patch as well to get the targets we build for to
> include it.  With this, some basic support does appear to be functional,
> though I'm nowhere near done trying it.

No worries, thanks for checking so far!

> 
> When we do that, we get these targets in "objdump --help":
> aarch64-linux-gnu-objdump: supported targets: elf64-littleaarch64
> elf64-bigaarch64 elf32-littleaarch64 elf32-bigaarch64 elf32-littlearm
> elf32-bigarm pei-aarch64-little elf64-little elf64-big elf32-little
> elf32-big pe-x86-64 pei-x86-64 pe-bigobj-x86-64 elf64-x86-64 elf64-l1om
> elf64-k1om pe-i386 pei-i386 elf32-i386 elf32-iamcu srec symbolsrec verilog
> tekhex binary ihex plugin
> 
> It's not surprising to see the x86 targets there (we have
> --enable-targets=x86_64-pep after all), but I don't see the pe*-aarch64* or
> efi-* targets here at all, nor do I see them in objcopy.

It's in the list you pasted, `elf32-bigarm pei-aarch64-little elf64-little`
the sorting is just a bit weird.

> That's a big step forward, and I'd support upstreaming the patch as is (plus
> my minor tweak) just for that.  Next I'll try building stuff more like we do
> on x86_64, but that probably won't happen until next week due to other
> commitments.

Cheers, I will upstream it and keep the bug open till everything is confirmed
workig.

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


[Bug binutils/28516] New: Error message produced by Objdump changed per run

2021-10-29 Thread shaohua.li at inf dot ethz.ch
https://sourceware.org/bugzilla/show_bug.cgi?id=28516

Bug ID: 28516
   Summary: Error message produced by Objdump changed per run
   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 13743
  --> https://sourceware.org/bugzilla/attachment.cgi?id=13743&action=edit
diff.o

Hi,

For some inputs, `objdump` would threw out inconsistent error info per run. 

- Compiler: clang13 / gcc11

- Reproduce: run `objdump -S diff.o` and check the value of ` DWARF error:
offset ()`, which would change per run.

I did some analysis and found that the function read_indexed_string:dwarf.c
changed the value of attr->u.val passed from dwarf.c:1291 unexpectly.

A related issue report is https://sourceware.org/bugzilla/show_bug.cgi?id=27874

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


[Bug binutils/28516] Error message produced by Objdump changed per run

2021-10-29 Thread amodra at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=28516

Alan Modra  changed:

   What|Removed |Added

 Resolution|--- |INVALID
 Status|UNCONFIRMED |RESOLVED

--- Comment #1 from Alan Modra  ---
Yes, you get unexpected results with fuzzed object files.  Here you have a
DW_AT_stmt_list with the wrong DW_FORM, an indexed string form rather than one
of the integer forms.  The indexed string forms currently aren't supported and
return a string from objdump itself (or libbfd.so if using shared libs).  The
address of that string varies with PIEs that are loaded at random base
addresses, or between different versions of objdump.

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


[Bug ld/27923] ld: Support DT_RELR relative relocation format

2021-10-29 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=27923

H.J. Lu  changed:

   What|Removed |Added

   Last reconfirmed||2021-10-29
 Status|UNCONFIRMED |WAITING
 Ever confirmed|0   |1

--- Comment #4 from H.J. Lu  ---
We need an updated proposal without mysterious crashes.  One option
is that the linker should bump EI_ABIVERSION when generating DT_RELR.

-- 
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-10-29 Thread pjones at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=26206

--- Comment #24 from pjones at redhat dot com  ---
(In reply to Tamar Christina from comment #23)
> (In reply to pjo...@redhat.com from comment #22)

> > When we do that, we get these targets in "objdump --help":
> > aarch64-linux-gnu-objdump: supported targets: elf64-littleaarch64
> > elf64-bigaarch64 elf32-littleaarch64 elf32-bigaarch64 elf32-littlearm
> > elf32-bigarm pei-aarch64-little elf64-little elf64-big elf32-little
> > elf32-big pe-x86-64 pei-x86-64 pe-bigobj-x86-64 elf64-x86-64 elf64-l1om
> > elf64-k1om pe-i386 pei-i386 elf32-i386 elf32-iamcu srec symbolsrec verilog
> > tekhex binary ihex plugin
> > 
> > It's not surprising to see the x86 targets there (we have
> > --enable-targets=x86_64-pep after all), but I don't see the pe*-aarch64* or
> > efi-* targets here at all, nor do I see them in objcopy.
> 
> It's in the list you pasted, `elf32-bigarm pei-aarch64-little elf64-little`
> the sorting is just a bit weird.

Indeed, I guess I got a little blinded by all the chaff while I was looking for
efi-*.

-- 
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-10-29 Thread tnfchris at sourceware dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=26206

--- Comment #25 from Tamar Christina  ---
> > It's in the list you pasted, `elf32-bigarm pei-aarch64-little elf64-little`
> > the sorting is just a bit weird.
> 
> Indeed, I guess I got a little blinded by all the chaff while I was looking
> for efi-*.

The `efi-*` don't exist as targets in binutils, they're an internal mapping for
`objcopy`. So in objcopy you have code that interprets `efi-app-*` etc and maps
them to the correct target and subsystem.

That's why they don't show up in the help.

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


[Bug binutils/28517] New: objdump SEGV

2021-10-29 Thread shaohua.li at inf dot ethz.ch
https://sourceware.org/bugzilla/show_bug.cgi?id=28517

Bug ID: 28517
   Summary: objdump SEGV
   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 13744
  --> https://sourceware.org/bugzilla/attachment.cgi?id=13744&action=edit
poc_segv

Hi there,

I found a SEGV on `objdump -S` with a fuzzer.

- Compiler: 

- Platform: Ubuntu 20.04.3 LTS, x86_64

- Reproduce: run `objdump -S poc_segv`

AddressSanitize report:

==242==ERROR: AddressSanitizer: SEGV on unknown address 0x60e000e60131 (pc
0x00ea089a bp 0x043d1158 sp 0x7ffd7d0eb440 T0)
==242==The signal is caused by a READ memory access.
#0 0xea089a in bfd_getl16 /objdump/repo/clang13-O3/bfd/libbfd.c:633:11
#1 0x185d802 in _bfd_mips_elf_reloc_unshuffle
/objdump/repo/clang13-O3/bfd/elfxx-mips.c:2359:11
#2 0x1663743 in _bfd_mips_elf32_gprel16_reloc
/objdump/repo/clang13-O3/bfd/elf32-mips.c:1795:3
#3 0x30a4210 in bfd_perform_relocation
/objdump/repo/clang13-O3/bfd/reloc.c:711:14
#4 0x191eee7 in _bfd_elf_mips_get_relocated_section_contents
/objdump/repo/clang13-O3/bfd/elfxx-mips.c:13362:10
#5 0xeb5c91 in bfd_simple_get_relocated_section_contents
/objdump/repo/clang13-O3/bfd/simple.c:298:14
#6 0x120d6a5 in read_section /objdump/repo/clang13-O3/bfd/./dwarf2.c:582:7
#7 0x1205f63 in _bfd_dwarf2_slurp_debug_info
/objdump/repo/clang13-O3/bfd/./dwarf2.c:4737:13
#8 0x121291d in _bfd_dwarf2_find_nearest_line
/objdump/repo/clang13-O3/bfd/./dwarf2.c:4985:9
#9 0x104536c in _bfd_elf_find_nearest_line
/objdump/repo/clang13-O3/bfd/elf.c:9192:7
#10 0x4f616b in show_line
/objdump/repo/clang13-O3/binutils/./objdump.c:1784:9
#11 0x4f616b in disassemble_bytes
/objdump/repo/clang13-O3/binutils/./objdump.c:2770:6
#12 0x4ec60a in disassemble_section
/objdump/repo/clang13-O3/binutils/./objdump.c:3455:4
#13 0xeb382b in bfd_map_over_sections
/objdump/repo/clang13-O3/bfd/section.c:1383:5
#14 0x4d5c97 in disassemble_data
/objdump/repo/clang13-O3/binutils/./objdump.c:3599:3
#15 0x4d5c97 in dump_bfd
/objdump/repo/clang13-O3/binutils/./objdump.c:5010:5
#16 0x4d09c2 in display_object_bfd
/objdump/repo/clang13-O3/binutils/./objdump.c
#17 0x4d09c2 in display_any_bfd
/objdump/repo/clang13-O3/binutils/./objdump.c:5162:5
#18 0x4cede5 in display_file
/objdump/repo/clang13-O3/binutils/./objdump.c:5183:3
#19 0x4cede5 in main /objdump/repo/clang13-O3/binutils/./objdump.c:5533:6
#20 0x7f91b92ea0b2 in __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x270b2)
#21 0x41d5ad in _start (/objdump/repo/clang13-O3/binutils/objdump+0x41d5ad)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV /objdump/repo/clang13-O3/bfd/libbfd.c:633:11 in
bfd_getl16
==242==ABORTING

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


[Bug binutils/28518] New: objdump : signed integer overflow & free on unmalloced address

2021-10-29 Thread shaohua.li at inf dot ethz.ch
https://sourceware.org/bugzilla/show_bug.cgi?id=28518

Bug ID: 28518
   Summary: objdump : signed integer overflow & free on unmalloced
address
   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 13745
  --> https://sourceware.org/bugzilla/attachment.cgi?id=13745&action=edit
poc_signed

Hi there,

For the poc file I provided, it triggered both a signed integer overflow and
free on unmalloced address.

- Compiler: clang13 (compile with -fsanitize=address,undefined)

- Platform: Ubuntu 20.04.3 LTS, x86_64

- Reproduce: run `objdump -S -D poc_signed`

Sanitize report:

vms-alpha.c:4832:29: runtime error: signed integer overflow: 1724079360 +
778462822 cannot be represented in type 'int'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior vms-alpha.c:4832:29 in
=
==251==ERROR: AddressSanitizer: attempting free on address which was not
malloc()-ed: 0x617006a4 in thread T0
#0 0x499af2 in free (/objdump/repo/clang13-O3/binutils/objdump+0x499af2)
#1 0x1cac27c in build_module_list
/objdump/repo/clang13-O3/bfd/vms-alpha.c:4841:7
#2 0x1cac27c in _bfd_vms_find_nearest_line
/objdump/repo/clang13-O3/bfd/vms-alpha.c:4962:24
#3 0x4f616b in show_line
/objdump/repo/clang13-O3/binutils/./objdump.c:1784:9
#4 0x4f616b in disassemble_bytes
/objdump/repo/clang13-O3/binutils/./objdump.c:2770:6
#5 0x4ec60a in disassemble_section
/objdump/repo/clang13-O3/binutils/./objdump.c:3455:4
#6 0xeb382b in bfd_map_over_sections
/objdump/repo/clang13-O3/bfd/section.c:1383:5
#7 0x4d5c97 in disassemble_data
/objdump/repo/clang13-O3/binutils/./objdump.c:3599:3
#8 0x4d5c97 in dump_bfd
/objdump/repo/clang13-O3/binutils/./objdump.c:5010:5
#9 0x4d09c2 in display_object_bfd
/objdump/repo/clang13-O3/binutils/./objdump.c
#10 0x4d09c2 in display_any_bfd
/objdump/repo/clang13-O3/binutils/./objdump.c:5162:5
#11 0x4cede5 in display_file
/objdump/repo/clang13-O3/binutils/./objdump.c:5183:3
#12 0x4cede5 in main /objdump/repo/clang13-O3/binutils/./objdump.c:5533:6
#13 0x7fbf3f1e60b2 in __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x270b2)
#14 0x41d5ad in _start (/objdump/repo/clang13-O3/binutils/objdump+0x41d5ad)

0x617006a4 is located 676 bytes inside of 680-byte region
[0x61700400,0x617006a8)
allocated by thread T0 here:
#0 0x499d5d in __interceptor_malloc
(/objdump/repo/clang13-O3/binutils/objdump+0x499d5d)
#1 0xea0233 in bfd_malloc /objdump/repo/clang13-O3/bfd/libbfd.c:289:9

SUMMARY: AddressSanitizer: bad-free
(/objdump/repo/clang13-O3/binutils/objdump+0x499af2) in free
==251==ABORTING

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


[Bug ld/27923] ld: Support DT_RELR relative relocation format

2021-10-29 Thread sam at gentoo dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=27923

Sam James  changed:

   What|Removed |Added

 CC||sam at gentoo dot org

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


[Bug gas/28266] CWD present in object file even after use of -fdebug-prefix-map=$PWD=foo

2021-10-29 Thread sam at gentoo dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=28266

Sam James  changed:

   What|Removed |Added

 CC||sam at gentoo dot org

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


Issue 40345 in oss-fuzz: binutils:fuzz_objdump: Heap-buffer-overflow in bfd_getl16

2021-10-29 Thread sheriffbot via monorail
Updates:
Labels: -restrict-view-commit

Comment #3 on issue 40345 by sheriffbot: binutils:fuzz_objdump: 
Heap-buffer-overflow in bfd_getl16
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=40345#c3

This bug has been fixed. It has been opened to the public.

- Your friendly Sheriffbot

-- 
You received this message because:
  1. You were specifically CC'd on the issue

You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settings

Reply to this email to add a comment.

Issue 40321 in oss-fuzz: binutils:fuzz_disas_ext-bfd_arch_arm: Undefined-shift in print_insn_thumb16

2021-10-29 Thread sheriffbot via monorail
Updates:
Labels: -restrict-view-commit

Comment #3 on issue 40321 by sheriffbot: binutils:fuzz_disas_ext-bfd_arch_arm: 
Undefined-shift in print_insn_thumb16
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=40321#c3

This bug has been fixed. It has been opened to the public.

- Your friendly Sheriffbot

-- 
You received this message because:
  1. You were specifically CC'd on the issue

You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settings

Reply to this email to add a comment.

Issue 40350 in oss-fuzz: binutils:fuzz_nm: Null-dereference READ in bfd_getb32

2021-10-29 Thread sheriffbot via monorail
Updates:
Labels: -restrict-view-commit

Comment #3 on issue 40350 by sheriffbot: binutils:fuzz_nm: Null-dereference 
READ in bfd_getb32
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=40350#c3

This bug has been fixed. It has been opened to the public.

- Your friendly Sheriffbot

-- 
You received this message because:
  1. You were specifically CC'd on the issue

You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settings

Reply to this email to add a comment.