toolsandutils/e32tools/elf2e32/source/filedump.cpp
author William Roberts <williamr@symbian.org>
Tue, 06 Jul 2010 16:56:48 +0100
branchGCC_SURGE
changeset 61 b376866b09e6
parent 60 5a90ee674b42
child 65 5bf94ed61975
permissions -rw-r--r--
Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
60
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
     1
// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
     2
// All rights reserved.
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
     3
// This component and the accompanying materials are made available
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
     4
// under the terms of "Eclipse Public License v1.0"
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
     5
// which accompanies this distribution, and is available
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
     7
//
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
     8
// Initial Contributors:
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
     9
// Nokia Corporation - initial contribution.
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
    10
//
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
    11
// Contributors:
61
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
    12
// Mike Kinghan, mikek@symbian.org, for Symbian Foundation, 2010 
60
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
    13
//
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
    14
// Description:
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
    15
// FileDump Operations of elf2e32 tool to dump E32Image and generate ASM File.
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
    16
// @internalComponent
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
    17
// @released
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
    18
// 
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
    19
//
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
    20
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
    21
#include "pl_common.h"
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
    22
#include "filedump.h"
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
    23
#include "e32imagefile.h"
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
    24
#include "h_utl.h"
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
    25
#include "deffile.h"
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
    26
#include "errorhandler.h"
61
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
    27
#include <cstdio>
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
    28
#include <cassert>
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
    29
60
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
    30
/**
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
    31
Constructor for class FileDump
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
    32
@param aParameterListInterface - Instance of class ParameterListInterface
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
    33
@internalComponent
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
    34
@released
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
    35
*/
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
    36
FileDump::FileDump(ParameterListInterface* aParameterListInterface) : UseCaseBase(aParameterListInterface)
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
    37
{
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
    38
}
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
    39
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
    40
/**
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
    41
Destructor for class FileDump
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
    42
@internalComponent
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
    43
@released
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
    44
*/
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
    45
FileDump::~FileDump()
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
    46
{
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
    47
}
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
    48
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
    49
/**
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
    50
Execute Function for the File Dump. It dumps E32 image or generate ASM file based on the
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
    51
file dump options
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
    52
@return 0 on success, otherwise throw error 
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
    53
@internalComponent
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
    54
@released
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
    55
*/
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
    56
int FileDump::Execute()
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
    57
{
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
    58
	if(iParameterListInterface->FileDumpOption() && iParameterListInterface->E32OutOption() && iParameterListInterface->DefFileInOption()) //DumpAsm
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
    59
	{
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
    60
		if(!(iParameterListInterface->DumpOptions() & EDumpAsm))
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
    61
			throw InvalidArgumentError(INVALIDARGUMENTERROR,(!iParameterListInterface->FileDumpSubOptions()?"":iParameterListInterface->FileDumpSubOptions()) ,"--dump");
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
    62
		if(iParameterListInterface->DumpOptions() & 31)
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
    63
			throw InvalidArgumentError(INVALIDARGUMENTERROR,(!iParameterListInterface->FileDumpSubOptions()?"":iParameterListInterface->FileDumpSubOptions()),"--dump");
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
    64
		if(!iParameterListInterface->E32ImageOutput())
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
    65
			throw ParameterParserError(NOREQUIREDOPTIONERROR,"--output");
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
    66
		if(!iParameterListInterface->DefInput())
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
    67
			throw ParameterParserError(NOREQUIREDOPTIONERROR,"--definput");
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
    68
61
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
    69
		GenerateAsmFile();
60
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
    70
	}
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
    71
	else
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
    72
	{
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
    73
		if(!iParameterListInterface->E32Input())
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
    74
			throw ParameterParserError(NOREQUIREDOPTIONERROR,"--e32input");
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
    75
		if(iParameterListInterface->DumpOptions() & EDumpAsm )
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
    76
			throw InvalidArgumentError(INVALIDARGUMENTERROR,iParameterListInterface->FileDumpSubOptions() ,"--dump");
61
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
    77
		DumpE32Image();
60
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
    78
	}
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
    79
	return 0;
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
    80
}
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
    81
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
    82
/**
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
    83
Function to generate ASM File.
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
    84
@param afileName - ASM File name
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
    85
@return 0 on success, otherwise throw error 
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
    86
@internalComponent
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
    87
@released
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
    88
*/
61
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
    89
int FileDump::GenerateAsmFile() //DumpAsm
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
    90
{
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
    91
	EAsmDialect asmDialect = iParameterListInterface->AsmDialect();
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
    92
	switch(asmDialect)
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
    93
	{
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
    94
	case EGas:
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
    95
		return GenerateGasAsmFile();
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
    96
	case EArmas:
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
    97
		return GenerateArmasAsmFile();
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
    98
	default:
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
    99
		assert(false);
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
   100
	}
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
   101
	return 0;
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
   102
}
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
   103
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
   104
/**
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
   105
Function to generate an RVCT armas ASM File.
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
   106
@param afileName - ASM File name
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
   107
@return 0 on success, otherwise throw error 
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
   108
@internalComponent
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
   109
@released
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
   110
*/
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
   111
