This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc 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: [RFC] Add IFUNC support for MIPS


[Farez, sorry for the double message]

Richard Sandiford <rdsandiford@googlemail.com> writes:
> Faraz Shahbazker <Faraz.Shahbazker@imgtec.com> writes:
>> @@ -795,8 +844,18 @@ elf_machine_got_rel (struct link_map *map, int lazy)
>>        const struct r_found_version *version __attribute__ ((unused))	  \
>>  	= vernum ? &map->l_versions[vernum[sym_index] & 0x7fff] : NULL;	  \
>>        struct link_map *sym_map;						  \
>> +      ElfW(Addr) value = 0;						  \
>>        sym_map = RESOLVE_MAP (&ref, version, reloc);			  \
>> -      ref ? sym_map->l_addr + ref->st_value : 0;			  \
>> +      if (__glibc_likely(ref != NULL))					  \
>> +	{								  \
>> +	  value = sym_map->l_addr + ref->st_value;			  \
>> +	  if (__glibc_unlikely (ELFW(ST_TYPE) (ref->st_info)		  \
>> +				== STT_GNU_IFUNC			  \
>> +				&& sym_map != map			  \
>> +				&& sym_map->l_relocated))		  \
>> +	      value = elf_ifunc_invoke (value);				  \
>> +	}								  \
>> +      value;								  \
>>      })
>
> With that change, I think we should either:
>
> (a) make STT_GNU_IFUNCs in the global GOT be a fatal error or
>
> (b) call the resolver unconditionally, without the sym_map-based checks.
>     We shouldn't resolve an IFUNC without calling the resolver.

Sorry, I misread this.  I thought it was checking the st_info of the
original symbol rather than the resolved one.

In that case I think we should do (b) -- remove the sym_map checks.

Thanks,
Richard


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