powerpc gold, work around pr17670
authorAlan Modra <amodra@gmail.com>
Wed, 3 Dec 2014 05:47:23 +0000 (16:17 +1030)
committerAlan Modra <amodra@gmail.com>
Thu, 4 Dec 2014 00:53:14 +0000 (11:23 +1030)
commitfeba93770920f91760d6390541221b75ba5c95f3
treefe3af2a20f77bc6218d570046656ce1e2c7e393a
parentb6cc44453451b1ac6ca22d83875a6c3583ceec3d
powerpc gold, work around pr17670

pr17670 is about an assert triggering on a branch to an undefined
weak symbol, the symbol being undefined due to dropping its comdat
group section.  (Well sort of.  The symbol is actually defined in
an .opd section which isn't part of the group, but the code section
the opd entry points at is dropped.)  So don't assert.
Also, don't make long branch stubs to such symbols, and arrange to
have target-reloc.h code warn when applying relocs that use the sym.

PR 17670
* symtab.cc (Symbol::set_undefined): Remove assertion.
* powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
on symbols defined in discarded sections, instead return false.
Rearrange params, update all callers.
(Target_powerpc::Branch_info::make_stub): Don't make stubs for
branches to syms in discarded sections.
(Global_symbol_visitor_opd::operator()): Set discarded opd syms
undefined and flag as discarded.
(Target_powerpc::Relocate::relocate): Localize variable.
gold/ChangeLog
gold/powerpc.cc
gold/symtab.cc