package com.oracle.truffle.llvm.parser.elf;
public final class {
private final short ;
private final short ;
private final int ;
private final long ;
private final long ;
private final long ;
private final int ;
private final short ;
private final short ;
private final short ;
private final short ;
private final short ;
private final short ;
private (short type, short machine, int version, long entry, long phoff, long shoff, int flags, short ehsize, short phentsize, short phnum, short shentsize, short shnum,
short shstrndx) {
this.type = type;
this.machine = machine;
this.version = version;
this.entry = entry;
this.phoff = phoff;
this.shoff = shoff;
this.flags = flags;
this.ehsize = ehsize;
this.phentsize = phentsize;
this.phnum = phnum;
this.shentsize = shentsize;
this.shnum = shnum;
this.shstrndx = shstrndx;
}
public short () {
return type;
}
public short () {
return machine;
}
public long () {
return entry;
}
public long () {
return phoff;
}
public long () {
return shoff;
}
public int () {
return flags;
}
public short () {
return ehsize;
}
public short () {
return phentsize;
}
public short () {
return phnum;
}
public short () {
return shentsize;
}
public short () {
return shnum;
}
public short () {
return shstrndx;
}
public int () {
return version;
}
public static ElfHeader (ElfReader buffer) {
if (buffer.is64Bit()) {
return readHeader64(buffer);
} else {
return readHeader32(buffer);
}
}
private static ElfHeader (ElfReader buffer) {
short type = buffer.getShort();
short machine = buffer.getShort();
int version = buffer.getInt();
long entry = buffer.getInt();
long phoff = buffer.getInt();
long shoff = buffer.getInt();
int flags = buffer.getInt();
short ehsize = buffer.getShort();
short phentsize = buffer.getShort();
short phnum = buffer.getShort();
short shentsize = buffer.getShort();
short shnum = buffer.getShort();
short shstrndx = buffer.getShort();
return new ElfHeader(type, machine, version, entry, phoff, shoff, flags, ehsize, phentsize, phnum, shentsize, shnum, shstrndx);
}
private static ElfHeader (ElfReader buffer) {
short type = buffer.getShort();
short machine = buffer.getShort();
int version = buffer.getInt();
long entry = buffer.getLong();
long phoff = buffer.getLong();
long shoff = buffer.getLong();
int flags = buffer.getInt();
short ehsize = buffer.getShort();
short phentsize = buffer.getShort();
short phnum = buffer.getShort();
short shentsize = buffer.getShort();
short shnum = buffer.getShort();
short shstrndx = buffer.getShort();
return new ElfHeader(type, machine, version, entry, phoff, shoff, flags, ehsize, phentsize, phnum, shentsize, shnum, shstrndx);
}
}