| OCR Text |
Show transparent to the programmer, since Dynascope determines file type automatically from the file header. The mechanisms of loading and linking are separated. They are provided by three functions: dsldobject, dsrmobject and dslink. The dsldobject function loads a named object file in the executor's state. The space needed for the object code is allocated from the heap. Two tables are built: a symbol table and a relocation table. The symbol table contains definitions of all symbols in the file. This includes imported symbols as well as exported symbols. The relocation table contains information about entries that need to be updated if a symbol value is changed. This function performs no linking. The dsldobject function removes the named object file from the executor's state. The space occupied by the file is released. If more object files have the same name, the newest version is deleted. The dslink function performs linking. It has two parameters: a file name and a symbol name. The symbol from the given file is linked into the executor's state. Old definitions of that symbol are overloaded. The relocation of that symbol in all object files is performed. In the interpreter, the internal representation of an object file is build by the loader. Each object file is represented internally in four sections (see Figure 4.4): • file information, • static data, • symbol table, • relocation information. The file information section contains the file name and the file type. The file type denotes host or hypothetical code. This is the only place in tables where these two types are distinguished. The static data section contains either hypothetical or host 73 |