This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [GOLD][PATCH] Fix ARM backend's handling of protected symbol in a DSO


>> diff -u -u -p -r1.146 arm.cc
>> --- gold/arm.cc ? ? ? 3 Feb 2012 20:01:01 -0000 ? ? ? 1.146
>> +++ gold/arm.cc ? ? ? 14 Mar 2012 08:44:14 -0000
>> @@ -8314,7 +8314,9 @@ Target_arm<big_endian>::Scan::global(Sym
>> ? ? ? ? ? Reloc_section* rel_dyn = target->rel_dyn_section(layout);
>> ? ? ? ? ? if (gsym->is_from_dynobj()
>> ? ? ? ? ? ? ? || gsym->is_undefined()
>> - ? ? ? ? ? ? || gsym->is_preemptible())
>> + ? ? ? ? ? ? || gsym->is_preemptible()
>> + ? ? ? ? ? ? || (gsym->visibility() == elfcpp::STV_PROTECTED
>> + ? ? ? ? ? ? ? ? && parameters->options().shared()))
>> ? ? ? ? ? ? got->add_global_with_rel(gsym, GOT_TYPE_STANDARD,
>> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?rel_dyn, elfcpp::R_ARM_GLOB_DAT);
>> ? ? ? ? ? else
>
>
> Usually tests for whether to generate a dynamic reloc should check
> parameters->options().output_is_position_independent() rather than
> parameters->options().shared(). ?The difference is that the former is
> also true for -pie.

This is checking to see if the symbol is a protected symbol in a
shared library, so the test for shared() is correct, I believe. If
it's protected in a PIE, using a RELATIVE relocation here should be
fine.

-cary


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]