cris-pr16044.patch 1.2 KB

123456789101112131415161718192021222324252627282930313233
  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;
  6. /* A GOTPLT reloc, when activated, is supposed to be included into
  7. - the PLT refcount. */
  8. + the PLT refcount, when the symbol isn't set-or-forced local. */
  9. BFD_ASSERT (h->gotplt_refcount == 0
  10. + || h->root.plt.refcount == -1
  11. || h->gotplt_refcount <= h->root.plt.refcount);
  12. /* If nobody wanted a GOTPLT with this symbol, we're done. */
  13. @@ -2741,6 +2742,7 @@
  14. srelgot = elf_hash_table (info)->srelgot;
  15. /* Put accurate refcounts there. */
  16. + BFD_ASSERT (h->root.got.refcount >= 0);
  17. h->root.got.refcount += h->gotplt_refcount;
  18. h->reg_got_refcount = h->gotplt_refcount;
  19. @@ -3476,7 +3478,9 @@
  20. continue;
  21. h->needs_plt = 1;
  22. - h->plt.refcount++;
  23. + /* If the symbol is forced local, the refcount is unavailable. */
  24. + if (h->plt.refcount != -1)
  25. + h->plt.refcount++;
  26. break;
  27. case R_CRIS_8: