toolsandutils/e32tools/elf2e32/source/pl_elfexports.h
author mikek
Fri, 25 Jun 2010 18:24:47 +0100
branchGCC_SURGE
changeset 55 59148e28d9f6
parent 0 83f4b4db085c
child 10 d4b442d23379
permissions -rw-r--r--
1) Fix for Bug 3059 - bootstrap.mk breaks Raptor's include-path 2) Fix for Bug 3062 - bootstrap.mk mishandles vpath rules 3) Fix for Bug 3076 - [GCCE] bootstrap.mk invokes the wrong tools for gcce (strictly one half of the fix. The other half is in /kernelhwsrv/bsptemplate/asspandvariant/template_variant/bld.inf) 4) Fix for Bug 3107 - [GCCE] bootstrap.mk needs new assembler and linker commands for GCCE. 5) Fix for Bug 3109 - bootstrap.mk needs additional platform-abstraction macros for Linux/gcce builds.

// 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_)