From e59a1001222d853f0517c7e974bb51589ba86710 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Fri, 20 Sep 2019 12:21:50 +0930 Subject: PowerPC64, error on unsupported dynamic relocation This patch corrects the set of dynamic relocations recognised by gold as supported by glibc, and teaches ld.bfd to report an error similar to the gold error. Note that ld --noinhibit-exec can be used to produce an output, supporting older ld with newer glibc if the set of supported glibc dynamic relocations changes. bfd/ * elf64-ppc.c (ppc64_glibc_dynamic_reloc): New function. (ppc64_elf_relocate_section): Error if emitting unsupported dynamic relocations. gold/ * powerpc.cc (Target_powerpc::Scan::check_non_pic): Move REL24 to 32-bit supported. --- gold/ChangeLog | 5 +++++ gold/powerpc.cc | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'gold') diff --git a/gold/ChangeLog b/gold/ChangeLog index 9e45c0fb079..8ec7014b2a9 100644 --- a/gold/ChangeLog +++ b/gold/ChangeLog @@ -1,3 +1,8 @@ +2019-09-20 Alan Modra + + * powerpc.cc (Target_powerpc::Scan::check_non_pic): Move REL24 + to 32-bit supported. + 2019-09-18 Simon Marchi * testsuite/Makefile.in: Re-generate. diff --git a/gold/powerpc.cc b/gold/powerpc.cc index e69ce192e36..ad35095ccd5 100644 --- a/gold/powerpc.cc +++ b/gold/powerpc.cc @@ -7355,7 +7355,6 @@ Target_powerpc::Scan::check_non_pic(Relobj* object, case elfcpp::R_POWERPC_ADDR14_BRTAKEN: case elfcpp::R_POWERPC_ADDR14_BRNTAKEN: case elfcpp::R_POWERPC_REL32: - case elfcpp::R_POWERPC_REL24: case elfcpp::R_POWERPC_TPREL16: case elfcpp::R_POWERPC_TPREL16_LO: case elfcpp::R_POWERPC_TPREL16_HI: @@ -7404,6 +7403,7 @@ Target_powerpc::Scan::check_non_pic(Relobj* object, { // These are the relocation types supported only on 32-bit. // ??? glibc ld.so doesn't need to support these. + case elfcpp::R_POWERPC_REL24: case elfcpp::R_POWERPC_DTPREL16: case elfcpp::R_POWERPC_DTPREL16_LO: case elfcpp::R_POWERPC_DTPREL16_HI: -- cgit v1.2.3-65-gdbad