[PATCH 5/5] Add single-threaded path to _int_malloc

Wilco Dijkstra Wilco.Dijkstra@arm.com
Tue Oct 24 14:42:00 GMT 2017


Szabolcs Nagy wrote:

> the address of malloc must be const during the lifetime of a
> process, since it can be saved in a variable that can be later
> used as func ptr.

The application always gets the address of the fixed PLT entry, including
in a statically linked binary. So calling via a function pointer will still use
a PLT indirection. Not sure what happens inside a dynamic library itself,
but that would work fine if that gets the address of the same PLT entry
(if not then the addresses would already be different today).

Wilco

    


More information about the Libc-alpha mailing list