Open64 (mfef90, whirl2f, and IR tools)  TAG: version-openad; SVN changeset: 916
em_elf.h File Reference
#include <stdio.h>
#include <elf.h>
Include dependency graph for em_elf.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define Roundup(_value, _align)   ((_value+(_align-1)) & (~(_align-1)))

Typedefs

typedef struct section_info SCNINFO
typedef struct section_infopSCNINFO

Functions

INT Em_Begin_File (char *ofilename, BOOL update, BOOL elf64, BOOL old_abi, INT isa, BOOL big_endian, BOOL pic, BOOL cpic, BOOL xgot, BOOL gp_groups, BOOL elf_trace)
void Em_End_File (void)
pSCNINFO Em_New_Section (char *scnname, Elf64_Word scntype, Elf64_Xword scnflags, Elf64_Xword scnentsize, Elf64_Xword scnalign)
void Em_End_Section (pSCNINFO scninfo)
void Em_New_Data_Buffer (pSCNINFO scninfo, Elf64_Xword size, INT alignment)
Elf64_Word Em_Add_New_Symbol (char *symname, Elf64_Addr symvalue, Elf64_Xword symsize, unsigned char symbind, unsigned char symtype, unsigned char symother, Elf64_Half symshndx)
Elf64_Word Em_Add_New_Undef_Symbol (char *symname, unsigned char symbind, unsigned char symtype, unsigned char symother)
Elf64_Word Em_Add_New_Common_Symbol (char *symname, Elf64_Xword symsize, unsigned char symbind, unsigned char symother)
Elf64_Word Em_Add_New_Weak_Symbol (char *weakname, unsigned char symtype, unsigned char symother, Elf64_Word symindex)
void Em_Define_Symbol (Elf64_Word symindex, Elf64_Addr symvalue, Elf64_Xword symsize, pSCNINFO scninfo)
void Em_Undefine_Symbol (Elf64_Word symindex)
void Em_Set_Symbol_Binding (Elf64_Word symindex, unsigned char symbind)
Elf64_Addr Em_Get_Symbol_Value (Elf64_Word symindex)
char * Em_Get_Symbol_Name (Elf64_Word symindex)
void Em_Add_New_Rel (Elf64_Word symindex, unsigned char reltype, Elf64_Addr reloffset, pSCNINFO scninfo)
void Em_Add_New_Rela (Elf64_Word symindex, unsigned char reltype, Elf64_Addr reloffset, Elf64_Sxword addend, pSCNINFO scninfo)
void Em_Add_New_Composite_Rela (Elf64_Rela *preloc, pSCNINFO scninfo)
void Em_Change_Section_Origin (pSCNINFO scn, Elf64_Xword scn_ofst)
void Em_Change_Section_Alignment (pSCNINFO scn, Elf64_Word scn_align)
Elf64_Xword Em_Add_Bytes_To_Scn (pSCNINFO scninfo, void *input_buf, Elf64_Xword length, Elf64_Word align)
Elf64_Xword Em_Add_Zeros_To_Scn (pSCNINFO scninfo, Elf64_Word length, Elf64_Word align)
Elf64_Xword Em_Add_Address_To_Scn (pSCNINFO scninfo, Elf64_Word symindex, Elf64_Sxword addend, Elf64_Word align)
Elf64_Xword Em_Add_Displacement_To_Scn (pSCNINFO scninfo, Elf64_Word symindex, Elf64_Sxword addend, Elf64_Word align)
void Em_Set_sh_link (pSCNINFO scn, Elf64_Word link)
void Em_Set_sh_info (pSCNINFO scn, Elf64_Word info)
size_t Em_Get_Section_Index (pSCNINFO scn)
Elf64_Xword Em_Get_Section_Offset (pSCNINFO scn)
char * Em_Get_Section_Name (pSCNINFO scn)
Elf64_Word Em_Get_Section_Type (pSCNINFO scn)
Elf64_Word Em_Get_Section_Flags (pSCNINFO scn)
Elf64_Word Em_Get_Section_Entsize (pSCNINFO scn)
Elf64_Word Em_Get_Section_Align (pSCNINFO scn)
Elf64_Word Em_Get_Section_Info (pSCNINFO scn)
Elf64_Word Em_Create_Section_Symbol (pSCNINFO scninfo)
void Em_Write_Reginfo (Elf64_Addr gprvalue, Elf64_Word gprmask, Elf64_Word fprmask, BOOL pure_abi)
void Em_Add_New_Event (Elf64_Word ev_kind, Elf64_Word ev_ofst, Elf64_Word operand1, Elf64_Word operand2, Elf64_Word operand3, pSCNINFO scn)
void Em_Add_New_Content (Elf64_Word con_kind, Elf64_Xword con_ofst, Elf64_Word operand1, Elf64_Word operand2, pSCNINFO scn)
void Em_Add_New_Option (Elf32_Byte option_kind, Elf32_Section option_section, Elf32_Word option_info, void *buffer, Elf32_Byte length)
void Em_Add_New_Interface (Elf64_Word length, Elf64_Byte *data)
void Em_Add_Comment (char *s)
void Em_End_Unwind (FILE *trace_file, pSCNINFO text_scn)
void Em_Cleanup_Unwind (void)

