[Bug binutils/22209] invalid memory read in _bfd_safe_read_leb128 (libbfd.c)

2017-09-25 Thread ago at gentoo dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=22209

--- Comment #2 from Agostino Sarubbo  ---
Created attachment 10483
  --> https://sourceware.org/bugzilla/attachment.cgi?id=10483&action=edit
testcase

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/22209] invalid memory read in _bfd_safe_read_leb128 (libbfd.c)

2017-09-25 Thread ago at gentoo dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=22209

--- Comment #1 from Agostino Sarubbo  ---
Created attachment 10482
  --> https://sourceware.org/bugzilla/attachment.cgi?id=10482&action=edit
stacktrace

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/22209] New: invalid memory read in _bfd_safe_read_leb128 (libbfd.c)

2017-09-25 Thread ago at gentoo dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=22209

Bug ID: 22209
   Summary: invalid memory read in _bfd_safe_read_leb128
(libbfd.c)
   Product: binutils
   Version: 2.30 (HEAD)
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: binutils
  Assignee: unassigned at sourceware dot org
  Reporter: ago at gentoo dot org
  Target Milestone: ---

On master at 1da5c9a485f3dcac4c45e96ef4b7dae5948314b5:
# nm -V
GNU nm (Gentoo git) 2.29.51.20170925


Command to reproduce:
# nm -A -a -l -S -s --special-syms --synthetic --with-symbol-versions -D $FILE

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/21732] String-concatenated message can not be translated

2017-09-25 Thread amodra at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=21732

Alan Modra  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED
   Target Milestone|--- |2.30

--- Comment #4 from Alan Modra  ---
Fixed

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/21732] String-concatenated message can not be translated

2017-09-25 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=21732

--- Comment #3 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=66cfc0fd0d9daadc2dac5a783b69b4050c0b1722

commit 66cfc0fd0d9daadc2dac5a783b69b4050c0b1722
Author: Alan Modra 
Date:   Tue Sep 26 11:28:04 2017 +0930

PR21732, String-concatenated message can not be translated

Preprocessor tokens like DWARF_VMA_FMT and BFD_VMA_FMT are not
understood by gettext, and cause the translation string to be
truncated.  Even if it were not truncated, we wouldn't want a value
that changes depending on host or configure options to be put in a
translation string.

PR 21732
* dwarf.c (READ_ULEB): Don't use DWARF_VMA_FMT in translated string.
(READ_SLEB): Likewise.
* readelf.c (bfd_vmatoa): New function.
(get_data, get_dynamic_data): Use it for printing error messages.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/21732] String-concatenated message can not be translated

2017-09-25 Thread amodra at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=21732

Alan Modra  changed:

   What|Removed |Added

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

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/22203] memory leak in display_rel_file in nm.c in binutils 2.29

2017-09-25 Thread luanjunchao at 163 dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=22203

skysider  changed:

   What|Removed |Added

Summary|memory leak in elfxx-x86.c  |memory leak in
   |and |display_rel_file in nm.c in
   |_bfd_generic_read_minisymbo |binutils 2.29
   |ls in binutils 2.29 |

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gold/21090] gcc compiled with --enable-default-pie show errors in binutils testsuite

2017-09-25 Thread sjc+binutils_bugzilla at immunant dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=21090

Stephen Crane  changed:

   What|Removed |Added

 CC||sjc+binutils_bugzilla@immun
   ||ant.com

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/21931] glibc 2.26 Exception handling problem on powerpc

2017-09-25 Thread amodra at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=21931

--- Comment #4 from Alan Modra  ---
The sourceware disk crash lost the following entries from this bugzilla:
http://lists.gnu.org/archive/html/bug-binutils/2017-08/msg00188.html
http://lists.gnu.org/archive/html/bug-binutils/2017-08/msg00193.html
http://lists.gnu.org/archive/html/bug-binutils/2017-08/msg00194.html

I'm not sure what else to suggest, apart from attaching all the objects and
libraries involved in order for someone to recreate the problem.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/22204] integer overflow in decode_line_info in dwarf2.c:2294 in binutils 2.29

2017-09-25 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=22204

--- Comment #1 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=e338894dc2e603683bed2172e8e9f25b29051005

