e32tools/elf2e32/source/pl_elfexports.h
author Mike Kinghan <mikek@symbian.org>
Wed, 04 Aug 2010 12:07:55 +0100
changeset 27 3a31ca4b29c4
parent 2 39c28ec933dd
permissions -rwxr-xr-x
1) Latest fix for bug 2979 - [GCCE] elf2e32 --dump generates RVCT assembly. Implements Stefan Karlsson's comment #21 2) Merges William Robert's elf2e32 patch re. bug 3359, changset buildtools 77c47a56e1f7 3) Fixes a Windows/Linux path-delimiter bug in romnibus.pl

// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
// All rights reserved.
// This component and the accompanying materials are made available
// under the terms of "Eclipse Public License v1.0"
// which accompanies this distribution, and is available
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
//
// Initial Contributors:
// Nokia Corporation - initial contribution.
//
// Contributors:
//
// Description:
// Implementation of the Class ElfExports for the elf2e32 tool
// @internalComponent
// @released
// 
//

#if !defined(_PL_ELFEXPORTS_H_)
#define _PL_ELFEXPORTS_H_

#include "pl_common.h"
#include <vector>
#include <functional>
#include <algorithm>

using std::vector;
using std::binary_function;

class ElfExecutable;
class DllSymbol;
class Symbol;

/**
This class is for exports coming from elf file.
(Corresponding to the exported symbols defined in the given DLL. These exports are filtered
by individual targets as per their requirements(relating to class impedimenta). While 
processing these exports, they are also to update the ordinal numbers before these exports
are written into the dso file.
@internalComponent
@released
*/
class ElfExports
{

public:
	typedef std::vector<DllSymbol*>	ExportList;

	
	struct PtrELFExportNameCompare : 
		binary_function<const Symbol *, const Symbol *, bool>
	{
		bool operator()(const Symbol * lhs, const Symbol * rhs) const;
	};

	struct PtrELFExportOrdinalCompare : 
		binary_function<const Symbol *, const Symbol *, bool>
	{
		bool operator()(const Symbol * lhs, const Symbol * rhs) const;
	};

	struct PtrELFExportNameCompareUpdateAttributes : 
		binary_function<const Symbol *, const Symbol *, bool>
	{
		bool operator()(const Symbol * lhs, const Symbol * rhs) const;
	};
	

	ElfExports();
	~ElfExports();
	
	bool ValidExportP(ElfExecutable * aExecutable, DllSymbol * aSym);
	void FilterExports();
	DllSymbol* Add(char *aDll, ElfExecutable * aExecutable, DllSymbol *aSym);
	void Add(char *aDll, DllSymbol *aSym);
	void Sort();
	void ExportsFilteredP(bool aExportsFilteredP) 
	{
		iExportsFilteredP = aExportsFilteredP;
	}
	bool ExportsFilteredP() {return iExportsFilteredP;} 

	char* DllName();
	ExportList& GetExports(bool) ;
	ExportList& GetExportsInOrdinalOrder();
	size_t GetNumExports();
	ExportList iFilteredExports;

private:
	ExportList	iExportList;
	char		*iDllName;
	bool iSorted;
	bool iExportsFilteredP;
};




#endif // !defined(_PL_ELFEXPORTS_H_)