"Fossies" - the Fresh Open Source Software Archive

Member "fasm/examples/elfexe/dynamic/elf.inc" (9 Feb 2020, 2186 Bytes) of package /linux/misc/fasm-1.73.22.tgz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) fasm source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 
    2 macro Elf32_Sym name,value,size,bind,type,other,shndx
    3 {
    4  dd name+0
    5  dd value+0
    6  dd size+0
    7  db (bind+0) shl 4 + (type+0)
    8  db other+0
    9  dw shndx+0
   10 }
   11 
   12 virtual at 0
   13  Elf32_Sym
   14  sizeof.Elf32_Sym = $
   15 end virtual
   16 
   17 macro Elf32_Rel offset,symbol,type
   18 {
   19   dd offset+0
   20   dd (symbol+0) shl 8 + (type+0)
   21 }
   22 
   23 virtual at 0
   24  Elf32_Rel
   25  sizeof.Elf32_Rel = $
   26 end virtual
   27 
   28 macro Elf32_Rela offset,symbol,type,addend
   29 {
   30   dd offset+0
   31   dd (symbol+0) shl 8 + (type+0)
   32   dd addend+0
   33 }
   34 
   35 virtual at 0
   36  Elf32_Rela
   37  sizeof.Elf32_Rela = $
   38 end virtual
   39 
   40 macro Elf64_Sym name,value,size,bind,type,other,shndx
   41 {
   42  dd name+0
   43  db (bind+0) shl 4 + (type+0)
   44  db other+0
   45  dw shndx+0
   46  dq value+0
   47  dq size+0
   48 }
   49 
   50 virtual at 0
   51  Elf64_Sym
   52  sizeof.Elf64_Sym = $
   53 end virtual
   54 
   55 macro Elf64_Rel offset,symbol,type
   56 {
   57   dq offset+0
   58   dq (symbol+0) shl 32 + (type+0)
   59 }
   60 
   61 virtual at 0
   62  Elf64_Rel
   63  sizeof.Elf64_Rel = $
   64 end virtual
   65 
   66 macro Elf64_Rela offset,symbol,type,addend
   67 {
   68   dq offset+0
   69   dq (symbol+0) shl 32 + (type+0)
   70   dq addend+0
   71 }
   72 
   73 virtual at 0
   74  Elf64_Rela
   75  sizeof.Elf64_Rela = $
   76 end virtual
   77 
   78 DT_NULL    = 0
   79 DT_NEEDED  = 1
   80 DT_HASH    = 4
   81 DT_STRTAB  = 5
   82 DT_SYMTAB  = 6
   83 DT_RELA    = 7
   84 DT_RELASZ  = 8
   85 DT_RELAENT = 9
   86 DT_STRSZ   = 10
   87 DT_SYMENT  = 11
   88 DT_REL     = 17
   89 DT_RELSZ   = 18
   90 DT_RELENT  = 19
   91 
   92 STB_LOCAL  = 0
   93 STB_GLOBAL = 1
   94 STB_WEAK   = 2
   95 
   96 STT_NOTYPE  = 0
   97 STT_OBJECT  = 1
   98 STT_FUNC    = 2
   99 STT_SECTION = 3
  100 STT_FILE    = 4
  101 
  102 R_386_NONE     = 0
  103 R_386_32       = 1
  104 R_386_PC32     = 2
  105 R_386_GOT32    = 3
  106 R_386_PLT32    = 4
  107 R_386_COPY     = 5
  108 R_386_GLOB_DAT = 6
  109 R_386_JMP_SLOT = 7
  110 R_386_RELATIVE = 8
  111 R_386_GOTOFF   = 9
  112 R_386_GOTPC    = 10
  113 
  114 R_X86_64_NONE      = 0
  115 R_X86_64_64    = 1
  116 R_X86_64_PC32      = 2
  117 R_X86_64_GOT32     = 3
  118 R_X86_64_PLT32     = 4
  119 R_X86_64_COPY      = 5
  120 R_X86_64_GLOB_DAT  = 6
  121 R_X86_64_JUMP_SLOT = 7
  122 R_X86_64_RELATIVE  = 8
  123 R_X86_64_GOTPCREL  = 9
  124 R_X86_64_32    = 10
  125 R_X86_64_32S       = 11
  126 R_X86_64_16    = 12
  127 R_X86_64_PC16      = 13
  128 R_X86_64_8     = 14
  129 R_X86_64_PC8       = 15
  130 R_X86_64_DPTMOD64  = 16
  131 R_X86_64_DTPOFF64  = 17
  132 R_X86_64_TPOFF64   = 18
  133 R_X86_64_TLSGD     = 19
  134 R_X86_64_TLSLD     = 20
  135 R_X86_64_DTPOFF32  = 21
  136 R_X86_64_GOTTPOFF  = 22
  137 R_X86_64_TPOFF32   = 23
  138 R_X86_64_PC64      = 24
  139 R_X86_64_GOTOFF64  = 25
  140 R_X86_64_GOTPC32   = 26