next up previous
Next: Disassembly of Other Sections Up: Implementation Details of the Previous: First Pass of Disassembly

Second Pass of Disassembly

The objective of this pass is to generate assembly language instruction from their binary counterpart. Since the address ranges of valid code have been identified in the first pass, we only need to disassemble the instructions in each address range. The instruction disassembly is carried out in the following steps. This procedure is repeated for each instruction in all address ranges. The gaps within the .text section are overlooked for the purpose of text disassembly. One possibility is to simply ignore the bytes in the gaps and change the current location counter so that it reaches the beginning of the next valid address range. However, it is possible that these gaps contain initialized data (which are not referenced by the normal methods, for instance using register indirection instead of symbols, otherwise it would have been discovered during the first pass). In such a case, ignoring them might break the intended equivalence between the relocatable object file and the generated assembly code. Therefore, we simply output bytes in the gaps as data and generate appropriate pseudo-ops to glue the code.


next up previous
Next: Disassembly of Other Sections Up: Implementation Details of the Previous: First Pass of Disassembly
Nihal chand Jain (9711113)

Fri Jan 15 11:17:08 IST 1999