[Bug binutils/19850] New: [Fix] Wrong parsing attribute in DW_FORM_flag_present form. (Info pointer Warning) + Patch

2016-03-21 Thread igor.venevtsev at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=19850

Bug ID: 19850
   Summary: [Fix] Wrong parsing attribute in DW_FORM_flag_present
form. (Info pointer Warning) + Patch
   Product: binutils
   Version: 2.27 (HEAD)
Status: NEW
  Severity: normal
  Priority: P2
 Component: binutils
  Assignee: unassigned at sourceware dot org
  Reporter: igor.venevtsev at gmail dot com
  Target Milestone: ---

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

objdump always produces 'Dwarf Error: Info pointer extends beyond end of
attributes' warning when meets attribute in DW_FORM_flag_present form. In this
case there is no value encoded in DIE itself and information pointer can be
equal to information pointer end marker.

Please find a fix in attachment.

Regards, Igor

-- 
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/20090] New: [Fix] clang fail on LTO phase with BFD linker (+patch)

2016-05-13 Thread igor.venevtsev at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=20090

Bug ID: 20090
   Summary: [Fix] clang fail on LTO phase with BFD linker (+patch)
   Product: binutils
   Version: 2.27 (HEAD)
Status: NEW
  Severity: normal
  Priority: P2
 Component: ld
  Assignee: unassigned at sourceware dot org
  Reporter: igor.venevtsev at gmail dot com
  Target Milestone: ---

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

Reproducer is just trying to make an executable using one object and two
archives with LTO info inside. First arch, live.a, contains live() function
which is called from main(). The second one, dead.a, contains never called
function dead(). During linking phase, clang comply on 'Unexpected resolution'
and terminates with UNREACHABLE.

bash-4.3$ make

[...skip...]

Unexpected resolution
UNREACHABLE executed at
/users/ivvenevt/llvm/llvm/tools/gold/gold-plugin.cpp:759!
clang-3.9: error: unable to execute command: Aborted (core dumped)
clang-3.9: error: linker command failed due to signal (use -v to see
invocation)
Makefile:26: recipe for target 'test' failed

The reason is wrong resolution reported by ld.bfd for dead (never included to
link) symbols. When LTO plugin asks for dead symbol resolution via
get_symbols() callback, ld.bfd is trying to find BFD entry for this symbol. But
there is no BFD entry for dead symbol despite the symbol itself is defined
(sym.def != LDPK_UNDEF). As a result ld.bfd set resolution to LDPR_UNKNOWN and
confuses the LLVMgold.so plugin. Opposite, GOLD linker reports
LDPR_PREEMPTED_REG for dead symbols. (gold/plugin.cc:959)

Please find reproducer and patch in attachments.

To run reproducer you should specify locations for clang and bfd.ld via
CLANG_BIN and BINUTILS_BIN vars.

Thanks, Igor

-- 
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/20090] [Fix] clang fail on LTO phase with BFD linker (+patch)

2016-05-13 Thread igor.venevtsev at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=20090

Igor Venevtsev  changed:

   What|Removed |Added

 CC||igor.venevtsev at gmail dot com

--- Comment #1 from Igor Venevtsev  ---
Created attachment 9257
  --> https://sourceware.org/bugzilla/attachment.cgi?id=9257&action=edit
PATCH

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