Variables

INT GP_DISP
pSCNINFO Symtab_Info
BOOL Sixtyfour_Bit
pSCNINFO Options_Scn

Define Documentation

#define Roundup (   _value,
  _align 
)    ((_value+(_align-1)) & (~(_align-1)))

Definition at line 62 of file em_elf.h.

Referenced by Em_Add_Bytes_To_Scn(), Em_Add_New_Option(), and Em_New_Data_Buffer().


Typedef Documentation

typedef struct section_info * pSCNINFO

Definition at line 64 of file em_elf.h.

typedef struct section_info SCNINFO

Definition at line 64 of file em_elf.h.


Function Documentation

void Em_Add_Comment ( char *  s)

Definition at line 1077 of file em_elf.cxx.

References ELF_COMMENT, Em_Add_Bytes_To_Scn(), Em_New_Section(), INCLUDE_STAMP, NULL, object_file_name, s, and SHT_PROGBITS.

Here is the call graph for this function:

Elf64_Xword Em_Add_Displacement_To_Scn ( pSCNINFO  scninfo,
Elf64_Word  symindex,
Elf64_Sxword  addend,
Elf64_Word  align 
)

Definition at line 279 of file em_elf.cxx.

References Em_Add_Bytes_To_Scn(), Em_Add_New_Rel(), and R_SCN_DISP.

Here is the call graph for this function:

Elf64_Word Em_Add_New_Common_Symbol ( char *  symname,
Elf64_Xword  symsize,
unsigned char  symbind,
unsigned char  symother 
)
void Em_Add_New_Content ( Elf64_Word  con_kind,
Elf64_Xword  con_ofst,
Elf64_Word  operand1,
Elf64_Word  operand2,
pSCNINFO  scn 
)

Definition at line 159 of file targ_em_elf.cxx.

void Em_Add_New_Event ( Elf64_Word  ev_kind,
Elf64_Word  ev_ofst,
Elf64_Word  operand1,
Elf64_Word  operand2,
Elf64_Word  operand3,
pSCNINFO  scn 
)

Definition at line 145 of file targ_em_elf.cxx.

void Em_Add_New_Interface ( Elf64_Word  length,
Elf64_Byte data 
)

Definition at line 1058 of file em_elf.cxx.

References ELF32_FSZ_WORD, Em_Add_Bytes_To_Scn(), Em_New_Section(), Em_Set_sh_link(), Interface_Scn, NULL, SCNINFO_index, SECT_IFACE_NAME, SHF_NOSTRIP, and SHT_IRIX_IFACE.

Here is the call graph for this function:

void Em_Add_New_Option ( Elf32_Byte  option_kind,
Elf32_Section  option_section,
Elf32_Word  option_info,
void *  buffer,
Elf32_Byte  length 
)
void Em_Add_New_Rela ( Elf64_Word  symindex,
unsigned char  reltype,
Elf64_Addr  reloffset,
Elf64_Sxword  addend,
pSCNINFO  scninfo 
)
Elf64_Word Em_Add_New_Undef_Symbol ( char *  symname,
unsigned char  symbind,
unsigned char  symtype,
unsigned char  symother 
)

Definition at line 902 of file em_elf.cxx.

References Em_Add_New_Symbol(), and SHN_UNDEF.

Here is the call graph for this function:

Elf64_Word Em_Add_New_Weak_Symbol ( char *  weakname,
unsigned char  symtype,
unsigned char  symother,
Elf64_Word  symindex 
)

Definition at line 917 of file em_elf.cxx.

References EC_Elf_Idx, Em_Add_New_Symbol(), ErrMsg(), SCNINFO_buffer, SCNINFO_size, Sixtyfour_Bit, and STB_WEAK.

Here is the call graph for this function:

Elf64_Xword Em_Add_Zeros_To_Scn ( pSCNINFO  scninfo,
Elf64_Word  length,
Elf64_Word  align 
)

Definition at line 208 of file em_elf.cxx.

References buf, EC_No_Mem, Em_Add_Bytes_To_Scn(), ErrMsg(), free(), and NULL.

Referenced by Em_Add_Address_To_Scn().

Here is the call graph for this function:

INT Em_Begin_File ( char *  ofilename,
BOOL  update,
BOOL  elf64,
BOOL  old_abi,
INT  isa,
BOOL  big_endian,
BOOL  pic,
BOOL  cpic,
BOOL  xgot,
BOOL  gp_groups,
BOOL  elf_trace 
)
void Em_Change_Section_Alignment ( pSCNINFO  scn,
Elf64_Word  scn_align 
)

