Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040 #ifndef sections_INCLUDED
00041 #define sections_INCLUDED
00042
00043 #include "defs.h"
00044 #include "symtab.h"
00045
00046
00047
00048
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;
00077 ST *block;
00078 UINT32 flags;
00079 UINT32 etype;
00080 UINT32 entsize;
00081 INT64 max_sec_size;
00082 char *name;
00083 INT32 pad_size;
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