[Bug gas/25878] Error: file table slot 1 is already occupied by a different file

2020-10-17 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=25878

--- Comment #10 from cvs-commit at gcc dot gnu.org  ---
The master branch has been updated by H.J. Lu :

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

commit bd0c565edbf4ba8121fded38e389530d7fa6f963
Author: H.J. Lu 
Date:   Sat Oct 17 04:24:22 2020 -0700

gas: Always use as_where for preprocessed assembly codes

Always clear the slot 1 if it was assigned to the input file before the
first .file  directive has been seen.  Always use as_where to
generate the correct debug infor for preprocessed assembly codes.

PR gas/25878
PR gas/26740
* dwarf2dbg.c (allocate_filename_to_slot): Don't reuse the slot 1
here.
(dwarf2_where): Restore as_where.
(dwarf2_directive_filename): Clear the slot 1 if it was assigned
to the input file.
* testsuite/gas/i386/dwarf5-line-2.d: New file.
* testsuite/gas/i386/dwarf5-line-2.s: Likewise.
* testsuite/gas/i386/dwarf5-line-3.d: Likewise.
* testsuite/gas/i386/dwarf5-line-3.s: Likewise.
* testsuite/gas/i386/i386.exp: Run dwarf5-line-2 and
dwarf5-line-3.

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


[Bug gas/26740] Extra filename generated by --gdwarf-4

2020-10-17 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=26740

--- Comment #7 from cvs-commit at gcc dot gnu.org  ---
The master branch has been updated by H.J. Lu :

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

commit bd0c565edbf4ba8121fded38e389530d7fa6f963
Author: H.J. Lu 
Date:   Sat Oct 17 04:24:22 2020 -0700

gas: Always use as_where for preprocessed assembly codes

Always clear the slot 1 if it was assigned to the input file before the
first .file  directive has been seen.  Always use as_where to
generate the correct debug infor for preprocessed assembly codes.

PR gas/25878
PR gas/26740
* dwarf2dbg.c (allocate_filename_to_slot): Don't reuse the slot 1
here.
(dwarf2_where): Restore as_where.
(dwarf2_directive_filename): Clear the slot 1 if it was assigned
to the input file.
* testsuite/gas/i386/dwarf5-line-2.d: New file.
* testsuite/gas/i386/dwarf5-line-2.s: Likewise.
* testsuite/gas/i386/dwarf5-line-3.d: Likewise.
* testsuite/gas/i386/dwarf5-line-3.s: Likewise.
* testsuite/gas/i386/i386.exp: Run dwarf5-line-2 and
dwarf5-line-3.

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


[Bug gas/25878] Error: file table slot 1 is already occupied by a different file

2020-10-17 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=25878

H.J. Lu  changed:

   What|Removed |Added

   Target Milestone|--- |2.36

--- Comment #11 from H.J. Lu  ---
Fixed for 2.36 so far.

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


[Bug gas/26740] Extra filename generated by --gdwarf-4

2020-10-17 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=26740

--- Comment #8 from cvs-commit at gcc dot gnu.org  ---
The master branch has been updated by H.J. Lu :

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

commit 7ffdc9ae6ed88601e7f422ab117fe3abeef110dc
Author: H.J. Lu 
Date:   Sat Oct 17 05:35:23 2020 -0700

gas: Replace dwarf5-line-2.S with dwarf5-line-3.S

PR gas/25878
PR gas/26740
* testsuite/gas/i386/dwarf5-line-3.s: Replace dwarf5-line-2.S
with dwarf5-line-3.S.
* testsuite/gas/i386/dwarf5-line-3.d: Updated.

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


[Bug gas/25878] Error: file table slot 1 is already occupied by a different file

2020-10-17 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=25878

--- Comment #12 from cvs-commit at gcc dot gnu.org  ---
The master branch has been updated by H.J. Lu :

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

commit 7ffdc9ae6ed88601e7f422ab117fe3abeef110dc
Author: H.J. Lu 
Date:   Sat Oct 17 05:35:23 2020 -0700

gas: Replace dwarf5-line-2.S with dwarf5-line-3.S

PR gas/25878
PR gas/26740
* testsuite/gas/i386/dwarf5-line-3.s: Replace dwarf5-line-2.S
with dwarf5-line-3.S.
* testsuite/gas/i386/dwarf5-line-3.d: Updated.

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


Re: c++filt failed to demangle names

