add gdb sim sample for h8s
[openadk.git] / toolchain / binutils / patches / 2.28 / cris-pr16044.patch
blobf219623dccff6095590f8adc80890bf9dfe25359
1 diff -Nur binutils-2.28.orig/bfd/elf32-cris.c binutils-2.28/bfd/elf32-cris.c
2 --- binutils-2.28.orig/bfd/elf32-cris.c 2017-03-02 09:23:53.000000000 +0100
3 +++ binutils-2.28/bfd/elf32-cris.c 2017-03-29 04:09:00.227801746 +0200
4 @@ -2714,8 +2714,9 @@
5 struct bfd_link_info *info = (struct bfd_link_info *) p;
7 /* A GOTPLT reloc, when activated, is supposed to be included into
8 - the PLT refcount. */
9 + the PLT refcount, when the symbol isn't set-or-forced local. */
10 BFD_ASSERT (h->gotplt_refcount == 0
11 + || h->root.plt.refcount == -1
12 || h->gotplt_refcount <= h->root.plt.refcount);
14 /* If nobody wanted a GOTPLT with this symbol, we're done. */
15 @@ -2741,6 +2742,7 @@
16 srelgot = elf_hash_table (info)->srelgot;
18 /* Put accurate refcounts there. */
19 + BFD_ASSERT (h->root.got.refcount >= 0);
20 h->root.got.refcount += h->gotplt_refcount;
21 h->reg_got_refcount = h->gotplt_refcount;
23 @@ -3476,7 +3478,9 @@
24 continue;
26 h->needs_plt = 1;
27 - h->plt.refcount++;
28 + /* If the symbol is forced local, the refcount is unavailable. */
29 + if (h->plt.refcount != -1)
30 + h->plt.refcount++;
31 break;
33 case R_CRIS_8: