<< 2012-3 >>
Department of
Computer Science
 

Introduction

File Name Conventions

Object files produced by the assembler are, by convention, appended with a suffix of .preobj to distinguish them from other file types.

Object File Format

The assembler produces relocatable object files which may be linked with other object files to produce a executable binary image which can be executed by the simulation machine. The object file is split into a number of sections as displayed in the diagram below :
object file format diagram

Header

The header of the object file mainly contains version details and other properties about the file such as what the source file was called. It also contains placeholder values for base offsets used in relocation. The header can mainly be regarded as non-vital to the process of compilation but may be extended in the future.

Export Dictionary

The export dictionary contains a number of entries which explain which symbols in the object are availible for other object to use. Each entry contains the symbol name and the address of the symbol in the instruction code. This mechanism allows other object files to declare a symbol external for the linker to resolve against symbols declared as exported in other object files.

Relocation Dictionary

In order for the instruction code to be relocatable, the object file needs to know which instructions require relocation and by which method. Currently instructions which makde references to internal symbols are marked as needing relative relocation and those which reference external symbols are marked as needing absolute relocation. Partition relocation entries inform the linker which partition name an instruction uses so that the final partition number can be patched.

Partition Dictionary

The partition dictionary holds information about the partitions that should be created to service this object file. Partition parameters such as size and stride are store alongside the symbolic name of the partition. This is used in conjunction with relocation entries to patch instructions and make them use the correct partition numbers.

Instruction Code

The instruction code is a block of encoded instructions which represent the code for the object file. These instructions are in a relocateable form and not suitable for direct execution on the simulation machine. In order to create executable code, the instruction code block needs to have relocation performed on the instructions so that they address the right locations in memory and use the right partition numbers.

Constant Pool

The constant pool is a block of constant string and numeric data as specified in the constant segment of the assembly language program.
© 1995-2013 University of Bristol  |  Terms and Conditions  |  Use of Cookies
About this Page