26package org.jau.sys.elf;
28import static org.jau.sys.elf.IOUtils.readBytes;
30import java.io.IOException;
31import java.io.RandomAccessFile;
32import java.nio.ByteBuffer;
34import org.jau.sys.Debug;
35import org.jau.sys.MachineDataInfo;
36import org.jau.sys.PlatformTypes.ABIType;
37import org.jau.sys.PlatformTypes.CPUType;
38import org.jau.sys.PlatformTypes.OSType;
60 static final boolean DEBUG =
Debug.
debug(
"Platform");
186 public static final short EM_SH = 42;
235 public static final short EM_PJ = 91;
247 public static final short EM_CR = 103;
263 public static final short EM_CE = 119;
292 public static final short EM_RX = 173;
320 private final byte[] E_ident;
327 public final MachineDataInfo.StaticConfig
machDesc;
348 ElfHeaderPart1(
final OSType osType,
final RandomAccessFile in)
throws IllegalArgumentException, IOException {
351 readBytes (in, buf, 0, buf.length);
352 final ByteBuffer eh1Bytes = ByteBuffer.wrap(buf, 0, buf.length);
355 E_ident =
raw.
getE_ident(0,
new byte[Ehdr_p1.getE_identArrayLength()]);
357 throw new IllegalArgumentException(
"Buffer is not an ELF Header");
430 throw new IllegalArgumentException(
"CPUType and ABIType could not be determined");
504 default: encS =
"NON";
break;
509 case ET_REL: typeS =
"reloc";
break;
510 case ET_EXEC: typeS =
"exec";
break;
511 case ET_DYN: typeS =
"shared";
break;
512 case ET_CORE: typeS =
"core";
break;
513 default: typeS =
"none";
break;
Helper routines for logging and debugging.
static final boolean debug(final String subcomponent)
static StaticConfig guessStaticMachineDataInfo(final PlatformTypes.OSType osType, final PlatformTypes.CPUType cpuType)
ByteBuffer getE_ident()
Getter for native field: CType['char *', size [fixed false, lnx64 16], [array*1]],...
short getE_type()
Getter for native field: CType['uint16_t', size [fixed true, lnx64 2], [int]].
short getE_machine()
Getter for native field: CType['uint16_t', size [fixed true, lnx64 2], [int]].