Open64 (mfef90, whirl2f, and IR tools)  TAG: version-openad; SVN changeset: 916
sections.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 /*
00037  * target-specific info about elf sections.
00038  */
00039 
00040 #ifndef sections_INCLUDED 
00041 #define sections_INCLUDED
00042 
00043 #include "defs.h"
00044 #include "symtab.h"
00045 
00046 /*
00047  * data layout keeps a table of predefined sections,
00048  * with info about the sections.
00049  */
00050 typedef UINT16 SECTION_IDX;
00051 
00052 enum _sec_kind {
00053   _SEC_UNKNOWN =0,
00054   _SEC_TEXT,
00055   _SEC_DATA,
00056   _SEC_SDATA,
00057   _SEC_LDATA,
00058   _SEC_RDATA,
00059   _SEC_SRDATA,
00060   _SEC_LIT4,
00061   _SEC_LIT8,
00062   _SEC_LIT16,
00063   _SEC_BSS,
00064   _SEC_SBSS,
00065   _SEC_LBSS,
00066   _SEC_GOT,
00067   _SEC_CPLINIT,
00068   _SEC_EH_REGION,
00069   _SEC_EH_REGION_SUPP,
00070   _SEC_DISTR_ARRAY,
00071   _SEC_THREAD_PRIVATE_FUNCS,
00072   _SEC_INDEX_MAX
00073   };
00074 
00075 typedef struct {
00076   SECTION_IDX   id;             /* The partition ID */
00077   ST           *block;
00078   UINT32        flags;          /* elf attributes */
00079   UINT32        etype;          /* elf type */
00080   UINT32        entsize;        /* elf entsize */
00081   INT64         max_sec_size;   /* Maximum size of this section */
00082   char         *name;           /* Print name */
00083   INT32         pad_size;       /* size to pad, neg ==> post pad */
00084 } SECTION;
00085 
00086 extern SECTION Sections[_SEC_INDEX_MAX];
00087 
00088 #define SEC_id(s)               (Sections[s].id)
00089 #define SEC_block(s)            (Sections[s].block)
00090 #define SEC_flags(s)            (Sections[s].flags)
00091 #define SEC_type(s)             (Sections[s].etype)
00092 #define SEC_entsize(s)          (Sections[s].entsize)
00093 #define SEC_max_sec_size(s)     (Sections[s].max_sec_size)
00094 #define SEC_name(s)             (Sections[s].name)
00095 #define SEC_pad_size(s)         (Sections[s].pad_size)
00096 
00097 inline INT Get_Section_Elf_Flags (SECTION_IDX s)
00098 {
00099         return SEC_flags(s);
00100 }
00101 inline INT Get_Section_Elf_Type (SECTION_IDX s)
00102 {
00103         return SEC_type(s);
00104 }
00105 inline INT Get_Section_Elf_Entsize (SECTION_IDX s)
00106 {
00107         return SEC_entsize(s);
00108 }
00109 
00110 extern SECTION_IDX Corresponding_Short_Section (SECTION_IDX sec);
00111 extern BOOL SEC_is_gprel (SECTION_IDX sec);
00112 extern BOOL SEC_is_merge (SECTION_IDX sec);
00113 extern BOOL SEC_is_exec (SECTION_IDX sec);
00114 extern BOOL SEC_is_nobits (SECTION_IDX sec);
00115 
00116 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines