[TriLUG] executable and non-executable libraries

Owen Berry oberry at trilug.org
Tue May 15 12:32:43 EDT 2007


On Tue, May 15, 2007 at 05:51:29AM -0700, Joseph Mack NA3T wrote:
> The only executable library I know about is /lib/libc.so.6 
> which when executed, will give you its specs and build info. 
> How do you make libc.so.6 executable? It needs a main()? If 
> it has a main(), how does libc.so.6 get linked to an 
> executable with a real main()?

I'm wondering if they do something funky in __libc_start_main, which is
listed when running strings on the file.

http://refspecs.freestandards.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-generic/baselib---libc-start-main-.html

"The __libc_start_main() function shall perform any necessary
initialization of the execution environment, call the main function with
appropriate arguments, and handle the return from main(). If the main()
function returns, the return value shall be passed to the exit()
function."

That's just a wild guess.

Owen



More information about the TriLUG mailing list