emitElfStatic-ppc32.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"

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)
static bool computeCtorDtorAddress (relocationEntry &rel, Offset globalOffset, LinkMap &lmap, string &errMsg, Offset &symbolOffset)
static const string CTOR_NAME (".ctors")
static const string DTOR_NAME (".dtors")

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

Define Documentation

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

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 107 of file emitElfStatic-ppc32.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.

Referenced by Dyninst::SymtabAPI::emitElfStatic::archSpecificRelocation().

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 
)

Variable Documentation

const unsigned PPC32_WIDTH = 4 [static]
const unsigned PPC64_WIDTH = 8 [static]
const Elf64_Xword X86_64_HEADER = 0xffffffffffffffffULL [static]
const Elf64_Xword X86_64_TRAILER = 0x0000000000000000ULL [static]
const Elf64_Word X86_HEADER = 0xffffffff [static]
const Elf64_Word X86_TRAILER = 0x00000000 [static]
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 12 Jul 2013 for SymtabAPI by  doxygen 1.6.1