Robert, do you want to write a Wiki page, maybe called, simply, "glibc symbols" or something similar?
i would be happy to
help with writing a wiki page, however my knowledge of glibc symbols is pretty much summed up in what has been presented here. i am far from an expert, and proceeded mostly through trial-and-error hacking away at a problem i had a hunch should be solvable. the major breakthrough actually occurred when
another forum member emailed that he had added
__libc_start_main to the library
libdl.so where it
did not belong. it was from there that i guessed what was going on - that when the glibc developers (as of glibc 2.34) merged the functionality of
libdl.so into
libc.so they had to leave a 'back door' for older binaries to continue working, in the form of a placeholder
libdl.so that simply 'handed symbols on' to the new expanded
libc.so.
now that we know what is possible, much more widespread testing is needed. we need to discover the limitations introduced with unversioned symbols, and look at ways to catch any resulting errors at run-time. this requires cooperation from the experts - the FPC developers. they know the inner workings of FPC's RTL far better than anyone else, and the
how and
why of the RTL's use of libc functions.
there is also the interesting question of: why are libc functions so widely bound to using
EXTERNAL? certainly it makes for simple one-line code, but could one not equally well use a combination of
dlopen('libc.so.6', flags) and
dlsym()? in one fell swoop this could considerably shrink the list of symbols in a binary's Dynamic Symbol Table to... just three (
__libc_start_main,
dlopen, and
dlsym).
cheers,
rob :-)