If anyone is interested, I've written a little utility that wraps gcc and automatically creates a table of addresses to prebind with at link time. You basically change the link portion of your build to, instead of doing "gcc -dynamiclib foo bar", you do "gcc-prebind gcc -dynamiclib foo bar", and so on.

You can get it at http://ranger.befunk.com/darwin/gcc-prebind/ -- it's still a bit hacking but works. I've managed to get XFree86 and some other things prebound and it gives a bit of a speed boost to startup. As more things get prebound I expect it'll get better.

Here is the man page, for those interested in a few more details:

NAME
gcc-prebind - gcc wrapper to prebind during the linker
stage

SYNOPSIS
gcc-prebind cc -fno-exceptions -dynamiclib -install_name \
/usr/lib/libfoo.1.0.6.dylib -o libfoo.1.0.6.dylib objects.o

DESCRIPTION
gcc-prebind is a simple wrapper for GCC that will automat-
ically generate and update a table of segment offsets for
prebinding libraries at link time.

It works by taking the command-line input, scanning for
the output and/or install filename, and looking it up in a
table. If that key exists, it uses the segment address in
the table to prebind the library. If it doesn't, it links
the library, interrogates it to determine the address
size, and then picks a free segment address in the table,
and re-links a prebound library.

AUTHOR
Benjamin Reed <[EMAIL PROTECTED]>

SEE ALSO
gcc(1), ld(1), fix_prebinding(8), redo_prebinding(1),
redo_prebinding(3), update_prebinding(1), dyld(1), dyld(3)



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Fink-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/fink-devel

Reply via email to