int FileDump::GenerateArmasAsmFile()
60
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   112
{
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   113
	DefFile *iDefFile = new DefFile();
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   114
	SymbolList *aSymList;
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   115
	aSymList = iDefFile->ReadDefFile(iParameterListInterface->DefInput());
61
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
   116
	char const *afileName = iParameterListInterface->E32ImageOutput(); 
60
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   117
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   118
	FILE *fptr;
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   119
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   120
	if((fptr=fopen(afileName,"w"))==NULL)
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   121
	{
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   122
		throw FileError(FILEOPENERROR,(char*)afileName);
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   123
	}
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   124
	else
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   125
	{
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   126
		SymbolList::iterator aItr = aSymList->begin();
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   127
		SymbolList::iterator last = aSymList->end();
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   128
		Symbol *aSym;
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   129
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   130
		while( aItr != last)
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   131
		{
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   132
			aSym = *aItr;
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   133
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   134
			if(aSym->Absent())
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   135
			{
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   136
				aItr++;
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   137
				continue;
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   138
			}
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   139
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   140
			fputs("\tIMPORT ",fptr);
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   141
			fputs(aSym->SymbolName(),fptr);
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   142
			//Set the visibility of the symbols as default."DYNAMIC" option is
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   143
			//added to remove STV_HIDDEN visibility warnings generated by every 
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   144
			//export during kernel build 
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   145
			fputs(" [DYNAMIC]", fptr);
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   146
			fputs("\n",fptr);
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   147
			aItr++;
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   148
		}
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   149
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   150
        // Create a directive section that instructs the linker to make all listed
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   151
        // symbols visible.
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   152
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   153
        fputs("\n AREA |.directive|, READONLY, NOALLOC\n\n",fptr);
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   154
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   155
        fputs("\tDCB \"#<SYMEDIT>#\\n\"\n", fptr);
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   156
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   157
		aItr = aSymList->begin();
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   158
		while (aItr != last)
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   159
		{
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   160
			aSym = *aItr;
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   161
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   162
			if ( aSym->Absent() )
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   163
			{
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   164
				aItr++;
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   165
				continue;
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   166
			}
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   167
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   168
            // Example:
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   169
            //  DCB "EXPORT __ARM_ll_mlass\n"
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   170
			fputs("\tDCB \"EXPORT ",fptr);
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   171
			fputs(aSym->SymbolName(),fptr);
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   172
			fputs("\\n\"\n", fptr);
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   173
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   174
			aItr++;
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   175
		}
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   176
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   177
		fputs("\n END\n",fptr);
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   178
		fclose(fptr);
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   179
	}
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   180
	return 0;
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   181
}
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   182
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   183
/**
61
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
   184
Function to generate a GNU as ASM File.
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
   185
@param afileName - ASM File name
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
   186
@return 0 on success, otherwise throw error 
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
   187
@internalComponent
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
   188
@released
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
   189
*/
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
   190
int FileDump::GenerateGasAsmFile()
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
   191
{
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
   192
	DefFile *iDefFile = new DefFile();
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
   193
	SymbolList *aSymList;
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
   194
	aSymList = iDefFile->ReadDefFile(iParameterListInterface->DefInput());
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
   195
	char const *afileName = iParameterListInterface->E32ImageOutput(); 
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
   196
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
   197
	FILE *fptr;
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
   198
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
   199
	if((fptr=fopen(afileName,"w"))==NULL)
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
   200
	{
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
   201
		throw FileError(FILEOPENERROR,(char*)afileName);
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
   202
	}
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
   203
	else
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
   204
	{
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
   205
		SymbolList::iterator aItr = aSymList->begin();
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
   206
		SymbolList::iterator last = aSymList->end();
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
   207
		Symbol *aSym;
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
   208
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
   209
		while( aItr != last)
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
   210
		{
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
   211
			aSym = *aItr;
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
   212
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
   213
			if(aSym->Absent())
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
   214
			{
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
   215
				aItr++;
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
   216
				continue;
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
   217
			}
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
   218
			fputs("\t.common ",fptr);
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
   219
			fputs(aSym->SymbolName(),fptr);
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
   220
			fputs(" 4\n",fptr);
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
   221
			aItr++;
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
   222
		}
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
   223
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
   224
		fclose(fptr);
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
   225
	}
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
   226
	return 0;
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
   227
}
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
   228
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
   229
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
   230
/**
60
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   231
Function to Dump E32 Image.
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   232
@param afileName - E32 Image File name
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   233
@return 1 on success, otherwise throw error 
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   234
@internalComponent
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   235
@released
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   236
*/
61
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
   237
int FileDump::DumpE32Image()
60
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   238
{
61
b376866b09e6 Update from sftools/dev/build/e32tools/elf2e32 and revise fix for bug 2979
William Roberts <williamr@symbian.org>
parents: 60
diff changeset
   239
	char const *afileName = iParameterListInterface->E32Input(); 
60
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   240
	E32ImageFile *aE32Imagefile=new E32ImageFile();
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   241
	TInt result = aE32Imagefile->Open(afileName);
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   242
	
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   243
	if (result > 0)
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   244
		return 1;
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   245
	else if (result == KErrCorrupt || result == KErrNotSupported)
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   246
	{
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   247
		throw InvalidE32ImageError(INVALIDE32IMAGEERROR, (char *)afileName);
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   248
	}
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   249
	else if (result != 0)
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   250
	{
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   251
		throw FileError(FILEREADERROR, (char *)afileName);
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   252
	}
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   253
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   254
	int dumpOptions=iParameterListInterface->DumpOptions();
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   255
	
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   256
	aE32Imagefile->Dump((TText*)afileName, dumpOptions);
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   257
	delete aE32Imagefile;
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   258
	return KErrNone;
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   259
}
5a90ee674b42 Reinstate elf2e32, so that we can change it more easily in GCC_SURGE builds
William Roberts <williamr@symbian.org>
parents:
diff changeset
   260