commit e338894dc2e603683bed2172e8e9f25b29051005
Author: Alan Modra 
Date:   Tue Sep 26 09:32:18 2017 +0930

PR22204, Lack of DW_LNE_end_sequence causes "infinite" loop

PR 22204
* dwarf2.c (decode_line_info): Ensure line_ptr stays within
bounds in inner loop.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/22205] .debug_line file table NULL filename

2017-09-25 Thread amodra at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=22205

Alan Modra  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED
   Target Milestone|--- |2.30
Summary|NULL pointer dereference in |.debug_line file table NULL
   |concat_filename (dwarf2.c)  |filename
   |(UNFIXED PR22200)   |

--- Comment #3 from Alan Modra  ---
Fixed

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/22204] Lack of DW_LNE_end_sequence causes "infinite" loop

2017-09-25 Thread amodra at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=22204

Alan Modra  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED
   Target Milestone|--- |2.30
Summary|integer overflow in |Lack of DW_LNE_end_sequence
   |decode_line_info in |causes "infinite" loop
   |dwarf2.c:2294 in binutils   |
   |2.29|

--- Comment #2 from Alan Modra  ---
Fixed

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/22205] NULL pointer dereference in concat_filename (dwarf2.c) (UNFIXED PR22200)

2017-09-25 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=22205

--- Comment #2 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=a54018b72d75abf2e74bf36016702da06399c1d9

commit a54018b72d75abf2e74bf36016702da06399c1d9
Author: Alan Modra 
Date:   Tue Sep 26 09:38:26 2017 +0930

PR22205, .debug_line file table NULL filename

The PR22200 fuzzer testcase found one way to put NULLs into .debug_line
file tables.  PR22205 finds another.  This patch gives up on trying to
prevent NULL files in the file table and instead just copes with them.
Arguably, this is better than giving up and showing no info from
.debug_line.  I've also fixed a case where the fairly recent DWARF5
support in handling broken DWARG could result in uninitialized memory
reads, and made a small tidy.

PR 22205
* dwarf2.c (concat_filename): Return "" on NULL filename.
(read_formatted_entries): Init "fe".
(decode_line_info ): Use line_info_add_file_name.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/22204] integer overflow in decode_line_info in dwarf2.c:2294 in binutils 2.29

2017-09-25 Thread amodra at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=22204

Alan Modra  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2017-09-26
   Assignee|unassigned at sourceware dot org   |amodra at gmail dot com
 Ever confirmed|0   |1

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/22205] NULL pointer dereference in concat_filename (dwarf2.c) (UNFIXED PR22200)

2017-09-25 Thread amodra at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=22205

Alan Modra  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2017-09-25
   Assignee|unassigned at sourceware dot org   |amodra at gmail dot com
 Ever confirmed|0   |1

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/22199] ld segfault with -static and -Map

2017-09-25 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=22199

--- Comment #4 from H.J. Lu  ---
(In reply to Valère Monseur from comment #3)
> I've added an attachment with the input files for the linker.

This isn't sufficient. I need EVERY input file passed to linker, like below:

> /usr/bin/ld --build-id
> --hash-style=gnu -m elf_x86_64 -static -o hello
> /usr/lib/gcc/x86_64-pc-linux-gnu/7.2.0/../../../../lib/crt1.o
> /usr/lib/gcc/x86_64-pc-linux-gnu/7.2.0/../../../../lib/crti.o
> /usr/lib/gcc/x86_64-pc-linux-gnu/7.2.0/crtbeginT.o
> -L/usr/lib/gcc/x86_64-pc-linux-gnu/7.2.0
> -L/usr/lib/gcc/x86_64-pc-linux-gnu/7.2.0/../../../../lib -L/lib/../lib
> -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-pc-linux-gnu/7.2.0/../../.. -v -Map
> hello.map hello.o --start-group -lgcc -lgcc_eh -lc --end-group
> /usr/lib/gcc/x86_64-pc-linux-gnu/7.2.0/crtend.o
> /usr/lib/gcc/x86_64-pc-linux-gnu/7.2.0/../../../../lib/crtn.o

including libgcc.a, libgcc_eh.a and libc.a.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/22203] memory leak in elfxx-x86.c and _bfd_generic_read_minisymbols in binutils 2.29

