26package org.jau.sys.elf;
 
   28import org.jau.io.Buffers;
 
   29import org.jau.io.StructAccessor;
 
   30import org.jau.sys.MachineDataInfo;
 
   36  private final int mdIdx;
 
   39  private static final int[] Ehdr_p2_size = 
new int[] { 28 , 28 , 28 , 28 , 28 , 28 , 40 , 40   };
 
   40  private static final int[] e_entry_offset = 
new int[] { 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0  };
 
   42  private static final int[] e_phoff_offset = 
new int[] { 4 , 4 , 4 , 4 , 4 , 4 , 8 , 8  };
 
   44  private static final int[] e_shoff_offset = 
new int[] { 8 , 8 , 8 , 8 , 8 , 8 , 16 , 16  };
 
   46  private static final int[] e_flags_offset = 
new int[] { 12 , 12 , 12 , 12 , 12 , 12 , 24 , 24  };
 
   48  private static final int[] e_ehsize_offset = 
new int[] { 16 , 16 , 16 , 16 , 16 , 16 , 28 , 28  };
 
   50  private static final int[] e_phentsize_offset = 
new int[] { 18 , 18 , 18 , 18 , 18 , 18 , 30 , 30  };
 
   52  private static final int[] e_phnum_offset = 
new int[] { 20 , 20 , 20 , 20 , 20 , 20 , 32 , 32  };
 
   54  private static final int[] e_shentsize_offset = 
new int[] { 22 , 22 , 22 , 22 , 22 , 22 , 34 , 34  };
 
   56  private static final int[] e_shnum_offset = 
new int[] { 24 , 24 , 24 , 24 , 24 , 24 , 36 , 36  };
 
   58  private static final int[] e_shstrndx_offset = 
new int[] { 26 , 26 , 26 , 26 , 26 , 26 , 38 , 38  };
 
   62    return accessor.getBuffer();
 
 
   67    accessor.setLongAt(e_entry_offset[mdIdx], val, md.longSizeInBytes());
 
 
   73    return accessor.getLongAt(e_entry_offset[mdIdx], md.longSizeInBytes());
 
 
   78    accessor.setLongAt(e_phoff_offset[mdIdx], val, md.longSizeInBytes());
 
 
   84    return accessor.getLongAt(e_phoff_offset[mdIdx], md.longSizeInBytes());
 
 
   89    accessor.setLongAt(e_shoff_offset[mdIdx], val, md.longSizeInBytes());
 
 
   95    return accessor.getLongAt(e_shoff_offset[mdIdx], md.longSizeInBytes());
 
 
  100    accessor.setIntAt(e_flags_offset[mdIdx], val);
 
 
  106    return accessor.getIntAt(e_flags_offset[mdIdx]);
 
 
  111    accessor.setShortAt(e_ehsize_offset[mdIdx], val);
 
 
  117    return accessor.getShortAt(e_ehsize_offset[mdIdx]);
 
 
  122    accessor.setShortAt(e_phentsize_offset[mdIdx], val);
 
 
  128    return accessor.getShortAt(e_phentsize_offset[mdIdx]);
 
 
  133    accessor.setShortAt(e_phnum_offset[mdIdx], val);
 
 
  139    return accessor.getShortAt(e_phnum_offset[mdIdx]);
 
 
  144    accessor.setShortAt(e_shentsize_offset[mdIdx], val);
 
 
  150    return accessor.getShortAt(e_shentsize_offset[mdIdx]);
 
 
  155    accessor.setShortAt(e_shnum_offset[mdIdx], val);
 
 
  161    return accessor.getShortAt(e_shnum_offset[mdIdx]);
 
 
  166    accessor.setShortAt(e_shstrndx_offset[mdIdx], val);
 
 
  172    return accessor.getShortAt(e_shstrndx_offset[mdIdx]);
 
 
  176  public static int size(
final int mdIdx) {
 
  177      return Ehdr_p2_size[mdIdx];
 
 
  180  public static Ehdr_p2 
create(
final int mdIdx) {
 
 
  184  public static Ehdr_p2 
create(
final int mdIdx, 
final java.nio.ByteBuffer buf) {
 
  185      return new Ehdr_p2(mdIdx, buf);
 
 
  188  Ehdr_p2(
final int mdIdx, 
final java.nio.ByteBuffer buf) {
 
 
Utility methods allowing easy java.nio.Buffer manipulations.
static ByteBuffer newDirectByteBuffer(final int size)
Allocates a new direct ByteBuffer with the specified number of elements.
Machine data description for alignment and size onle, see com.jogamp.gluegen.
Ehdr_p2 setE_flags(final int val)
Setter for native field: CType['uint32_t', size [fixed true, lnx64 4], [int]].
Ehdr_p2 setE_shstrndx(final short val)
Setter for native field: CType['uint16_t', size [fixed true, lnx64 2], [int]].
Ehdr_p2 setE_shnum(final short val)
Setter for native field: CType['uint16_t', size [fixed true, lnx64 2], [int]].
Ehdr_p2 setE_entry(final long val)
Setter for native field: CType['ElfN_Addr' (typedef), size [fixed false, lnx64 8],...
static Ehdr_p2 create(final int mdIdx)
long getE_phoff()
Getter for native field: CType['ElfN_Off' (typedef), size [fixed false, lnx64 8], [int]].
short getE_shnum()
Getter for native field: CType['uint16_t', size [fixed true, lnx64 2], [int]].
int getE_flags()
Getter for native field: CType['uint32_t', size [fixed true, lnx64 4], [int]].
Ehdr_p2 setE_phoff(final long val)
Setter for native field: CType['ElfN_Off' (typedef), size [fixed false, lnx64 8], [int]].
static Ehdr_p2 create(final int mdIdx, final java.nio.ByteBuffer buf)
Ehdr_p2 setE_shentsize(final short val)
Setter for native field: CType['uint16_t', size [fixed true, lnx64 2], [int]].
Ehdr_p2 setE_shoff(final long val)
Setter for native field: CType['ElfN_Off' (typedef), size [fixed false, lnx64 8], [int]].
long getE_entry()
Getter for native field: CType['ElfN_Addr' (typedef), size [fixed false, lnx64 8],...
Ehdr_p2 setE_phentsize(final short val)
Setter for native field: CType['uint16_t', size [fixed true, lnx64 2], [int]].
short getE_shstrndx()
Getter for native field: CType['uint16_t', size [fixed true, lnx64 2], [int]].
static int size(final int mdIdx)
short getE_phentsize()
Getter for native field: CType['uint16_t', size [fixed true, lnx64 2], [int]].
short getE_phnum()
Getter for native field: CType['uint16_t', size [fixed true, lnx64 2], [int]].
java.nio.ByteBuffer getBuffer()
short getE_shentsize()
Getter for native field: CType['uint16_t', size [fixed true, lnx64 2], [int]].
Ehdr_p2 setE_ehsize(final short val)
Setter for native field: CType['uint16_t', size [fixed true, lnx64 2], [int]].
short getE_ehsize()
Getter for native field: CType['uint16_t', size [fixed true, lnx64 2], [int]].
long getE_shoff()
Getter for native field: CType['ElfN_Off' (typedef), size [fixed false, lnx64 8], [int]].
Ehdr_p2 setE_phnum(final short val)
Setter for native field: CType['uint16_t', size [fixed true, lnx64 2], [int]].
Static enumeration of MachineDataInfo instances used for high performance data size and alignment loo...