lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> I don't fully understand how the load() function works in srlua.c,
> namely how it is able to locate the end of the executable data and
> the beginning of the Lua code, because I am not familiar with the
> structure of Unix executables.

glue just appends a Lua script to a Lua interpreter and then adds a
few data bytes at the end containing the size of the Lua script.

srlua then seeks to its end, reads the data bytes, seeks to the beginning
of the script, and loads it from there.