2020-10-17 Thread Alan Modra
On Sat, Oct 17, 2020 at 05:54:54PM +1100, Jupiter wrote:
> I am running c++filt on ubuntu 18.04, it can demangle some names but
> failed other names:
> 
> $ c++filt _ZN5boost4asio6detail9scheduler3runERNS_6system10error_codeE+0x83
> 
> _ZN5boost4asio6detail9scheduler3runERNS_6system10error_codeE+0x83

Lose the +0x83, which isn't part of the name and it can

$ c++filt _ZN5boost4asio6detail9scheduler3runERNS_6system10error_codeE
boost::asio::detail::scheduler::run(boost::system::error_code&)

-- 
Alan Modra
Australia Development Lab, IBM



[Bug gas/26740] Extra filename generated by --gdwarf-4

2020-10-17 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=26740

--- Comment #9 from cvs-commit at gcc dot gnu.org  ---
The master branch has been updated by H.J. Lu :

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

commit 9717970a4e374218fe74c99cf5bc7f1d45adbf0e
Author: H.J. Lu 
Date:   Sat Oct 17 05:52:13 2020 -0700

gas: Add a -gdwarf-5 debug_line test with .s file

PR gas/25878
PR gas/26740
* testsuite/gas/i386/dwarf5-line-4.d: New file.
* testsuite/gas/i386/dwarf5-line-4.s: Likewise.
* testsuite/gas/i386/i386.exp: Run dwarf5-line-4.

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


[Bug gas/25878] Error: file table slot 1 is already occupied by a different file

2020-10-17 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=25878

--- Comment #13 from cvs-commit at gcc dot gnu.org  ---
The master branch has been updated by H.J. Lu :

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

commit 9717970a4e374218fe74c99cf5bc7f1d45adbf0e
Author: H.J. Lu 
Date:   Sat Oct 17 05:52:13 2020 -0700

gas: Add a -gdwarf-5 debug_line test with .s file

PR gas/25878
PR gas/26740
* testsuite/gas/i386/dwarf5-line-4.d: New file.
* testsuite/gas/i386/dwarf5-line-4.s: Likewise.
* testsuite/gas/i386/i386.exp: Run dwarf5-line-4.

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


[Bug gas/26745] New: --debug-prefix-map OLD=NEW option does not correctly affect DW_AT_name in DW_TAG_compile_unit

2020-10-17 Thread marko.micovic.93 at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=26745

Bug ID: 26745
   Summary: --debug-prefix-map OLD=NEW option does not correctly
affect DW_AT_name in DW_TAG_compile_unit
   Product: binutils
   Version: 2.34
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: gas
  Assignee: unassigned at sourceware dot org
  Reporter: marko.micovic.93 at gmail dot com
  Target Milestone: ---

Given the assembly source file with next simple x86-64 assembly statement

.text
movq %rax, %rbx
.end

gas produces next outputs.

--

as -g --debug-prefix-map ./=./random/path/ -o example.o example.s
objdump -g example.o

Output of the previous two commands among other things is:

Contents of the .debug_info section (loaded from example.o):

  Compilation Unit @ offset 0x0:
   Length:0x2a (32-bit)
   Version:   2
   Abbrev Offset: 0x0
   Pointer Size:  8
 <0>: Abbrev Number: 1 (DW_TAG_compile_unit)
   DW_AT_stmt_list   : 0x0
<10>   DW_AT_low_pc  : 0x0
<18>   DW_AT_high_pc : 0x3
<20>   DW_AT_name: (indirect string, offset: 0x0): example.s
<24>   DW_AT_comp_dir: (indirect string, offset: 0xa):
/home/marko/example
<28>   DW_AT_producer: (indirect string, offset: 0x1e): GNU AS 2.34
<2c>   DW_AT_language: 32769(MIPS assembler)

--

as -g --debug-prefix-map =./random/path/ -o example.o example.s
objdump -g example.o

Output of the previous two commands among other things is:

Contents of the .debug_info section (loaded from example.o):

  Compilation Unit @ offset 0x0:
   Length:0x2a (32-bit)
   Version:   2
   Abbrev Offset: 0x0
   Pointer Size:  8
 <0>: Abbrev Number: 1 (DW_TAG_compile_unit)
   DW_AT_stmt_list   : 0x0
<10>   DW_AT_low_pc  : 0x0
<18>   DW_AT_high_pc : 0x3
<20>   DW_AT_name: (indirect string, offset: 0x0): example.s
<24>   DW_AT_comp_dir: (indirect string, offset: 0xa):
./random/path//home/marko/example
<28>   DW_AT_producer: (indirect string, offset: 0x2c): GNU AS 2.34
<2c>   DW_AT_language: 32769(MIPS assembler)

--

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


[Bug gas/26745] --debug-prefix-map OLD=NEW option does not correctly affect DW_AT_name in DW_TAG_compile_unit

2020-10-17 Thread marko.micovic.93 at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=26745

Marko  changed:

   What|Removed |Added

 CC||marko.micovic.93 at gmail dot 
com

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


Re: c++filt failed to demangle names

2020-10-17 Thread Jupiter
Thanks Alan, my bad, my apology.

On 10/17/20, Alan Modra  wrote:
> On Sat, Oct 17, 2020 at 05:54:54PM +1100, Jupiter wrote:
>> I am running c++filt on ubuntu 18.04, it can demangle some names but
>> failed other names:
>>
>> $ c++filt
>> _ZN5boost4asio6detail9scheduler3runERNS_6system10error_codeE+0x83
>>
>> _ZN5boost4asio6detail9scheduler3runERNS_6system10error_codeE+0x83
>
> Lose the +0x83, which isn't part of the name and it can
>
> $ c++filt _ZN5boost4asio6detail9scheduler3runERNS_6system10error_codeE
> boost::asio::detail::scheduler::run(boost::system::error_code&)
>
> --
> Alan Modra
> Australia Development Lab, IBM
>


-- 
"A man can fail many times, but he isn't a failure until he begins to
blame somebody else."
-- John Burroughs



[Bug gold/26747] New: SEGV on convert_host(elfcpp_swap.h:194)

2020-10-17 Thread 2060909445 at qq dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=26747

Bug ID: 26747
   Summary: SEGV on convert_host(elfcpp_swap.h:194)
   Product: binutils
   Version: 2.35
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: gold
  Assignee: ccoutant at gmail dot com
  Reporter: 2060909445 at qq dot com
CC: ian at airs dot com
  Target Milestone: ---

Created attachment 12905
  --> https://sourceware.org/bugzilla/attachment.cgi?id=12905&action=edit
a file that makes crash

binutils 2.35 on centos linux 7.7.1908

It can be reproduced by: 
dwp poc -o ./test_out

information below from valgrind:
==3833== Invalid read of size 4
==3833==at 0x4B356F: convert_host (elfcpp_swap.h:194)
==3833==by 0x4B356F: convert_host (elfcpp_swap.h:221)
==3833==by 0x4B356F: get_sh_type (elfcpp.h:1227)
==3833==by 0x4B356F: gold::Sized_relobj_dwo<64, true>::setup() (dwp.cc:791)
==3833==by 0x4B3E19: gold::Relobj* gold::Dwo_file::sized_make_object<64,
true>(unsigned char const*, gold::Input_file*, gold::Dwp_output_file*)
(dwp.cc:1106)
==3833==by 0x413AB0: gold::Dwo_file::make_object(gold::Dwp_output_file*)
(dwp.cc:1079)
==3833==by 0x41AD03: gold::Dwo_file::read(gold::Dwp_output_file*)
(dwp.cc:888)
==3833==by 0x40A62F: main (dwp.cc:2446)
==3833==  Address 0xff0004023006 is not stack'd, malloc'd or (recently)
free'd
==3833==
==3833==
==3833== Process terminating with default action of signal 11 (SIGSEGV)
==3833==  Access not within mapped region at address 0xFF0004023006
==3833==at 0x4B356F: convert_host (elfcpp_swap.h:194)
==3833==by 0x4B356F: convert_host (elfcpp_swap.h:221)
==3833==by 0x4B356F: get_sh_type (elfcpp.h:1227)
==3833==by 0x4B356F: gold::Sized_relobj_dwo<64, true>::setup() (dwp.cc:791)
==3833==by 0x4B3E19: gold::Relobj* gold::Dwo_file::sized_make_object<64,
true>(unsigned char const*, gold::Input_file*, gold::Dwp_output_file*)
(dwp.cc:1106)
==3833==by 0x413AB0: gold::Dwo_file::make_object(gold::Dwp_output_file*)
(dwp.cc:1079)
==3833==by 0x41AD03: gold::Dwo_file::read(gold::Dwp_output_file*)
(dwp.cc:888)
==3833==by 0x40A62F: main (dwp.cc:2446)
==3833==  If you believe this happened as a result of a stack
==3833==  overflow in your program's main thread (unlikely but
==3833==  possible), you can try to increase the size of the
==3833==  main thread stack using the --main-stacksize= flag.
==3833==  The main thread stack size used in this run was 8388608.
==3833==
==3833== HEAP SUMMARY:
==3833== in use at exit: 556,525 bytes in 760 blocks
==3833==   total heap usage: 825 allocs, 65 frees, 567,841 bytes allocated
==3833==
==3833== LEAK SUMMARY:
==3833==definitely lost: 0 bytes in 0 blocks
==3833==indirectly lost: 0 bytes in 0 blocks
==3833==  possibly lost: 0 bytes in 0 blocks
==3833==still reachable: 556,525 bytes in 760 blocks
==3833==   of which reachable via heuristic:
==3833== stdstring  : 27,369 bytes in 717
blocks
==3833== suppressed: 0 bytes in 0 blocks
==3833== Rerun with --leak-check=full to see details of leaked memory
==3833==
==3833== For lists of detected and suppressed errors, rerun with: -s
==3833== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)

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