2017-09-25 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=22203

H.J. Lu  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED
   Target Milestone|--- |2.30

--- Comment #2 from H.J. Lu  ---
Fixed for 2.30.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/22203] memory leak in elfxx-x86.c and _bfd_generic_read_minisymbols in binutils 2.29

2017-09-25 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=22203

--- Comment #1 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=8dba52b60488265e66073130ef77c03f05dcaabc

commit 8dba52b60488265e66073130ef77c03f05dcaabc
Author: H.J. Lu 
Date:   Mon Sep 25 14:07:01 2017 -0700

Free memory returned from bfd_get_synthetic_symtab

PR binutils/22203
* nm.c (display_rel_file): Free memory returned from
bfd_get_synthetic_symtab.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/22202] heap-based buffer overflow in parse_die (dwarf1.c)

2017-09-25 Thread amodra at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=22202

Alan Modra  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED
   Target Milestone|--- |2.30

--- Comment #3 from Alan Modra  ---
Fixed

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/22201] DW_AT_name with out of bounds reference

2017-09-25 Thread amodra at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=22201

Alan Modra  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 CC|amodra at gmail dot com|
 Resolution|--- |FIXED
   Target Milestone|--- |2.30

--- Comment #3 from Alan Modra  ---
Fixed

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/22200] NULL pointer dereference in concat_filename (dwarf2.c)

2017-09-25 Thread amodra at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=22200

Alan Modra  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 CC|amodra at gmail dot com|
 Resolution|--- |FIXED
   Target Milestone|--- |2.30

--- Comment #3 from Alan Modra  ---
Fixed

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/22205] NULL pointer dereference in concat_filename (dwarf2.c) (UNFIXED PR22200)

2017-09-25 Thread ago at gentoo dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=22205

--- Comment #1 from Agostino Sarubbo  ---
Created attachment 10479
  --> https://sourceware.org/bugzilla/attachment.cgi?id=10479&action=edit
testcase

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/22205] New: NULL pointer dereference in concat_filename (dwarf2.c) (UNFIXED PR22200)

2017-09-25 Thread ago at gentoo dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=22205

Bug ID: 22205
   Summary: NULL pointer dereference in concat_filename (dwarf2.c)
(UNFIXED PR22200)
   Product: binutils
   Version: 2.30 (HEAD)
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: binutils
  Assignee: unassigned at sourceware dot org
  Reporter: ago at gentoo dot org
  Target Milestone: ---

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

On master at 1da5c9a485f3dcac4c45e96ef4b7dae5948314b5:
# nm -V
GNU nm (Gentoo git) 2.29.51.20170925


Command to reproduce:
# nm -A -a -l -S -s --special-syms --synthetic --with-symbol-versions -D $FILE

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/22204] New: integer overflow in decode_line_info in dwarf2.c:2294 in binutils 2.29

2017-09-25 Thread luanjunchao at 163 dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=22204

Bug ID: 22204
   Summary: integer overflow in decode_line_info in dwarf2.c:2294
in binutils 2.29
   Product: binutils
   Version: 2.30 (HEAD)
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: binutils
  Assignee: unassigned at sourceware dot org
  Reporter: luanjunchao at 163 dot com
  Target Milestone: ---

Created attachment 10477
  --> https://sourceware.org/bugzilla/attachment.cgi?id=10477&action=edit
poc of integer overflow

When I run "nm-new -a -A -D -l -n -P -r -S --size-sort --special-syms
--synthetic --with-symbol-versions integer_overflow.elf", it just hangs there
and lasts for long time. And When I run ltrace with above command, I find that
it call malloc persistly.

And then I debug it with gdb, I finall find the reason in function
decode_line_info. Here is the snippet of it:

 /* Decode the table.  */
  while (! end_sequence)
{
  op_code = read_1_byte (abfd, line_ptr, line_end);
  line_ptr += 1;

  if (op_code >= lh.opcode_base)
{
  /* Special operand.  */
  adj_opcode = op_code - lh.opcode_base;
  if (lh.line_range == 0)
goto line_fail;
  if (lh.maximum_ops_per_insn == 1)
address += (adj_opcode / lh.line_range
* lh.minimum_instruction_length);
  else
{
  address += ((op_index + adj_opcode / lh.line_range)
  / lh.maximum_ops_per_insn
  * lh.minimum_instruction_length);
  op_index = ((op_index + adj_opcode / lh.line_range)
  % lh.maximum_ops_per_insn);
}
2294: line += lh.line_base + (adj_opcode % lh.line_range);
  /* Append row to matrix using current values.  */
  if (!add_line_info (table, address, op_index, filename,
  line, column, discriminator, 0))
goto line_fail;
  discriminator = 0;
  if (address < low_pc)
low_pc = address;
  if (address > high_pc)
high_pc = address;
}


When I debug the process, the lh.line_base=-5 (int type), while the line is
declared a unsigned int with initial value 0, when it meets a specific
condition, it just traps in the while loop.

The poc is attached.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/22202] heap-based buffer overflow in parse_die (dwarf1.c)

2017-09-25 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=22202

--- Comment #2 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=1da5c9a485f3dcac4c45e96ef4b7dae5948314b5

commit 1da5c9a485f3dcac4c45e96ef4b7dae5948314b5
Author: Alan Modra 
Date:   Mon Sep 25 20:20:38 2017 +0930

PR22202, buffer overflow in parse_die

There was a complete lack of sanity checking in dwarf1.c

PR 22202
* dwarf1.c (parse_die): Sanity check pointer against section limit
before dereferencing.
(parse_line_table): Likewise.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/22201] DW_AT_name with out of bounds reference

2017-09-25 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=22201

--- Comment #2 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=11855d8a1f11b102a702ab76e95b22082cccf2f8

commit 11855d8a1f11b102a702ab76e95b22082cccf2f8
Author: Alan Modra 
Date:   Mon Sep 25 19:46:34 2017 +0930

PR22201, DW_AT_name with out of bounds reference

DW_AT_name ought to always have a string value.

PR 22201
* dwarf2.c (scan_unit_for_symbols): Ignore DW_AT_name unless it
has string form.
(parse_comp_unit): Likewise.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/22200] NULL pointer dereference in concat_filename (dwarf2.c)

2017-09-25 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=22200

--- Comment #2 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=c361faae8d964db951b7100cada4dcdc983df1bf

commit c361faae8d964db951b7100cada4dcdc983df1bf
Author: Alan Modra 
Date:   Mon Sep 25 19:03:46 2017 +0930

PR22200, DWARF5 .debug_line sanity check

The format_count entry can't be zero unless the count is also zero.

PR 22200
* dwarf2.c (read_formatted_entries): Error on format_count zero.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/22199] ld segfault with -static and -Map

2017-09-25 Thread valere.monseur at ymail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=22199

--- Comment #3 from Valère Monseur  ---
I've added an attachment with the input files for the linker.
I can also reproduce the problem with these commands:

gcc -c hello.c
gcc -v -static -Wl,-v -Wl,-Map,hello.map hello.o -o hello => segfault

Here is the output:

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/7.2.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /build/gcc/src/gcc/configure --prefix=/usr --libdir=/usr/lib
--libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info
--with-bugurl=https://bugs.archlinux.org/
--enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared
--enable-threads=posix --enable-libmpx --with-system-zlib --with-isl
--enable-__cxa_atexit --disable-libunwind-exceptions --enable-clocale=gnu
--disable-libstdcxx-pch --disable-libssp --enable-gnu-unique-object
--enable-linker-build-id --enable-lto --enable-plugin
--enable-install-libiberty --with-linker-hash-style=gnu
--enable-gnu-indirect-function --disable-multilib --disable-werror
--enable-checking=release --enable-default-pie --enable-default-ssp
Thread model: posix
gcc version 7.2.0 (GCC) 
COMPILER_PATH=/usr/lib/gcc/x86_64-pc-linux-gnu/7.2.0/:/usr/lib/gcc/x86_64-pc-linux-gnu/7.2.0/:/usr/lib/gcc/x86_64-pc-linux-gnu/:/usr/lib/gcc/x86_64-pc-linux-gnu/7.2.0/:/usr/lib/gcc/x86_64-pc-linux-gnu/
LIBRARY_PATH=/usr/lib/gcc/x86_64-pc-linux-gnu/7.2.0/:/usr/lib/gcc/x86_64-pc-linux-gnu/7.2.0/../../../../lib/:/lib/../lib/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-pc-linux-gnu/7.2.0/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-static' '-o' 'hello' '-mtune=generic'
'-march=x86-64'
 /usr/lib/gcc/x86_64-pc-linux-gnu/7.2.0/collect2 -plugin
/usr/lib/gcc/x86_64-pc-linux-gnu/7.2.0/liblto_plugin.so
-plugin-opt=/usr/lib/gcc/x86_64-pc-linux-gnu/7.2.0/lto-wrapper
-plugin-opt=-fresolution=/tmp/ccM7HJ0X.res -plugin-opt=-pass-through=-lgcc
-plugin-opt=-pass-through=-lgcc_eh -plugin-opt=-pass-through=-lc --build-id
--hash-style=gnu -m elf_x86_64 -static -o hello
/usr/lib/gcc/x86_64-pc-linux-gnu/7.2.0/../../../../lib/crt1.o
/usr/lib/gcc/x86_64-pc-linux-gnu/7.2.0/../../../../lib/crti.o
/usr/lib/gcc/x86_64-pc-linux-gnu/7.2.0/crtbeginT.o
-L/usr/lib/gcc/x86_64-pc-linux-gnu/7.2.0
-L/usr/lib/gcc/x86_64-pc-linux-gnu/7.2.0/../../../../lib -L/lib/../lib
-L/usr/lib/../lib -L/usr/lib/gcc/x86_64-pc-linux-gnu/7.2.0/../../.. -v -Map
hello.map hello.o --start-group -lgcc -lgcc_eh -lc --end-group
/usr/lib/gcc/x86_64-pc-linux-gnu/7.2.0/crtend.o
/usr/lib/gcc/x86_64-pc-linux-gnu/7.2.0/../../../../lib/crtn.o
collect2 version 7.2.0
/usr/bin/ld -plugin /usr/lib/gcc/x86_64-pc-linux-gnu/7.2.0/liblto_plugin.so
-plugin-opt=/usr/lib/gcc/x86_64-pc-linux-gnu/7.2.0/lto-wrapper
-plugin-opt=-fresolution=/tmp/ccM7HJ0X.res -plugin-opt=-pass-through=-lgcc
-plugin-opt=-pass-through=-lgcc_eh -plugin-opt=-pass-through=-lc --build-id
--hash-style=gnu -m elf_x86_64 -static -o hello
/usr/lib/gcc/x86_64-pc-linux-gnu/7.2.0/../../../../lib/crt1.o
/usr/lib/gcc/x86_64-pc-linux-gnu/7.2.0/../../../../lib/crti.o
/usr/lib/gcc/x86_64-pc-linux-gnu/7.2.0/crtbeginT.o
-L/usr/lib/gcc/x86_64-pc-linux-gnu/7.2.0
-L/usr/lib/gcc/x86_64-pc-linux-gnu/7.2.0/../../../../lib -L/lib/../lib
-L/usr/lib/../lib -L/usr/lib/gcc/x86_64-pc-linux-gnu/7.2.0/../../.. -v -Map
hello.map hello.o --start-group -lgcc -lgcc_eh -lc --end-group
/usr/lib/gcc/x86_64-pc-linux-gnu/7.2.0/crtend.o
/usr/lib/gcc/x86_64-pc-linux-gnu/7.2.0/../../../../lib/crtn.o
collect2: fatal error: ld terminated with signal 11 [Segmentation fault], core
dumped
compilation terminated.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/22199] ld segfault with -static and -Map

2017-09-25 Thread valere.monseur at ymail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=22199

--- Comment #2 from Valère Monseur  ---
Created attachment 10476
  --> https://sourceware.org/bugzilla/attachment.cgi?id=10476&action=edit
tarball containing all files for the linker

the attachment contains all files for the linker as well as a small script
run_ld.sh to run the linker using the same parameters as generated
automatically.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/22203] New: memory leak in elfxx-x86.c and _bfd_generic_read_minisymbols in binutils 2.29

2017-09-25 Thread luanjunchao at 163 dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=22203

Bug ID: 22203
   Summary: memory leak in elfxx-x86.c and
