]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit - ld/ChangeLog-2015
PowerPC non-PIC to PIC editing for protected var access
authorAlan Modra <amodra@gmail.com>
Tue, 31 Mar 2015 23:29:46 +0000 (09:59 +1030)
committerAlan Modra <amodra@gmail.com>
Tue, 7 Apr 2015 13:30:07 +0000 (23:00 +0930)
commitd3e454b956b16d31998fec65a2508256e6357194
tree8b6ee54cb49bcdd984c9df244ce6cfc225d7f496
parentd9b67d9f4127191679c743d1f47d2421d6dcede7
PowerPC non-PIC to PIC editing for protected var access

This is a linker-only solution to the incompatibility between shared
library protected visibility variables and using .dynbss and copy
relocs for non-PIC access to shared library variables.

bfd/
* elf32-ppc.c (struct ppc_elf_link_hash_entry): Add has_addr16_ha
and has_addr16_lo.  Make has_sda_refs a bitfield.
(ppc_elf_check_relocs): Set new flags.
(ppc_elf_link_hash_table_create): Update default_params.
(ppc_elf_adjust_dynamic_symbol): Clear protected_def in cases
where we won't be making .dynbss entries or editing code.  Set
params->pic_fixup when we'll edit code for protected var access.
(allocate_dynrelocs): Allocate got entry for edited code and
discard dyn_relocs.
(struct ppc_elf_relax_info): Add picfixup_size.
(ppc_elf_relax_section): Rename struct one_fixup to struct
one_branch_fixup.  Rename fixups to branch_fixups.  Size space for
pic fixups.
(ppc_elf_relocate_section): Edit non-PIC accessing protected
visibility variables to PIC.  Don't emit dyn_relocs for code
we've edited.
* elf32-ppc.h (struct ppc_elf_params): Add pic_fixup.
ld/
* emultempl/ppc32elf.em: Handle --no-pic-fixup.
(params): Init new field.
(ppc_before_allocation): Enable relaxation for pic_fixup.
bfd/ChangeLog
bfd/elf32-ppc.c
bfd/elf32-ppc.h
ld/ChangeLog
ld/emultempl/ppc32elf.em