binutils: remove some unused obsolete versions
[openwrt/openwrt.git] / toolchain / binutils / patches / 2.22 / 500-arm_ld_assert_fix.patch
1 See http://sourceware.org/bugzilla/show_bug.cgi?id=13990 for details.
2 ---
3 --- a/bfd/elf32-arm.c
4 +++ b/bfd/elf32-arm.c
5 @@ -12046,8 +12046,19 @@ elf32_arm_gc_sweep_hook (bfd *
6 if (may_need_local_target_p
7 && elf32_arm_get_plt_info (abfd, eh, r_symndx, &root_plt, &arm_plt))
8 {
9 - BFD_ASSERT (root_plt->refcount > 0);
10 - root_plt->refcount -= 1;
11 + /* If PLT refcount book-keeping is wrong and too low, we'll
12 + see a zero value (going to -1) for the root PLT reference
13 + count. */
14 + if (root_plt->refcount >= 0)
15 + {
16 + BFD_ASSERT (root_plt->refcount != 0);
17 + root_plt->refcount -= 1;
18 + }
19 + else
20 + /* A value of -1 means the symbol has become local, forced
21 + or seeing a hidden definition. Any other negative value
22 + is an error. */
23 + BFD_ASSERT (root_plt->refcount == -1);
24
25 if (!call_reloc_p)
26 arm_plt->noncall_refcount--;