[Bug gold/26748] New: SEGV on initialize_shnum(dwp.cc:806)

2020-10-17 Thread 2060909445 at qq dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=26748

Bug ID: 26748
   Summary: SEGV on initialize_shnum(dwp.cc:806)
   Product: binutils
   Version: 2.35
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: gold
  Assignee: ccoutant at gmail dot com
  Reporter: 2060909445 at qq dot com
CC: ian at airs dot com
  Target Milestone: ---

Created attachment 12906
  --> https://sourceware.org/bugzilla/attachment.cgi?id=12906&action=edit
a file that makes crash

binutils 2.35 on centos linux 7.7.1908

It can be reproduced by: 
dwp poc -o ./test_out

information below from valgrind:
==4157== Invalid read of size 8
==4157==at 0x40C088: elfcpp::Elf_file<64, false,
gold::Object>::initialize_shnum() [clone .part.452] (elfcpp_file.h:443)
==4157==by 0x4B4787: initialize_shnum (dwp.cc:806)
==4157==by 0x4B4787: shnum (elfcpp_file.h:143)
==4157==by 0x4B4787: gold::Sized_relobj_dwo<64, false>::setup()
(dwp.cc:778)
==4157==by 0x41438F: sized_make_object<64, false> (dwp.cc:1106)
==4157==by 0x41438F: gold::Dwo_file::make_object(gold::Dwp_output_file*)
(dwp.cc:1086)
==4157==by 0x41AD03: gold::Dwo_file::read(gold::Dwp_output_file*)
(dwp.cc:888)
==4157==by 0x40A62F: main (dwp.cc:2446)
==4157==  Address 0x96969611036b2309 is not stack'd, malloc'd or (recently)
free'd
==4157==
==4157==
==4157== Process terminating with default action of signal 11 (SIGSEGV)
==4157==  General Protection Fault
==4157==at 0x40C088: elfcpp::Elf_file<64, false,
gold::Object>::initialize_shnum() [clone .part.452] (elfcpp_file.h:443)
==4157==by 0x4B4787: initialize_shnum (dwp.cc:806)
==4157==by 0x4B4787: shnum (elfcpp_file.h:143)
==4157==by 0x4B4787: gold::Sized_relobj_dwo<64, false>::setup()
(dwp.cc:778)
==4157==by 0x41438F: sized_make_object<64, false> (dwp.cc:1106)
==4157==by 0x41438F: gold::Dwo_file::make_object(gold::Dwp_output_file*)
(dwp.cc:1086)
==4157==by 0x41AD03: gold::Dwo_file::read(gold::Dwp_output_file*)
(dwp.cc:888)
==4157==by 0x40A62F: main (dwp.cc:2446)
==4157==
==4157== HEAP SUMMARY:
==4157== in use at exit: 32,377 bytes in 759 blocks
==4157==   total heap usage: 824 allocs, 65 frees, 43,697 bytes allocated
==4157==
==4157== LEAK SUMMARY:
==4157==definitely lost: 0 bytes in 0 blocks
==4157==indirectly lost: 0 bytes in 0 blocks
==4157==  possibly lost: 0 bytes in 0 blocks
==4157==still reachable: 32,377 bytes in 759 blocks
==4157==   of which reachable via heuristic:
==4157== stdstring  : 27,229 bytes in 717
blocks
==4157== suppressed: 0 bytes in 0 blocks
==4157== Rerun with --leak-check=full to see details of leaked memory
==4157==
==4157== For lists of detected and suppressed errors, rerun with: -s
==4157== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)

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