Where is the body of the textio package?
There is no VHDL implementation. Instead, the implementation of the textio package is simulator specific. Think of it as "implemented in C" rather than implemented in VHDL.