xtensa: fix relaxation of undefined weak references in shared objects
authorMax Filippov <jcmvbkbc@gmail.com>
Sun, 22 Jul 2018 20:52:28 +0000 (13:52 -0700)
committerMax Filippov <jcmvbkbc@gmail.com>
Mon, 23 Jul 2018 19:02:53 +0000 (12:02 -0700)
commit5d3a462f05cba5b0c0c96de899b84fb84155c760
treeef4b1467df8ea2d90c3d39ec9addf6690efbef04
parent01bcaf636ad0b1d5fe44a21917ec900af86072a8
xtensa: fix relaxation of undefined weak references in shared objects

The change c451bb34ae8b ("xtensa: don't emit dynamic relocation for weak
undefined symbol") didn't properly handle shrinking of relocation
sections due to coalescing of references to a dynamic undefined weak
symbol in a shared object, which resulted in the following assertion
failure in ld when linking uClibc-ng libthread_db for xtensa:

  BFD (GNU Binutils) 2.31 internal error, aborting at elf32-xtensa.c:3269
  in elf_xtensa_finish_dynamic_sections

Shrink dynamic relocations section for dynamic undefined weak symbols
when linking a shared object.

bfd/
2018-07-23  Max Filippov  <jcmvbkbc@gmail.com>

* elf32-xtensa.c (shrink_dynamic_reloc_sections): Shrink dynamic
relocations section for dynamic undefined weak symbols when
linking a shared object.
bfd/ChangeLog
bfd/elf32-xtensa.c