[Bug binutils/23589] New: A hang problem for c++filt

2018-08-29 Thread poppeter1982 at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=23589

Bug ID: 23589
   Summary: A hang problem for c++filt
   Product: binutils
   Version: 2.32 (HEAD)
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: binutils
  Assignee: unassigned at sourceware dot org
  Reporter: poppeter1982 at gmail dot com
  Target Milestone: ---

Created attachment 11216
  --> https://sourceware.org/bugzilla/attachment.cgi?id=11216&action=edit
The proof of concept ASCII file for c++filt

Hi There

The fuzzer generates an input which may hang the execution of c++filt, please
check it on your side if this is a real positive. You could use 
./c++filt < input
to reproduce it.

Thanks
Peng

-- 
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/23591] New: undefined reference to `__start___sancov_cntrs' when building with clang + asan + fuzzing + ld.bfd

2018-08-29 Thread mh-sourceware at glandium dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=23591

Bug ID: 23591
   Summary: undefined reference to `__start___sancov_cntrs' when
building with clang + asan + fuzzing + ld.bfd
   Product: binutils
   Version: unspecified
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: ld
  Assignee: unassigned at sourceware dot org
  Reporter: mh-sourceware at glandium dot org
  Target Milestone: ---

I haven't figured out a small test case, but here's a real world problem:

Get the Firefox/spidermonkey source from https://hg.mozilla.org/mozilla-central

Create a build directory and run the following from under it:
/path/to/mozilla-central/js/src/configure --enable-project=js --enable-fuzzing
--enable-address-sanitizer --enable-linker=bfd CC=clang

(note this also requires llvm-config, rustc, and cargo)

Then run make -j

The build fails with:
BinSource.cpp:(.text.sancov.module_ctor[sancov.module_ctor]+0x4): undefined
reference to `__start___sancov_cntrs'
BinSource.cpp:(.text.sancov.module_ctor[sancov.module_ctor]+0xb): undefined
reference to `__stop___sancov_cntrs'
BinSource.cpp:(.text.sancov.module_ctor[sancov.module_ctor]+0x17): undefined
reference to `__start___sancov_pcs'
BinSource.cpp:(.text.sancov.module_ctor[sancov.module_ctor]+0x1e): undefined
reference to `__stop___sancov_pcs'

I bisected this to the following commit:

commit 7dba9362c172f1073487536eb137feb2da30b0ff
Author: Alan Modra 
Date:   Fri Jun 16 19:41:41 2017 +0930
Rewrite __start and __stop symbol handling

This arranges for __start and __stop symbols to be defined before
garbage collection, for all target formats.  That should allow the
COFF and PE --gc-sections to keep a singleton orphan input section,
a feature lost by 2017-06-13 commit cbd0eecf26.  The fancier ELF
treatment of keeping all input sections associated with a __start or
__stop symbol, from 2015-10-23 commit 1cce69b9dc, is retained.

.startof. and .sizeof. symbols are deliberately not defined before
garbage collection, so these won't affect garbage collection of
sections.

The patch also ensures __start, __stop, .startof. and .sizeof. symbols
are defined before target size_dynamic_sections is called, albeit
with a preliminary value, so that target code doesn't need to cope
with a symbol changing from undefined at size_dynamic_sections to
defined at relocate_section.

Also, a number of problems with the testcases have been 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 ld/23591] undefined reference to `__start___sancov_cntrs' when building with clang + asan + fuzzing + ld.bfd

2018-08-29 Thread mh-sourceware at glandium dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=23591

--- Comment #1 from Mike Hommey  ---
It seems to be due to most __sancov_cntrs sections having the SHT_GROUP flag.
This makes _bfd_elf_section_already_linked set the section's output_section to
bfd_abs_section_ptr, which then fulfils the condition in undef_start_stop
(bfs_abs_section_ptr->owner != link_info.output_bfd), which then marks the
__start/__stop symbols as undefined.

-- 
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