_bfd_generic_read_minisymbols in binutils 2.29
   Product: binutils
   Version: 2.29
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: binutils
  Assignee: unassigned at sourceware dot org
  Reporter: luanjunchao at 163 dot com
  Target Milestone: ---

Created attachment 10475
  --> https://sourceware.org/bugzilla/attachment.cgi?id=10475&action=edit
poc of memory leak

When I run "nm-new -a -A -D -l -n -P -r -S --size-sort --special-syms
--synthetic --with-symbol-versions leak.elf", it shows that there are memory
leaks as follows:

==12910==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 495 byte(s) in 1 object(s) allocated from:
#0 0x7fac81cf7602 in malloc
(/usr/lib/x86_64-linux-gnu/libasan.so.2+0x98602)
#1 0x4277b7 in bfd_malloc /work/binutils-gdb-asan/bfd/libbfd.c:193
#2 0x4279b1 in bfd_zmalloc /work/binutils-gdb-asan/bfd/libbfd.c:278
#3 0x46f9ce in _bfd_x86_elf_get_synthetic_symtab
/work/binutils-gdb-asan/bfd/elfxx-x86.c:1829
#4 0x4621cf in elf_x86_64_get_synthetic_symtab
/work/binutils-gdb-asan/bfd/elf64-x86-64.c:4963
#5 0x40765a in display_rel_file /work/binutils-gdb-asan/binutils/nm.c:1155
#6 0x408205 in display_file /work/binutils-gdb-asan/binutils/nm.c:1318
#7 0x409dcd in main /work/binutils-gdb-asan/binutils/nm.c:1792
#8 0x7fac816b182f in __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x2082f)

Direct leak of 88 byte(s) in 1 object(s) allocated from:
#0 0x7fac81cf7602 in malloc
(/usr/lib/x86_64-linux-gnu/libasan.so.2+0x98602)
#1 0x4277b7 in bfd_malloc /work/binutils-gdb-asan/bfd/libbfd.c:193
#2 0x431a39 in _bfd_generic_read_minisymbols
/work/binutils-gdb-asan/bfd/syms.c:814
#3 0x4072ec in display_rel_file /work/binutils-gdb-asan/binutils/nm.c:1107
#4 0x408205 in display_file /work/binutils-gdb-asan/binutils/nm.c:1318
#5 0x409dcd in main /work/binutils-gdb-asan/binutils/nm.c:1792
#6 0x7fac816b182f in __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x2082f)

SUMMARY: AddressSanitizer: 583 byte(s) leaked in 2 allocation(s).

The leak.elf is attached.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/22202] heap-based buffer overflow in parse_die (dwarf1.c)

2017-09-25 Thread amodra at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=22202

Alan Modra  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2017-09-25
   Assignee|unassigned at sourceware dot org   |amodra at gmail dot com
 Ever confirmed|0   |1

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/22199] ld segfault with -static and -Map

2017-09-25 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=22199

H.J. Lu  changed:

   What|Removed |Added

 Status|UNCONFIRMED |WAITING
   Last reconfirmed||2017-09-25
 CC||hjl.tools at gmail dot com
 Ever confirmed|0   |1

--- Comment #1 from H.J. Lu  ---
I can't reproduce it.  Please provide all input files for linker.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/22201] DW_AT_name with out of bounds reference

2017-09-25 Thread amodra at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=22201

Alan Modra  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2017-09-25
 CC||amodra at gmail dot com
   Assignee|unassigned at sourceware dot org   |amodra at gmail dot com
Summary|NULL pointer dereference in |DW_AT_name with out of
   |bfd_hash_hash (hash.c)  |bounds reference
 Ever confirmed|0   |1

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/22200] NULL pointer dereference in concat_filename (dwarf2.c)

2017-09-25 Thread amodra at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=22200

Alan Modra  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2017-09-25
 CC||amodra at gmail dot com
   Assignee|unassigned at sourceware dot org   |amodra at gmail dot com
 Ever confirmed|0   |1

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/22202] heap-based buffer overflow in parse_die (dwarf1.c)

2017-09-25 Thread ago at gentoo dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=22202

--- Comment #1 from Agostino Sarubbo  ---
Created attachment 10474
  --> https://sourceware.org/bugzilla/attachment.cgi?id=10474&action=edit
