* powerpc.c (Target_powerpc::Scan::global): Don't emit relative

relocs against protected symbols when building 32-bit shared libs.
This commit is contained in:
Alan Modra 2012-11-30 05:01:20 +00:00
parent 40b469d719
commit 627b30b77e
2 changed files with 14 additions and 5 deletions

View File

@ -1,3 +1,8 @@
2012-11-30 Alan Modra <amodra@gmail.com>
* powerpc.c (Target_powerpc::Scan::global): Don't emit relative
relocs against protected symbols when building 32-bit shared libs.
2012-11-30 Alan Modra <amodra@gmail.com>
* powerpc.cc (Target_powerpc::make_plt_section): Add symtab

View File

@ -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;