emitElfStatic-ppc64.C File Reference

#include <cstdlib>
#include <cstdio>
#include <cassert>
#include <iostream>
#include <set>
#include <map>
#include <sstream>
#include "emitElfStatic.h"
#include "Symtab.h"
#include "Symbol.h"
#include "Archive.h"
#include "Object.h"
#include "Region.h"
#include "debug.h"
#include "common/h/arch-power.h"

Go to the source code of this file.

Defines

#define UNKNOWN_ADDRESS_WIDTH_ASSERT   "An unknown address width was encountered, can't continue"

Functions

unsigned int setBits (unsigned int target, unsigned int pos, unsigned int len, unsigned int value)
unsigned long setBits64 (unsigned long target, unsigned int pos, unsigned int len, unsigned long value)
static bool computeCtorDtorAddress (relocationEntry &rel, Offset globalOffset, LinkMap &lmap, string &errMsg, Offset &symbolOffset)
static const string DTOR_NAME (".dtors")
static const string CTOR_NAME (".ctors")
static const string TOC_NAME (".toc")

Variables

static const unsigned PPC32_WIDTH = 4
static const unsigned PPC64_WIDTH = 8
static const Elf64_Word X86_HEADER = 0xffffffff
static const Elf64_Word X86_TRAILER = 0x00000000
static const Elf64_Xword X86_64_HEADER = 0xffffffffffffffffULL
static const Elf64_Xword X86_64_TRAILER = 0x0000000000000000ULL
static const Offset GOT_RESERVED_SLOTS = 0

Define Documentation

#define UNKNOWN_ADDRESS_WIDTH_ASSERT   "An unknown address width was encountered, can't continue"

Definition at line 109 of file emitElfStatic-ppc64.C.


Function Documentation

static bool computeCtorDtorAddress ( relocationEntry rel,
Offset  globalOffset,
LinkMap lmap,
string &  errMsg,
Offset &  symbolOffset 
) [static]

Given a relocation, determines if the relocation corresponds to a .ctors or .dtors table that requires special consideration. Modifies the passed symbol offset to point to the right table, if applicable.

rel The relocation entry to examine globalOffset The offset of the linked code (used for symbol offset calculation) lmap Holds information about .ctors/.dtors tables errMsg Set on error symbolOffset Modified by this routine to contain the offset of the table

Returns true, if there are no errors including the case where the relocation entry doesn't reference the .ctors/.dtors tables.

Definition at line 133 of file emitElfStatic-ppc64.C.

References Dyninst::SymtabAPI::LinkMap::ctorRegionOffset, Dyninst::SymtabAPI::LinkMap::dtorRegionOffset, Dyninst::SymtabAPI::Region::getMemOffset(), Dyninst::SymtabAPI::relocationEntry::name(), Dyninst::SymtabAPI::LinkMap::newCtorRegions, Dyninst::SymtabAPI::LinkMap::newDtorRegions, Dyninst::SymtabAPI::LinkMap::originalCtorRegion, Dyninst::SymtabAPI::LinkMap::originalDtorRegion, rewrite_printf(), Dyninst::SymtabAPI::SYMTAB_CTOR_LIST_REL, and Dyninst::SymtabAPI::SYMTAB_DTOR_LIST_REL.

static const string CTOR_NAME ( ".ctors"   )  [static]
static const string DTOR_NAME ( ".dtors"   )  [static]
unsigned int setBits ( unsigned int  target,
unsigned int  pos,
unsigned int  len,
unsigned int  value 
)

Definition at line 67 of file emitElfStatic-ppc64.C.

References rewrite_printf().

unsigned long setBits64 ( unsigned long  target,
unsigned int  pos,
unsigned int  len,
unsigned long  value 
)

Definition at line 90 of file emitElfStatic-ppc64.C.

static const string TOC_NAME ( ".toc"   )  [static]

Variable Documentation

const Offset GOT_RESERVED_SLOTS = 0 [static]

Definition at line 65 of file emitElfStatic-ppc64.C.

const unsigned PPC32_WIDTH = 4 [static]

Definition at line 57 of file emitElfStatic-ppc64.C.

const unsigned PPC64_WIDTH = 8 [static]

Definition at line 58 of file emitElfStatic-ppc64.C.

const Elf64_Xword X86_64_HEADER = 0xffffffffffffffffULL [static]

Definition at line 62 of file emitElfStatic-ppc64.C.

const Elf64_Xword X86_64_TRAILER = 0x0000000000000000ULL [static]

Definition at line 63 of file emitElfStatic-ppc64.C.

const Elf64_Word X86_HEADER = 0xffffffff [static]

Definition at line 60 of file emitElfStatic-ppc64.C.

const Elf64_Word X86_TRAILER = 0x00000000 [static]

Definition at line 61 of file emitElfStatic-ppc64.C.

All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 12 Jul 2013 for SymtabAPI by  doxygen 1.6.1