testcase

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/22202] New: heap-based buffer overflow in parse_die (dwarf1.c)

2017-09-25 Thread ago at gentoo dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=22202

Bug ID: 22202
   Summary: heap-based buffer overflow in parse_die (dwarf1.c)
   Product: binutils
   Version: 2.30 (HEAD)
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: binutils
  Assignee: unassigned at sourceware dot org
  Reporter: ago at gentoo dot org
  Target Milestone: ---

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

On master at 52a93b95ec0771c97e26f0bb28630a271a667bd2:
# nm -V
GNU nm (Gentoo git) 2.29.51.20170924


Command to reproduce:
# nm -A -a -l -S -s --special-syms --synthetic --with-symbol-versions -D $FILE

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/22201] NULL pointer dereference in bfd_hash_hash (hash.c)

2017-09-25 Thread ago at gentoo dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=22201

--- Comment #1 from Agostino Sarubbo  ---
Created attachment 10472
  --> https://sourceware.org/bugzilla/attachment.cgi?id=10472&action=edit
testcase

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/22201] New: NULL pointer dereference in bfd_hash_hash (hash.c)

2017-09-25 Thread ago at gentoo dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=22201

Bug ID: 22201
   Summary: NULL pointer dereference in bfd_hash_hash (hash.c)
   Product: binutils
   Version: 2.30 (HEAD)
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: binutils
  Assignee: unassigned at sourceware dot org
  Reporter: ago at gentoo dot org
  Target Milestone: ---

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

On master at 52a93b95ec0771c97e26f0bb28630a271a667bd2:
# nm -V
GNU nm (Gentoo git) 2.29.51.20170924


Command to reproduce:
# nm -A -a -l -S -s --special-syms --synthetic --with-symbol-versions -D $FILE

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/22200] NULL pointer dereference in concat_filename (dwarf2.c)

2017-09-25 Thread ago at gentoo dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=22200

--- Comment #1 from Agostino Sarubbo  ---
Created attachment 10470
  --> https://sourceware.org/bugzilla/attachment.cgi?id=10470&action=edit
testcase

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/22200] New: NULL pointer dereference in concat_filename (dwarf2.c)

2017-09-25 Thread ago at gentoo dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=22200

Bug ID: 22200
   Summary: NULL pointer dereference in concat_filename (dwarf2.c)
   Product: binutils
   Version: 2.30 (HEAD)
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: binutils
  Assignee: unassigned at sourceware dot org
  Reporter: ago at gentoo dot org
  Target Milestone: ---

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

On master at 52a93b95ec0771c97e26f0bb28630a271a667bd2:
# nm -V
GNU nm (Gentoo git) 2.29.51.20170924


Command to reproduce:
# nm -A -a -l -S -s --special-syms --synthetic --with-symbol-versions -D $FILE

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/22199] New: ld segfault with -static and -Map

2017-09-25 Thread valere.monseur at ymail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=22199

Bug ID: 22199
   Summary: ld segfault with -static and -Map
   Product: binutils
   Version: 2.29
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: binutils
  Assignee: unassigned at sourceware dot org
  Reporter: valere.monseur at ymail dot com
  Target Milestone: ---

Created attachment 10468
  --> https://sourceware.org/bugzilla/attachment.cgi?id=10468&action=edit
verbose output of ld

OS: Linux 4.12.13-1-ARCH x86_64 (archlinux)

Description: ld segfault when compiling with both -static and -Map options.
The reported error is:

collect2: fatal error: ld terminated with signal 11 [Segmentation fault], core
dumped
compilation terminated.

I have the same result with binutils 2.29 (from my standard distribution
repository) and 2.29.1 (built myself).

The gcc version is 7.2.0
The glibc version is 2.26

I've tried on another machine (same architecture) and get the same result.

Steps to Reproduce: 

1) create source file: hello.c

#include 

int main (int argc, char **argv)
{
printf("hello world!");
}

2) compile with these options:

gcc -Wl,-Map,hello.map hello.c  => works ok
gcc -static hello.c => works ok
gcc -static -Wl,-Map,hello.map hello.c  => segfault

I've attached the verbose output of the linker created like this:
gcc -static -Wl,--verbose -Wl,-Map,hello.map hello.c &> ./verbose.txt

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils