aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-ppc.h
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2015-04-01 09:59:46 +1030
committerAlan Modra <amodra@gmail.com>2015-04-07 23:00:07 +0930
commitd3e454b956b16d31998fec65a2508256e6357194 (patch)
tree8b6ee54cb49bcdd984c9df244ce6cfc225d7f496 /bfd/elf32-ppc.h
parentd9b67d9f4127191679c743d1f47d2421d6dcede7 (diff)
downloadgdb-d3e454b956b16d31998fec65a2508256e6357194.zip
gdb-d3e454b956b16d31998fec65a2508256e6357194.tar.gz
gdb-d3e454b956b16d31998fec65a2508256e6357194.tar.bz2
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.
Diffstat (limited to 'bfd/elf32-ppc.h')
-rw-r--r--bfd/elf32-ppc.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/bfd/elf32-ppc.h b/bfd/elf32-ppc.h
index 2feeec9..8eb8fcb 100644
--- a/bfd/elf32-ppc.h
+++ b/bfd/elf32-ppc.h
@@ -44,6 +44,10 @@ struct ppc_elf_params
/* Avoid execution falling into new page. */
int ppc476_workaround;
unsigned int pagesize_p2;
+
+ /* The bfd backend detected a non-PIC reference to a protected symbol
+ defined in a shared library. */
+ int pic_fixup;
};
void ppc_elf_link_params (struct bfd_link_info *, struct ppc_elf_params *);