aboutsummaryrefslogtreecommitdiff
path: root/gold/powerpc.cc
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2012-11-30 05:01:20 +0000
committerAlan Modra <amodra@gmail.com>2012-11-30 05:01:20 +0000
commit627b30b77e95fbdbb8b3b762cd75507380f99538 (patch)
treebe97eaa3c1678ad115af5a73c438d35173bb8bf4 /gold/powerpc.cc
parent40b469d719c0c1023b5a5d8e47db4d267693ed61 (diff)
downloadgdb-627b30b77e95fbdbb8b3b762cd75507380f99538.zip
gdb-627b30b77e95fbdbb8b3b762cd75507380f99538.tar.gz
gdb-627b30b77e95fbdbb8b3b762cd75507380f99538.tar.bz2
* powerpc.c (Target_powerpc::Scan::global): Don't emit relative
relocs against protected symbols when building 32-bit shared libs.
Diffstat (limited to 'gold/powerpc.cc')
-rw-r--r--gold/powerpc.cc14
1 files changed, 9 insertions, 5 deletions
diff --git a/gold/powerpc.cc b/gold/powerpc.cc
index 0c5288f..a3bb9f2 100644
--- a/gold/powerpc.cc
+++ b/gold/powerpc.cc
@@ -3664,11 +3664,15 @@ Target_powerpc<size, big_endian>::Scan::global(
target->copy_reloc(symtab, layout, object,
data_shndx, output_section, gsym, reloc);
}
- else if (((size == 32 && r_type == elfcpp::R_POWERPC_ADDR32)
- || (size == 64 && r_type == elfcpp::R_PPC64_ADDR64))
- && (gsym->can_use_relative_reloc(false)
- || (size == 64
- && data_shndx == ppc_object->opd_shndx())))
+ else if ((size == 32
+ && r_type == elfcpp::R_POWERPC_ADDR32
+ && gsym->can_use_relative_reloc(false)
+ && !(gsym->visibility() == elfcpp::STV_PROTECTED
+ && parameters->options().shared()))
+ || (size == 64
+ && r_type == elfcpp::R_PPC64_ADDR64
+ && (gsym->can_use_relative_reloc(false)
+ || data_shndx == ppc_object->opd_shndx())))
{
Reloc_section* rela_dyn = target->rela_dyn_section(layout);
unsigned int dynrel = elfcpp::R_POWERPC_RELATIVE;