Open64 (mfef90, whirl2f, and IR tools)  TAG: version-openad; SVN changeset: 916
xlate.h
Go to the documentation of this file.
00001 /*
00002 
00003   Copyright (C) 2000, 2001 Silicon Graphics, Inc.  All Rights Reserved.
00004 
00005   This program is free software; you can redistribute it and/or modify it
00006   under the terms of version 2 of the GNU General Public License as
00007   published by the Free Software Foundation.
00008 
00009   This program is distributed in the hope that it would be useful, but
00010   WITHOUT ANY WARRANTY; without even the implied warranty of
00011   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
00012 
00013   Further, this software is distributed without any warranty that it is
00014   free of the rightful claim of any third person regarding infringement 
00015   or the like.  Any license provided herein, whether implied or 
00016   otherwise, applies only to this software file.  Patent licenses, if 
00017   any, provided herein do not apply to combinations of this program with 
00018   other software, or any other product whatsoever.  
00019 
00020   You should have received a copy of the GNU General Public License along
00021   with this program; if not, write the Free Software Foundation, Inc., 59
00022   Temple Place - Suite 330, Boston MA 02111-1307, USA.
00023 
00024   Contact information:  Silicon Graphics, Inc., 1600 Amphitheatre Pky,
00025   Mountain View, CA 94043, or:
00026 
00027   http://www.sgi.com
00028 
00029   For further information regarding this notice, see:
00030 
00031   http://oss.sgi.com/projects/GenInfo/NoticeExplan
00032 
00033 */
00034 
00035 
00036 #ifndef _CMPLRS_XLATE_H
00037 #define _CMPLRS_XLATE_H
00038 /*
00039     xlate.h
00040 
00041 
00042     Address translation table.
00043 
00044     Version 1 refers to the tables created by IRIX6.2 and MIPSpro7
00045         pixie and cord.
00046 
00047     Version 2 refers to the tables created by later versions.
00048 
00049     For type definitions, see elf.h, dwarf.h, libdwarf.h
00050 
00051     For a functional definition see <libXlate.h>
00052 
00053 */
00054 #ifdef __cplusplus
00055 extern "C" {
00056 #endif
00057 
00058 #ifndef _XLATE_TABLEKIND_DEF
00059 #define _XLATE_TABLEKIND_DEF
00060 typedef enum xlate_tablekind_e {
00061                 xlate_tk_general,
00062                 xlate_tk_preserve_size,
00063                 xlate_tk_preserve_order
00064 } xlate_tablekind;
00065 #endif
00066 
00067 /* hd_version: version 1 magic numbers */
00068 #define XLATE_TB_MAIN_V1                0x1
00069 #define XLATE_TB_COPY_V1                0x2
00070 #define XLATE_TB_DEBUG_V1               0x3 /* unused */
00071 #define XLATE_TB_OLD_V1                 0x4 /* unused */
00072 
00073 /* hd_version: version 2 magic numbers */
00074 #define XLATE_TB_32_V2                     0x5 /* 32 bit table */
00075 #define XLATE_TB_64_V2                     0x6 /* 64 bit table */
00076 
00077 
00078 /* 
00079   Version 1 header struct actually written on 
00080   disk for each data block. 
00081   Same format used for 32 and 64 bit applications.
00082 */
00083 typedef struct xlate_blockheader_v1_s {
00084     Elf32_Word          bh_first_new_addr;
00085     Elf32_Word          bh_first_old_addr;
00086     Elf32_Word          bh_num_entries;
00087 } xlate_blockheader_v1;
00088 
00089 /*
00090   Version  1 section header for the actual table. 
00091   Written on disk. Both 64 and 32 bit applications.
00092 */
00093 typedef struct xlate_header_v1_s {
00094 
00095     /* Version number/ magic number.  */
00096     Elf32_Word          hd_version; /* 1,2,3, or 4 */
00097 
00098         /* what kind of table this header represents.  */
00099     Elf32_Word          hd_tablekind;
00100 
00101         /* Flag indicating whether object is 64-bits. */
00102     Elf32_Word          hd_is64_bit;
00103 
00104         /* Upper word of all new addresses being added. 
00105                 (zero in a 32-bit-pointer app)*/
00106     Elf32_Word          hd_upper32_bits_new;
00107 
00108         /* Upper word of all old addresses being added. 
00109                 (zero in a 32-bit-pointer app)*/
00110     Elf32_Word          hd_upper32_bits_old;
00111 
00112         /* Size of each data block in the table. */
00113     Elf32_Sword         hd_block_size;
00114 
00115         /* Number of data blocks in this table. */
00116     Elf32_Sword         hd_num_blocks;
00117 
00118         /* Number of range entries in this table. */
00119     Elf32_Sword         hd_num_entries;
00120 
00121         /* Lowest and highest of all new addresses in this table. */
00122     Elf32_Word          hd_new_addr_low;
00123     Elf32_Word          hd_new_addr_high;
00124 
00125         /* Lowest and highest of all old addresses in this table. */
00126     Elf32_Word          hd_old_addr_low;
00127     Elf32_Word          hd_old_addr_high;
00128 
00129         /* Number of bytes data was moved. */
00130     Elf32_Sword         hd_data_moved;
00131 
00132         /* 
00133             Address of First and Last instruction of 
00134             pixie (for example) startup code.  
00135             0 if no startup code present.
00136         */
00137     Elf32_Word          hd_startup_fwa;
00138     Elf32_Word          hd_startup_lwa;
00139 
00140 
00141         /* Old Text is saved in object.  value: 0 or 1*/
00142     Elf32_Word          hd_old_text_exists;
00143 
00144         /* Saved old text is in a loadable segment. value: 0 or 1 */
00145     Elf32_Word          hd_old_text_alloc;
00146 
00147         /* Size of bytes in the Register Info area. */
00148     Elf32_Word          hd_reg_info_size;
00149 } xlate_header_v1;
00150 
00151 /******* version 2 format for 32 bit pointer apps **********/
00152 
00153 typedef struct xlate_blockheader32_v2_s {
00154     Elf32_Word          bh_first_new_addr;
00155     Elf32_Word          bh_first_old_addr;
00156     Elf32_Word          bh_num_entries;
00157     Elf32_Word          bh_low_old_addr;
00158     Elf32_Word          bh_high_old_addr;
00159 } xlate_blockheader32_v2;
00160 
00161 
00162 /* data is arranged smallest to largest after version number. */
00163 typedef struct xlate_header32_v2_s {
00164 
00165     /* Version number/ magic number.  */
00166     Elf32_Word          hd_version; /* == 5 */
00167 
00168         /* what kind of table this header represents.  */
00169     unsigned char       hd_tablekind;
00170 
00171         /* Old Text is saved in object.  value: 0 or 1*/
00172     unsigned char       hd_old_text_exists;
00173 
00174         /* Saved old text is in a loadable segment. value: 0 or 1 */
00175     unsigned char       hd_old_text_alloc;
00176 
00177         /* Size of each data block in the table. */
00178     Elf32_Word          hd_block_size;
00179 
00180         /* Size of bytes in the Register Info area. */
00181     Elf32_Word          hd_reg_info_size;
00182 
00183         /* Number of data blocks in this table. */
00184     Elf32_Word          hd_num_blocks;
00185 
00186         /* Number of range entries in this table. */
00187     Elf32_Sword         hd_num_entries;
00188 
00189         /* Lowest and highest of all new addresses in this table. */
00190     Elf32_Addr          hd_new_addr_low;
00191     Elf32_Addr          hd_new_addr_high;
00192 
00193         /* Lowest highest of all old addresses in this table. */
00194     Elf32_Addr          hd_old_addr_low;
00195     Elf32_Addr          hd_old_addr_high;
00196 
00197         /* Number of bytes data was moved. */
00198     Elf32_Sword         hd_data_moved;
00199 
00200         /* 
00201             Address of First and Last instruction of 
00202             pixie (for example) startup code.  
00203             0 if no startup code present.
00204         */
00205     Elf32_Addr          hd_startup_fwa;
00206     Elf32_Addr          hd_startup_lwa;
00207 } xlate_header32_v2;
00208 
00209 /******* version 2 format for 64 bit pointer apps **********/
00210 
00211 typedef struct xlate_blockheader64_v2_s {
00212     Elf64_Addr          bh_first_new_addr;
00213     Elf64_Addr          bh_first_old_addr;
00214     Elf64_Xword         bh_num_entries;
00215     Elf64_Addr          bh_low_old_addr;
00216     Elf64_Addr          bh_high_old_addr;
00217 } xlate_blockheader64_v2;
00218 
00219 /* data is arranged smallest to largest after version number. */
00220 typedef struct xlate_header64_v2_s {
00221 
00222     /* Version number/ magic number.  */
00223     Elf32_Word          hd_version;  /* == 6 */
00224 
00225         /* what kind of table this header represents.  */
00226     unsigned char       hd_tablekind;
00227 
00228         /* Old Text is saved in object.  value: 0 or 1*/
00229     unsigned char       hd_old_text_exists;
00230 
00231         /* Saved old text is in a loadable segment. value: 0 or 1 */
00232     unsigned char       hd_old_text_alloc;
00233 
00234         /* Size of each data block in the table. */
00235     Elf32_Word          hd_block_size;
00236 
00237         /* Size of bytes in the Register Info area. */
00238     Elf32_Word          hd_reg_info_size;
00239 
00240         /* Number of data blocks in this table. */
00241     Elf64_Xword         hd_num_blocks;
00242 
00243         /* Number of range entries in this table. */
00244     Elf64_Xword         hd_num_entries;
00245 
00246         /* Lowest and highest of all new addresses in this table. */
00247     Elf64_Addr          hd_new_addr_low;
00248     Elf64_Addr          hd_new_addr_high;
00249 
00250         /* Lowest and highest of all old addresses in this table. */
00251     Elf64_Addr          hd_old_addr_low; 
00252     Elf64_Addr          hd_old_addr_high;
00253 
00254         /* Number of bytes data was moved. */
00255     Elf64_Sxword        hd_data_moved;
00256 
00257         /* 
00258             Address of First and Last instruction of 
00259             pixie (for example) startup code.  
00260             0 if no startup code present.
00261         */
00262     Elf64_Addr          hd_startup_fwa;
00263     Elf64_Addr          hd_startup_lwa;
00264 } xlate_header64_v2;
00265 
00266 
00267 #ifdef __cplusplus
00268 }
00269 #endif
00270 #endif  /* _CMPLRS_XLATE_H */
00271 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines