bfd: prevent all but undef weak syms from becoming dynamic in sparc.
authorEgeyar Bagcioglu <egeyar.bagcioglu@oracle.com>
Thu, 29 Jun 2017 11:28:27 +0000 (04:28 -0700)
committerJose E. Marchesi <jose.marchesi@oracle.com>
Thu, 29 Jun 2017 11:28:27 +0000 (04:28 -0700)
commitec1acaba1381d0196c45965a7db9942b67fbd88d
tree3bd2601dff117f455a14fef8eee88b2ec9c95bcf
parentff07562f1e369b6e37eafb2a888dc48fa2453e86
bfd: prevent all but undef weak syms from becoming dynamic in sparc.

Prevent sparc backend making symbols dynamic unless they are undefined
weak. Use R_SPARC_RELATIVE for the symbols which are not dynamic in PIC.

This patch is tested on sparc64-unknown-linux-gnu, no regressions are
found.

bfd/ChangeLog:

2017-06-29  Egeyar Bagcioglu  <egeyar.bagcioglu@oracle.com>

* elfxx-sparc.c (allocate_dynrelocs): Don't make a symbol dynamic
unless it is undefined weak.
* elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Set the flag
relative_reloc to direct non-dynamic symbols to R_SPARC_RELATIVE
relocation.
* elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): If symbol
        is not dynamic in PIC, abort.
bfd/ChangeLog
bfd/elfxx-sparc.c