relocationEntry-elf-ppc32.C

Go to the documentation of this file.
00001 /*
00002  * See the dyninst/COPYRIGHT file for copyright information.
00003  * 
00004  * We provide the Paradyn Tools (below described as "Paradyn")
00005  * on an AS IS basis, and do not warrant its validity or performance.
00006  * We reserve the right to update, modify, or discontinue this
00007  * software at any time.  We shall have no obligation to supply such
00008  * updates or modifications or any other form of support to you.
00009  * 
00010  * By your use of Paradyn, you understand and agree that we (or any
00011  * other person or entity with proprietary rights in Paradyn) are
00012  * under no obligation to provide either maintenance services,
00013  * update services, notices of latent defects, or correction of
00014  * defects for Paradyn.
00015  * 
00016  * This library is free software; you can redistribute it and/or
00017  * modify it under the terms of the GNU Lesser General Public
00018  * License as published by the Free Software Foundation; either
00019  * version 2.1 of the License, or (at your option) any later version.
00020  * 
00021  * This library is distributed in the hope that it will be useful,
00022  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00023  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00024  * Lesser General Public License for more details.
00025  * 
00026  * You should have received a copy of the GNU Lesser General Public
00027  * License along with this library; if not, write to the Free Software
00028  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
00029  */
00030 
00031 /* Functions of the relocationEntry class specific to PPC ELF */
00032 #include "Symtab.h"
00033 #include "Serialization.h"
00034 #include "annotations.h"
00035 #include <elf.h>
00036 
00037 const char* relocationEntry::relType2Str(unsigned long r, unsigned /*addressWidth*/) {
00038     switch(r) {
00039         CASE_RETURN_STR(R_PPC_NONE);
00040         CASE_RETURN_STR(R_PPC_ADDR32);
00041         CASE_RETURN_STR(R_PPC_ADDR24);
00042         CASE_RETURN_STR(R_PPC_ADDR16);
00043         CASE_RETURN_STR(R_PPC_ADDR16_LO);
00044         CASE_RETURN_STR(R_PPC_ADDR16_HI);
00045         CASE_RETURN_STR(R_PPC_ADDR16_HA);
00046         CASE_RETURN_STR(R_PPC_ADDR14);
00047         CASE_RETURN_STR(R_PPC_ADDR14_BRTAKEN);
00048         CASE_RETURN_STR(R_PPC_ADDR14_BRNTAKEN);
00049         CASE_RETURN_STR(R_PPC_REL24);
00050         CASE_RETURN_STR(R_PPC_REL14);
00051         CASE_RETURN_STR(R_PPC_REL14_BRTAKEN);
00052         CASE_RETURN_STR(R_PPC_REL14_BRNTAKEN);
00053         CASE_RETURN_STR(R_PPC_GOT16);
00054         CASE_RETURN_STR(R_PPC_GOT16_LO);
00055         CASE_RETURN_STR(R_PPC_GOT16_HI);
00056         CASE_RETURN_STR(R_PPC_GOT16_HA);
00057         CASE_RETURN_STR(R_PPC_PLTREL24);
00058         CASE_RETURN_STR(R_PPC_COPY);
00059         CASE_RETURN_STR(R_PPC_GLOB_DAT);
00060         CASE_RETURN_STR(R_PPC_JMP_SLOT);
00061         CASE_RETURN_STR(R_PPC_RELATIVE);
00062         CASE_RETURN_STR(R_PPC_LOCAL24PC);
00063         CASE_RETURN_STR(R_PPC_UADDR32);
00064         CASE_RETURN_STR(R_PPC_UADDR16);
00065         CASE_RETURN_STR(R_PPC_REL32);
00066         CASE_RETURN_STR(R_PPC_PLT32);
00067         CASE_RETURN_STR(R_PPC_PLTREL32);
00068         CASE_RETURN_STR(R_PPC_PLT16_LO);
00069         CASE_RETURN_STR(R_PPC_PLT16_HI);
00070         CASE_RETURN_STR(R_PPC_PLT16_HA);
00071         CASE_RETURN_STR(R_PPC_SDAREL16);
00072         CASE_RETURN_STR(R_PPC_SECTOFF);
00073         CASE_RETURN_STR(R_PPC_SECTOFF_LO);
00074         CASE_RETURN_STR(R_PPC_SECTOFF_HI);
00075         CASE_RETURN_STR(R_PPC_SECTOFF_HA);
00076         CASE_RETURN_STR(R_PPC_TLS);
00077         CASE_RETURN_STR(R_PPC_DTPMOD32);
00078         CASE_RETURN_STR(R_PPC_TPREL16);
00079         CASE_RETURN_STR(R_PPC_TPREL16_LO);
00080         CASE_RETURN_STR(R_PPC_TPREL16_HI);
00081         CASE_RETURN_STR(R_PPC_TPREL16_HA);
00082         CASE_RETURN_STR(R_PPC_TPREL32);
00083         CASE_RETURN_STR(R_PPC_DTPREL16);
00084         CASE_RETURN_STR(R_PPC_DTPREL16_LO);
00085         CASE_RETURN_STR(R_PPC_DTPREL16_HI);
00086         CASE_RETURN_STR(R_PPC_DTPREL16_HA);
00087         CASE_RETURN_STR(R_PPC_DTPREL32);
00088         CASE_RETURN_STR(R_PPC_GOT_TLSGD16);
00089         CASE_RETURN_STR(R_PPC_GOT_TLSGD16_LO);
00090         CASE_RETURN_STR(R_PPC_GOT_TLSGD16_HI);
00091         CASE_RETURN_STR(R_PPC_GOT_TLSGD16_HA);
00092         CASE_RETURN_STR(R_PPC_GOT_TLSLD16);
00093         CASE_RETURN_STR(R_PPC_GOT_TLSLD16_LO);
00094         CASE_RETURN_STR(R_PPC_GOT_TLSLD16_HI);
00095         CASE_RETURN_STR(R_PPC_GOT_TLSLD16_HA);
00096         CASE_RETURN_STR(R_PPC_GOT_TPREL16);
00097         CASE_RETURN_STR(R_PPC_GOT_TPREL16_LO);
00098         CASE_RETURN_STR(R_PPC_GOT_TPREL16_HI);
00099         CASE_RETURN_STR(R_PPC_GOT_TPREL16_HA);
00100         CASE_RETURN_STR(R_PPC_GOT_DTPREL16);
00101         CASE_RETURN_STR(R_PPC_GOT_DTPREL16_LO);
00102         CASE_RETURN_STR(R_PPC_GOT_DTPREL16_HI);
00103         CASE_RETURN_STR(R_PPC_GOT_DTPREL16_HA);
00104 #if defined(R_PPC_NUM)
00105         CASE_RETURN_STR(R_PPC_NUM);
00106 #endif
00107         CASE_RETURN_STR(R_PPC_EMB_NADDR32);
00108         CASE_RETURN_STR(R_PPC_EMB_NADDR16);
00109         CASE_RETURN_STR(R_PPC_EMB_NADDR16_LO);
00110         CASE_RETURN_STR(R_PPC_EMB_NADDR16_HI);
00111         CASE_RETURN_STR(R_PPC_EMB_NADDR16_HA);
00112         CASE_RETURN_STR(R_PPC_EMB_SDAI16);
00113         CASE_RETURN_STR(R_PPC_EMB_SDA2I16);
00114         CASE_RETURN_STR(R_PPC_EMB_SDA2REL);
00115         CASE_RETURN_STR(R_PPC_EMB_SDA21);
00116         CASE_RETURN_STR(R_PPC_EMB_MRKREF);
00117         CASE_RETURN_STR(R_PPC_EMB_RELSEC16);
00118         CASE_RETURN_STR(R_PPC_EMB_RELST_LO);
00119         CASE_RETURN_STR(R_PPC_EMB_RELST_HI);
00120         CASE_RETURN_STR(R_PPC_EMB_RELST_HA);
00121         CASE_RETURN_STR(R_PPC_EMB_BIT_FLD);
00122         CASE_RETURN_STR(R_PPC_EMB_RELSDA);
00123         CASE_RETURN_STR(R_PPC_DIAB_SDA21_LO);
00124         CASE_RETURN_STR(R_PPC_DIAB_SDA21_HI);
00125         CASE_RETURN_STR(R_PPC_DIAB_SDA21_HA);
00126         CASE_RETURN_STR(R_PPC_DIAB_RELSDA_LO);
00127         CASE_RETURN_STR(R_PPC_DIAB_RELSDA_HI);
00128         CASE_RETURN_STR(R_PPC_DIAB_RELSDA_HA);
00129 #ifdef R_PPC_REL16
00130         // Older versions of elf.h may not have these defined.
00131         CASE_RETURN_STR(R_PPC_REL16);
00132         CASE_RETURN_STR(R_PPC_REL16_LO);
00133         CASE_RETURN_STR(R_PPC_REL16_HI);
00134         CASE_RETURN_STR(R_PPC_REL16_HA);
00135 #endif
00136         CASE_RETURN_STR(R_PPC_TOC16);
00137         default:
00138             return "?";
00139     }
00140 }
00141 
00142 SYMTAB_EXPORT unsigned long relocationEntry::getGlobalRelType(unsigned /*addressWidth*/, Symbol *) {
00143     return R_PPC_GLOB_DAT;
00144 }
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 12 Jul 2013 for SymtabAPI by  doxygen 1.6.1