This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [RFC] Add IFUNC support for MIPS
- From: Richard Sandiford <richard dot sandiford at arm dot com>
- To: Faraz Shahbazker <Faraz dot Shahbazker at imgtec dot com>
- Cc: "libc-alpha\ at sourceware dot org" <libc-alpha at sourceware dot org>
- Date: Mon, 03 Aug 2015 13:41:00 +0100
- Subject: Re: [RFC] Add IFUNC support for MIPS
- Authentication-results: sourceware.org; auth=none
- References: <DCB1C42372B1674B8F912A294CCB775A71684631 at BADAG02 dot ba dot imgtec dot org> <87k2tdn5xt dot fsf at googlemail dot com>
[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