[Bug gas/28149] debug info with wrong file association

2021-09-16 Thread amodra at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=28149

Alan Modra  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Assignee|unassigned at sourceware dot org   |amodra at gmail dot com

--- Comment #4 from Alan Modra  ---
I can reproduce the comment #3 behaviour only when using -Wa,-gdwarf or similar
gas options when using gcc-10.  gcc-11 and gcc-12 pass -gdwarf-5 to gas.  That
seems to be the source of these problems, which is that -gdwarf* passed to gas
means not only to select the DWARF level but also have gas generate its own
DWARF line info.

So why is gcc passing -gdwarf-5 to gas?  That seems quite silly!  Can't gas
figure the dwarf level out itself?  Note that current gas decides on dwarf5 if
seeing a .file or .loc specifying file 0.

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


[Bug binutils/28346] New: Segfault attempting to disassemble raw binary

2021-09-16 Thread luke_sourcewarebugs at dashjr dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=28346

Bug ID: 28346
   Summary: Segfault attempting to disassemble raw binary
   Product: binutils
   Version: 2.37
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: binutils
  Assignee: unassigned at sourceware dot org
  Reporter: luke_sourcewarebugs at dashjr dot org
  Target Milestone: ---
  Host: powerpc64le-unknown-linux-gnu
Target: xtensa-esp32-elf
 Build: powerpc64le-unknown-linux-gnu

$ xtensa-esp32-elf-objdump -D -b binary -mxtensa
wifi_20191021014722_FW_7595_BPu_SU0_S411N_SC4002_6L5T.bin 

wifi_20191021014722_FW_7595_BPu_SU0_S411N_SC4002_6L5T.bin: file format
binary


Disassembly of section .data:

 <.data>:
Segmentation fault

(gdb) bt full
#0  0x766edb14 in xtensa_property_section_name
(sec=sec@entry=0x1000b4ad8, base_name=base_name@entry=0x7755de68
".xt.prop", separate_sections=1) at
/var/tmp/portage/cross-xtensa-esp32-elf/binutils-2.34-r2/work/binutils-2.34/bfd/elf32-xtensa.c:11160
suffix = 
group_name = 
prop_sec_name = 
__PRETTY_FUNCTION__ = "xtensa_property_section_name"
#1  0x766edfb4 in xtensa_get_separate_property_section
(sec=sec@entry=0x1000b4ad8, base_name=base_name@entry=0x7755de68
".xt.prop", separate_section=separate_section@entry=1) at
/var/tmp/portage/cross-xtensa-esp32-elf/binutils-2.34-r2/work/binutils-2.34/bfd/elf32-xtensa.c:11210
prop_sec_name = 
prop_sec = 
#2  0x766ee03c in xtensa_get_property_section
(sec=sec@entry=0x1000b4ad8, base_name=0x7755de68 ".xt.prop") at
/var/tmp/portage/cross-xtensa-esp32-elf/binutils-2.34-r2/work/binutils-2.34/bfd/elf32-xtensa.c:11225
prop_sec = 
#3  0x766fcb10 in xtensa_read_table_entries (abfd=0x1000b1690,
section=0x1000b4ad8, table_p=0x77f73b18 , sec_name=, output_addr=) at
/var/tmp/portage/cross-xtensa-esp32-elf/binutils-2.34-r2/work/binutils-2.34/bfd/elf32-xtensa.c:836
table_section = 
table_size = 0
table_data = 
blocks = 
blk = 
block_count = 
num_records = 4295693968
internal_relocs = 
irel = 
rel_end = 
section_addr = 
off = 
predef_flags = 
table_entry_size = 
section_limit = 
#4  0x77363eb4 in print_insn_xtensa (memaddr=0, info=0x7fffdc40) at
/var/tmp/portage/cross-xtensa-esp32-elf/binutils-2.34-r2/work/binutils-2.34/opcodes/xtensa-dis.c:316
abfd = 0x1000b1690
section = 0x1000b4ad8
operand_val = 0
bytes_fetched = 
size = 
maxsize = 
i = 
n = 
noperands = 
nslots = 
isa = 
opc = 
fmt = 
priv = {byte_buf = 0x1000b36b0 "p\rH\366\377\177", bailout = {{__jmpbuf
= {0 }, __mask_was_saved = 0, __saved_mask = {__val = {0
, last_section = 0x1000b4ad8, insn_table_entries = 0x0,
insn_table_entry_count = 0, insn_table_cur_addr = 0, insn_table_cur_idx = 0}
byte_buf = 0x1000b36b0 "p\rH\366\377\177"
insn_buffer = 0x1000b3670
slot_buffer = 0x1000b3690
first = 
first_slot = 
valid_insn = 
insn_block = 
#5  0x00010001296c in disassemble_bytes (inf=inf@entry=0x7fffdc40,
disassemble_fn=0x77363d60 , insns=insns@entry=1,
data=0x75870010 "Sign\253\035M\036", start_offset=,
start_offset@entry=0, stop_offset=, stop_offset@entry=1150976,
rel_offset=rel_offset@entry=0, relppp=relppp@entry=0x7fffd998,
relppend=relppend@entry=0x0) at
/var/tmp/portage/cross-xtensa-esp32-elf/binutils-2.34-r2/work/binutils-2.34/binutils/objdump.c:2740
buf = "   0\000J\v\000\001\000\000\000\370\027H\366\377\177",
'\000' , "\"\361p|\334\216\272\220", 
bpc = 0
pb = 0
z = 
need_nl = 0
aux = 0x7fffdc08
section = 0x1000b4ad8
octets_per_line = 4
skip_addr_chars = 0
addr_offset = 0
opb = 1
skip_zeroes = 8
skip_zeroes_at_end = 3
octets = 0
sfile = {buffer = 0x1000b3010 "P\022H\366\377\177", pos = 0, alloc =
120}
color_buffer = 
line_buffer = 
max_level = 
#6  0x000100013d40 in disassemble_section (abfd=0x1000b1690,
section=0x1000b4ad8, inf=0x7fffdc40) at
/var/tmp/portage/cross-xtensa-esp32-elf/binutils-2.34-r2/work/binutils-2.34/binutils/objdump.c:3307
addr = 
nextsym = 0x0
nextstop_offset = 1150976
insns = 1
bed = 
sign_adjust = 0
pinfo = 0x7fffdc40
paux = 0x7fffdc08
opb = 
data = 0x75870010 "Sign\253\035M\036"
datasize = 
rel_pp = 0x0
rel_ppstart = 0x0
rel_ppend = 0x0
stop_offset = 1150976
sym = 0x0
place = 0
rel_count = 
rel_offset = 0
addr_offse