[PATCH v3 5/5] csu: Move static pie self relocation later [BZ #27072]
Szabolcs Nagy
szabolcs.nagy@arm.com
Thu Jan 14 17:19:27 GMT 2021
The 01/14/2021 08:26, H.J. Lu wrote:
>
> We need to make sure that there are no RELATIVE relocations before
> _dl_relocate_static_pie is called. The problems with i386 are
>
> 1. All calls to IFUNC functions must go through PLT.
> 2. Calls to hidden functions CANNOT go through PLT in PIE since
> EBX used in PIE PLT may not be set up for local calls.
>
> I think we should add a new attribute, attribute_hidden_ifunc
> which should be defined as
>
> 1. __attribute__ ((visibility ("default"))) if in PIE on i386
> 2. __attribute__ ((visibility ("hidden"))) else
>
> attribute_hidden_ifunc should be used on prototypes of all IFUNC
> functions. This is similar to NO_HIDDEN_EXTERN_FUNC_IN_PIE.
so is it enough to declare ifuncs with such attribute?
e.g. would it work if memcpy is default visibility
in PIE libc.a but user code is static linking that
with non-pie caller?
do we have a way to track which functions may be
defined as ifunc? should we do that manually? or add
the attribute to every extern function declaration
within the libc?
More information about the Libc-alpha
mailing list