예제 #1
0
void dumpSymbols(FILE *out)
{
    fprintf(out, "%s::\n", "Globals and autos");
    dumpSymbolTable(out, global, 0);
    fprintf(out, "%s::\n", "Constants");
    dumpSymbolTable(out, constants, 1);
}
예제 #2
0
  void
outputObjectFile()
{
	void	outputPartition();
	void	outputReferenceInfo();
	void	outputSymbolTableInfo();
	void	outputAbsoluteCode();
	void	outputRelocatableCode();
	void	outputReservations();
	void	outputExpressions();
	void	outputFunctions();
	void	dumpSymbolTable();
	void	enumerateAndCountSymbols();

	if (debug || emitPrint)
		printCodeBuffers();
	outputPartition();
	outputAbsoluteCode();
	if (produceLinkableObject) {
		outputPartition();
		outputRelocatableCode();
		outputPartition();
		outputReservations();
		outputPartition();
		enumerateAndCountSymbols();
		outputReferenceInfo();
		outputSymbolTableInfo();
		outputExpressions();
		outputFunctions();
	}
	if (symbolTableDumpOn)
		dumpSymbolTable();
	fclose(objectFileOutput);
}
예제 #3
0
// this is called between passes and provides the assembler the file
// pointer to use for outputing the object file
//
// it returns the number of errors seen on pass1
//
int betweenPasses(FILE *outf)
{
#if DEBUG
  fprintf(stderr, "betweenPasses called\n");
  dumpSymbolTable();
  dump_funcs( func_list );
  //dump_handler_list( handler_list );
#endif
  //verify_handler_list( handler_list );

#if PRINT_DEFINED_LABELS
  printDefinedLabels();
#endif

  // remember the file pointer to use
  fp = outf;

  // update the pass number
  currentPass = 2;

  // check if memory will overflow
  if (currentLength > 0xFFFFF)
  {
    error("program consumes more than 2^20 words");
    errorCount += 1;
  }

  // check for errors concerning addresses
  checkForAddressErrors();

  // check for errors concerning import and export
  errorCount += checkForImportExportErrors();

  // if no errors, output headers and then insymbol and outsymbol section
  if (!errorCount)
  {
    output_header();
    //outputInsymbols();
    //outputOutsymbols();
  }

  // reset currentLength for pass2
  currentLength = 0;

  return errorCount;
}