e32tools/elf2e32/source/pl_elfrelocation.h
changeset 0 044383f39525
equal deleted inserted replaced
-1:000000000000 0:044383f39525
       
     1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // Implementation of the Class ElfRelocation for the elf2e32 tool
       
    15 // @internalComponent
       
    16 // @released
       
    17 // 
       
    18 //
       
    19 
       
    20 #if !defined(_PL_ELFRELOCATION_H_)
       
    21 #define _PL_ELFRELOCATION_H_
       
    22 
       
    23 #include "pl_common.h"
       
    24 
       
    25 class DllSymbol;
       
    26 class ElfExecutable;
       
    27 
       
    28 /**
       
    29 This class is for Elf relocation.
       
    30 
       
    31 @internalComponent
       
    32 @released
       
    33 */
       
    34 class ElfRelocation
       
    35 {
       
    36 
       
    37 public:
       
    38 	ElfRelocation(ElfExecutable *aElfExec, PLMemAddr32 aAddr, PLUINT32 aAddend, PLUINT32 aIndex, PLUCHAR aRelType, Elf32_Rel* aRel);
       
    39 	virtual ~ElfRelocation();
       
    40 
       
    41 	static bool ValidRelocEntry(PLUCHAR aType);
       
    42 	static ElfRelocation* NewRelocEntry( ElfExecutable *aElfExec, PLMemAddr32 aAddr, \
       
    43 		PLUINT32 aAddend, PLUINT32 aIndex, PLUCHAR aRelType,\
       
    44 		void* aRel, bool aImportRel);
       
    45 
       
    46 	virtual bool IsImportRelocation() =0;
       
    47 	virtual void Add() = 0;
       
    48 
       
    49 	PLMemAddr32 iAddr;
       
    50 	PLUINT32	iAddend;
       
    51 	PLUINT32	iSymNdx;
       
    52 	PLUCHAR		iRelType;
       
    53 	Elf32_Rel	*iRel;
       
    54 	Elf32_Sym	*iSymbol;
       
    55 	ElfExecutable *iElfExec;
       
    56 	Elf32_Phdr	*iSegment;
       
    57 	ESegmentType iSegmentType;
       
    58 };
       
    59 
       
    60 
       
    61 
       
    62 
       
    63 #endif // !defined(_PL_ELFRELOCATION_H_)