Function descriptors, etc. (was Re: [parisc-linux] userspace function pointers in the kernel)

Alan Modra alan@linuxcare.com.au
Thu, 14 Sep 2000 11:22:10 +1100 (EST)


On 13 Sep 2000, David Huggins-Daines wrote:

> Reasons why the IA-64 scheme is better:
>[snip]

Hrmm, you've clearly had more time than I thinking about dynamic linker
issues.  :-)  My scheme of having the linker allocate space for the ld.so
structures necessary to generate unique function pointers can still
work;  It's just that plabels need a full struct hppa_fptr in addition
to our normal plt slot, rather than the measely single word I gave you.
This could have been accomplished simply by changing PLABEL_PLT_ENTRY_SIZE
to 20, and then ld.so wouldn't need those extra mmaps.

However, I guess we should go with what you have David - the time saved by
having the linker allocate space isn't huge, and in fact we might not even
need to mmap since ld.so has 256 fptr slots pre-allocated.

I just ran the following, and found libc.so only needs 63 global fptrs.

readelf -r libc.so | grep PLABEL \
| sed -e 's/.*R_PARISC/R_PARISC/' -e '/PLABEL      /d' -e 's/ *+.*//' \
| sort | uniq

Alan
-- 
Linuxcare.  Support for the Revolution.