Definition at line 152 of file em_elf.cxx.

References SCNINFO_align.

void Em_Change_Section_Origin ( pSCNINFO  scn,
Elf64_Xword  scn_ofst 
)

Definition at line 145 of file em_elf.cxx.

References SCNINFO_offset.

void Em_Cleanup_Unwind ( void  )

Definition at line 181 of file targ_em_elf.cxx.

References unwind_cleanup().

Here is the call graph for this function:

void Em_Define_Symbol ( Elf64_Word  symindex,
Elf64_Addr  symvalue,
Elf64_Xword  symsize,
pSCNINFO  scninfo 
)
void Em_End_File ( void  )

Definition at line 1295 of file em_elf.cxx.

References Elf_Ptr, Em_End_Section(), Interface_Scn, NULL, print_elf_error(), and Update_Data().

Here is the call graph for this function:

void Em_End_Section ( pSCNINFO  scninfo)

Definition at line 1341 of file em_elf.cxx.

References Em_End_Section(), free(), NULL, SCNINFO_contents, SCNINFO_events, SCNINFO_relainfo, SCNINFO_relinfo, Update_Addr_Reset_Size(), and Update_Data().

Referenced by Em_Dwarf_Write_Scns(), Em_End_File(), and Em_End_Section().

Here is the call graph for this function:

void Em_End_Unwind ( FILE *  trace_file,
pSCNINFO  text_scn 
)

Definition at line 170 of file targ_em_elf.cxx.

References unwind_dump2ascii(), unwind_dump2elf(), and unwind_process().

Here is the call graph for this function:

Definition at line 507 of file em_elf.cxx.

References SCNINFO_scnptr, and Sixtyfour_Bit.

Definition at line 496 of file em_elf.cxx.

References SCNINFO_scnptr, and Sixtyfour_Bit.

Definition at line 485 of file em_elf.cxx.

References SCNINFO_scnptr, and Sixtyfour_Bit.

Definition at line 442 of file em_elf.cxx.

References SCNINFO_index.

Referenced by Em_Dwarf_Find_Dwarf_Scn(), and setup_new_section_for_dwarf().

Definition at line 518 of file em_elf.cxx.

References SCNINFO_scnptr, and Sixtyfour_Bit.

Definition at line 449 of file em_elf.cxx.

References SCNINFO_offset.

Definition at line 474 of file em_elf.cxx.

References SCNINFO_scnptr, and Sixtyfour_Bit.

char* Em_Get_Symbol_Name ( Elf64_Word  symindex)

Definition at line 815 of file em_elf.cxx.

References EC_Elf_Idx, ErrMsg(), Index_To_String(), SCNINFO_buffer, SCNINFO_size, and Sixtyfour_Bit.

Here is the call graph for this function:

void Em_New_Data_Buffer ( pSCNINFO  scninfo,
Elf64_Xword  size,
INT  alignment 
)
pSCNINFO Em_New_Section ( char *  scnname,
Elf64_Word  scntype,
Elf64_Xword  scnflags,
Elf64_Xword  scnentsize,
Elf64_Xword  scnalign 
)
void Em_Set_Symbol_Binding ( Elf64_Word  symindex,
unsigned char  symbind 
)

Definition at line 762 of file em_elf.cxx.

References EC_Elf_Idx, ELF32_ST_INFO, ELF32_ST_TYPE, ELF64_ST_INFO, ELF64_ST_TYPE, ErrMsg(), SCNINFO_buffer, SCNINFO_size, Sixtyfour_Bit, Elf32_Sym::st_info, and Elf64_Sym::st_info.

Here is the call graph for this function:

void Em_Undefine_Symbol ( Elf64_Word  symindex)

Definition at line 737 of file em_elf.cxx.

References EC_Elf_Idx, ErrMsg(), SCNINFO_buffer, SCNINFO_size, SHN_UNDEF, Sixtyfour_Bit, Elf32_Sym::st_shndx, and Elf64_Sym::st_shndx.

Here is the call graph for this function:

void Em_Write_Reginfo ( Elf64_Addr  gprvalue,
Elf64_Word  gprmask,
Elf64_Word  fprmask,
BOOL  pure_abi 
)

Definition at line 79 of file targ_em_elf.cxx.

References EC_Assertion, Em_Add_New_Option(), EM_IA_64, ErrMsg(), Get_Elf_Target_Machine(), ODK_IA64_REGINFO, Elf_IA64_RegInfo::ri_gp_value, SHN_UNDEF, and Sixtyfour_Bit.

Here is the call graph for this function:


Variable Documentation

Definition at line 75 of file targ_em_elf.cxx.

Definition at line 92 of file em_elf.cxx.

Referenced by Em_Add_New_Option().

Definition at line 82 of file em_elf.cxx.

Referenced by setup_new_section_for_dwarf().

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines