[Bug gas/29557] New: R_RISCV_ALIGN relocation emits wrong padding bytes

2022-09-08 Thread numbksco at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=29557

Bug ID: 29557
   Summary: R_RISCV_ALIGN relocation emits wrong padding bytes
   Product: binutils
   Version: unspecified
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: gas
  Assignee: unassigned at sourceware dot org
  Reporter: numbksco at gmail dot com
  Target Milestone: ---

Current result:

# cat <:
   0:   0001nop
0: R_RISCV_ALIGN*ABS*+0x2
   2:   unimp

Disassembly of section .text.hello:

 :
   0:   02a00513li  a0,42
   4:   8082ret


According to the spec:
https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/master/riscv-elf.adoc#relocation-for-alignment

The R_RISCV_ALIGN relocation padding bytes should be `c.nop + c.nop + c.nop` or
`c.nop + nop`, but currently we're getting `c.nop + 0x`.

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


[Bug gas/29523] i686-w64-mingw32-objdump -WL returns incorrect file paths

2022-09-08 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=29523

--- Comment #11 from cvs-commit at gcc dot gnu.org  ---
The master branch has been updated by Nick Clifton :

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

commit 2caffd34df293680755ebad35c618ee68686fcf1
Author: Nick Clifton 
Date:   Thu Sep 8 09:56:39 2022 +0100

i686-w64-mingw32-objdump -WL returns incorrect file paths

PR 29523
* dwarf.c (display_debug_lines_decoded): Correctly handle DWARF-5
directory and filename tables.

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


[Bug gas/29523] i686-w64-mingw32-objdump -WL returns incorrect file paths

2022-09-08 Thread nickc at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=29523

Nick Clifton  changed:

   What|Removed |Added

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

--- Comment #12 from Nick Clifton  ---
Patch applied.

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


[Bug gas/29559] New: gas generated incorrect debug info (top-level DW_TAG_unspecified_type DIE)

2022-09-08 Thread vries at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=29559

Bug ID: 29559
   Summary: gas generated incorrect debug info (top-level
DW_TAG_unspecified_type DIE)
   Product: binutils
   Version: unspecified
Status: NEW
  Severity: normal
  Priority: P2
 Component: gas
  Assignee: unassigned at sourceware dot org
  Reporter: vries at gcc dot gnu.org
  Target Milestone: ---

See the test-case in gdb PR29558.

Current trunk gas generates a top-level DIE with DW_TAG_unspecified_type:
...
  Compilation Unit @ offset 0xf4:
   Length:0x35 (32-bit)
   Version:   5
   Unit Type: DW_UT_compile (1)
   Abbrev Offset: 0xa3
   Pointer Size:  8
 <0><100>: Abbrev Number: 3 (DW_TAG_unspecified_type)
 <0><101>: Abbrev Number: 1 (DW_TAG_compile_unit)
<102>   DW_AT_stmt_list   : 0x123
<106>   DW_AT_low_pc  : 0x4004ac
<10e>   DW_AT_high_pc : 11
<10f>   DW_AT_name: test2.s
<113>   DW_AT_comp_dir: /home/vries/gdb_versions/devel
<117>   DW_AT_producer: GNU AS 2.39.50
<11b>   DW_AT_language: 32769   (MIPS assembler)
 <1><11d>: Abbrev Number: 2 (DW_TAG_subprogram)
<11e>   DW_AT_name: (indirect string, offset: 0x241): foo
<122>   DW_AT_external: 1
<122>   DW_AT_type: <0x100>
<123>   DW_AT_low_pc  : 0x4004ac
<12b>   DW_AT_high_pc : 11
...

This is incorrect dwarf, according to the standard (see PR29558 comment 3).

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


[Bug gas/29559] gas generated incorrect debug info (top-level DW_TAG_unspecified_type DIE)

2022-09-08 Thread vries at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=29559

Tom de Vries  changed:

   What|Removed |Added

 CC||nickc at redhat dot com

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


[Bug gas/29559] gas generated incorrect debug info (top-level DW_TAG_unspecified_type DIE)

2022-09-08 Thread nickc at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=29559

Nick Clifton  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Assignee|unassigned at sourceware dot org   |nickc at redhat dot com

--- Comment #1 from Nick Clifton  ---
Hi Tom,

  [For the record the patch that introduced this bug was intended to fix PR
29517].

>  <0><100>: Abbrev Number: 3 (DW_TAG_unspecified_type)
>  <0><101>: Abbrev Number: 1 (DW_TAG_compile_unit)

OK, so you are saying that the DW_TAG_unspecified_type is in the wrong place ?

Presumably it should be after DW_TAG_subprogram.  IE, something like this:

 <0><101>: Abbrev Number: 1 (DW_TAG_compile_unit)
<102>   DW_AT_stmt_list   : 0x123
<106>   DW_AT_low_pc  : 0x4004ac
<10e>   DW_AT_high_pc : 11
<10f>   DW_AT_name: test2.s
<113>   DW_AT_comp_dir: /home/vries/gdb_versions/devel
<117>   DW_AT_producer: GNU AS 2.39.50
<11b>   DW_AT_language: 32769   (MIPS assembler)
 <1><11d>: Abbrev Number: 2 (DW_TAG_subprogram)
<11e>   DW_AT_name: (indirect string, offset: 0x241): foo
<122>   DW_AT_external: 1
<122>   DW_AT_type: <0x133>
<123>   DW_AT_low_pc  : 0x4004ac
<12b>   DW_AT_high_pc : 11
 <1><133>: Abbrev Number: 3 (DW_TAG_unspecified_type)

I will try to fix this.  I originally placed the unspecified tag at the start
of the CU information because I found that I could not otherwise compute the
correct offset for it.  I will just have to try harder.

Cheers
  Nick

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


[Bug gas/29559] gas generated incorrect debug info (top-level DW_TAG_unspecified_type DIE)

2022-09-08 Thread vries at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=29559

--- Comment #2 from Tom de Vries  ---
(In reply to Nick Clifton from comment #1)
> Hi Tom,
> 
>   [For the record the patch that introduced this bug was intended to fix PR
> 29517].
> 
> >  <0><100>: Abbrev Number: 3 (DW_TAG_unspecified_type)
> >  <0><101>: Abbrev Number: 1 (DW_TAG_compile_unit)
>  
> OK, so you are saying that the DW_TAG_unspecified_type is in the wrong place
> ?
> 

Yes.

> Presumably it should be after DW_TAG_subprogram.  IE, something like this:
> 
>  <0><101>: Abbrev Number: 1 (DW_TAG_compile_unit)
> <102>   DW_AT_stmt_list   : 0x123
> <106>   DW_AT_low_pc  : 0x4004ac
> <10e>   DW_AT_high_pc : 11
> <10f>   DW_AT_name: test2.s
> <113>   DW_AT_comp_dir: /home/vries/gdb_versions/devel
> <117>   DW_AT_producer: GNU AS 2.39.50
> <11b>   DW_AT_language: 32769   (MIPS assembler)
>  <1><11d>: Abbrev Number: 2 (DW_TAG_subprogram)
> <11e>   DW_AT_name: (indirect string, offset: 0x241): foo
> <122>   DW_AT_external: 1
> <122>   DW_AT_type: <0x133>
> <123>   DW_AT_low_pc  : 0x4004ac
> <12b>   DW_AT_high_pc : 11
>  <1><133>: Abbrev Number: 3 (DW_TAG_unspecified_type)
> 
> I will try to fix this.  I originally placed the unspecified tag at the
> start of the CU information because I found that I could not otherwise
> compute the correct offset for it.  I will just have to try harder.

After the DW_TAG_compile_unit should also be fine.

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


[Bug gas/29559] gas generated incorrect debug info (top-level DW_TAG_unspecified_type DIE)

2022-09-08 Thread vries at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=29559

--- Comment #3 from Tom de Vries  ---
Created attachment 14325
  --> https://sourceware.org/bugzilla/attachment.cgi?id=14325&action=edit
Dwarf assembly test-case


Currently, this fails:
...
(gdb) PASS: gdb.dwarf2/dw2-unspecified-type.exp: p ((int (*) ()) foo) ()
p (int) foo ()^M
Invalid cast.^M
(gdb) FAIL: gdb.dwarf2/dw2-unspecified-type.exp: p (int) foo ()
...
because DW_TAG_unspecified_type is translated as void.

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


[Bug gas/29559] gas generated incorrect debug info (top-level DW_TAG_unspecified_type DIE)

2022-09-08 Thread vries at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=29559

Tom de Vries  changed:

   What|Removed |Added

  Attachment #14325|0   |1
is obsolete||

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


[Bug gas/29559] gas generated incorrect debug info (top-level DW_TAG_unspecified_type DIE)

2022-09-08 Thread vries at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=29559

--- Comment #4 from Tom de Vries  ---
(In reply to Tom de Vries from comment #3)
> Created attachment 14325 [details]
> Dwarf assembly test-case
> 
> 
> Currently, this fails:
> ...
> (gdb) PASS: gdb.dwarf2/dw2-unspecified-type.exp: p ((int (*) ()) foo) ()
> p (int) foo ()^M
> Invalid cast.^M
> (gdb) FAIL: gdb.dwarf2/dw2-unspecified-type.exp: p (int) foo ()
> ...
> because DW_TAG_unspecified_type is translated as void.

Sorry, meant for the gdb PR.

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


[Bug gas/29559] gas generated incorrect debug info (top-level DW_TAG_unspecified_type DIE)

2022-09-08 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=29559

--- Comment #5 from cvs-commit at gcc dot gnu.org  ---
The master branch has been updated by Nick Clifton :

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

commit 0ee31dffb8202dcd1f867b7144db9a8bd69a7499
Author: Nick Clifton 
Date:   Thu Sep 8 12:43:33 2022 +0100

Gas generated incorrect debug info (top-level DW_TAG_unspecified_type DIE)

PR 29559
* dwarf2dbg.c (out_debug_info): Place DW_TAG_unspecified_type at
the end of the list of children, not at the start of the CU
information.
* testsuite/gas/elf/dwarf-3-func.d: Update expected output.
* testsuite/gas/elf/dwarf-5-func-global.d: Likewise.
* testsuite/gas/elf/dwarf-5-func-local.d: Likewise.
* testsuite/gas/elf/dwarf-5-func.d: Likewise.

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


[Bug gas/29559] gas generated incorrect debug info (top-level DW_TAG_unspecified_type DIE)

2022-09-08 Thread nickc at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=29559

Nick Clifton  changed:

   What|Removed |Added

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

--- Comment #6 from Nick Clifton  ---
Right - I have applied a patch which should fix this problem.

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


[Bug binutils/29523] i686-w64-mingw32-objdump -WL returns incorrect file paths

2022-09-08 Thread ralf.habacker at freenet dot de
https://sourceware.org/bugzilla/show_bug.cgi?id=29523

Ralf Habacker  changed:

   What|Removed |Added

  Component|gas |binutils

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


[Bug binutils/29534] dllwrap, windres and dlltools use mktemp, which should be avoided

2022-09-08 Thread ralf.habacker at freenet dot de
https://sourceware.org/bugzilla/show_bug.cgi?id=29534

--- Comment #4 from Ralf Habacker  ---
(In reply to Nick Clifton from comment #3)
> Patch applied.

Thanks Nick.

I think that https://sourceware.org/bugzilla/show_bug.cgi?id=17227 can also be
closed now.

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


[Bug gas/29559] gas generated incorrect debug info (top-level DW_TAG_unspecified_type DIE)

2022-09-08 Thread vries at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=29559

--- Comment #7 from Tom de Vries  ---
Ack, FWIW, updated DWARF:
...
 <0><100>: Abbrev Number: 1 (DW_TAG_compile_unit)
<101>   DW_AT_stmt_list   : 0x123
<105>   DW_AT_low_pc  : 0x4004ac
<10d>   DW_AT_high_pc : 11
<10e>   DW_AT_name: (indirect string, offset: 0x22a): test2.s
<112>   DW_AT_comp_dir: (indirect string, offset: 0x1d1):
/home/vries/gdb_versions/dev
el
<116>   DW_AT_producer: (indirect string, offset: 0x232): GNU AS
2.39.50
<11a>   DW_AT_language: 32769   (MIPS assembler)
 <1><11c>: Abbrev Number: 2 (DW_TAG_subprogram)
<11d>   DW_AT_name: (indirect string, offset: 0x241): foo
<121>   DW_AT_external: 1
<121>   DW_AT_type: <0x12b>
<122>   DW_AT_low_pc  : 0x4004ac
<12a>   DW_AT_high_pc : 11
 <1><12b>: Abbrev Number: 3 (DW_TAG_unspecified_type)
 <1><12c>: Abbrev Number: 0
...

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


[Bug binutils/17227] The use of `mktemp' is dangerous, better use `mkstemp' (mingw32)

2022-09-08 Thread nickc at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=17227

Nick Clifton  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED
 CC||nickc at redhat dot com

--- Comment #1 from Nick Clifton  ---
Should now be fixed (in the 2.40 sources)

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


[Bug gas/29557] R_RISCV_ALIGN relocation emits wrong padding bytes

2022-09-08 Thread rui314 at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=29557

Rui Ueyama  changed:

   What|Removed |Added

 CC||rui314 at gmail dot com

--- Comment #1 from Rui Ueyama  ---
For the record, here is the link to the upstream bug:
https://github.com/rui314/mold/issues/694

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