Top Description Fields Constructors Methods
jogamp.common.os.elf

public Class ElfHeaderPart2

extends Object
Class Inheritance
Imports
java.io.IOException, .RandomAccessFile, java.nio.ByteBuffer, com.jogamp.common.os.Platform.ABIType, .Platform.CPUFamily, .Platform.CPUType

ELF ABI Header Part-2

Part-2 can only be read w/ knowledge of CPUType!

References:

Field Summary

Modifier and TypeField and Description
public final Platform.ABIType
public final String
cpuName

Lower case CPUType name

public final Platform.CPUType
public static final int
EF_ARM_ABI5

ARM ABI version 5.

public static final int
EF_ARM_ABI_FLOAT_HARD

Set in executable file headers (e_type = ET_EXEC or ET_DYN) to note that the executable file was built to conform to the hardware floating-point procedure-call standard.

public static final int
EF_ARM_ABI_FLOAT_SOFT

Set in executable file headers (e_type = ET_EXEC or ET_DYN) to note explicitly that the executable file was built to conform to the software floating-point procedure-call standard (the base standard).

public static final int
EF_ARM_ABIMASK

This masks an 8-bit version number, the version of the ABI to which this ELF file conforms.

public static final int
public static final int
EF_ARM_BE8

The ELF file contains BE-8 code, suitable for execution on an ARM Architecture v6 processor.

public static final int
EF_ARM_GCCMASK

Legacy code (ABI version 4 and earlier) generated by gcc-arm-xxx might use these bits.

public final ElfHeaderPart1
eh1

Public access to the elf header part-1 (CPU/ABI independent read)

public final Ehdr_p2
raw

Public access to the raw elf header part-2 (CPU/ABI dependent read)

public final SectionHeader[]
sht

Public access to the SectionHeader

Constructor Summary

AccessConstructor and Description
pack-priv
ElfHeaderPart2(final ElfHeaderPart1
ELF Header bytes
eh1
,
final RandomAccessFile in)

Method Summary

Modifier and TypeMethod and Description
public byte
getArmABI()

Returns the ARM EABI version from flags, maybe 0 if not an ARM EABI.

public byte
getArmFloatMode()

Returns the ARM EABI float mode from flags, i.e. 1 for EF_ARM_ABI_FLOAT_SOFT, 2 for EF_ARM_ABI_FLOAT_HARD or 0 for none.

public int
getArmLegacyGCCFlags()

Returns the ARM EABI legacy GCC flags, maybe 0 if not an ARM EABI or not having legacy GCC flags.

public final int
getFlags()

Returns the processor-specific flags associated with the file.

public final SectionHeader
getSectionHeader(final int type)

Returns the 1st occurence of matching SectionHeader type, or null if not exists.

public final SectionHeader
getSectionHeader(final String name)

Returns the 1st occurence of matching SectionHeader name, or null if not exists.

public final short
private static Platform.CPUType
queryCPUTypeSafe(final String cpuName)

public static ElfHeaderPart2
read(final ElfHeaderPart1 eh1, final RandomAccessFile
input stream of a binary file at position zero
in
)

Note

The input stream shall stay untouch to be able to read sections!

pack-priv final SectionHeader[]
public final String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

abiTypeback to summary
public final Platform.ABIType abiType
cpuNameback to summary
public final String cpuName

Lower case CPUType name

cpuTypeback to summary
public final Platform.CPUType cpuType
EF_ARM_ABI5back to summary
public static final int EF_ARM_ABI5

ARM ABI version 5.

EF_ARM_ABI_FLOAT_HARDback to summary
public static final int EF_ARM_ABI_FLOAT_HARD

Set in executable file headers (e_type = ET_EXEC or ET_DYN) to note that the executable file was built to conform to the hardware floating-point procedure-call standard.

Compatible with legacy (pre version 5) gcc use as EF_ARM_VFP_FLOAT.

Note

This is not used (anymore)

EF_ARM_ABI_FLOAT_SOFTback to summary
public static final int EF_ARM_ABI_FLOAT_SOFT

Set in executable file headers (e_type = ET_EXEC or ET_DYN) to note explicitly that the executable file was built to conform to the software floating-point procedure-call standard (the base standard). If both EF_ARM_ABI_FLOAT_HARD and EF_ARM_ABI_FLOAT_SOFT are clear, conformance to the base procedure-call standard is implied.

Compatible with legacy (pre version 5) gcc use as EF_ARM_SOFT_FLOAT.

Note

This is not used (anymore)

EF_ARM_ABIMASKback to summary
public static final int EF_ARM_ABIMASK

This masks an 8-bit version number, the version of the ABI to which this ELF file conforms. This ABI is version 5. A value of 0 denotes unknown conformance.

EF_ARM_ABISHIFTback to summary
public static final int EF_ARM_ABISHIFT
EF_ARM_BE8back to summary
public static final int EF_ARM_BE8

The ELF file contains BE-8 code, suitable for execution on an ARM Architecture v6 processor. This flag must only be set on an executable file.

EF_ARM_GCCMASKback to summary
public static final int EF_ARM_GCCMASK

Legacy code (ABI version 4 and earlier) generated by gcc-arm-xxx might use these bits.

eh1back to summary
public final ElfHeaderPart1 eh1

Public access to the elf header part-1 (CPU/ABI independent read)

rawback to summary
public final Ehdr_p2 raw

Public access to the raw elf header part-2 (CPU/ABI dependent read)

shtback to summary
public final SectionHeader[] sht

Public access to the SectionHeader

Constructor Detail

ElfHeaderPart2back to summary
pack-priv ElfHeaderPart2(final ElfHeaderPart1 eh1, final RandomAccessFile in) throws IllegalArgumentException, IOException
Parameters
eh1:ElfHeaderPart1

ELF Header bytes

Exceptions
IllegalArgumentException:
if the given buffer does not represent an ELF Header

Method Detail

getArmABIback to summary
public byte getArmABI()

Returns the ARM EABI version from flags, maybe 0 if not an ARM EABI.

getArmFloatModeback to summary
public byte getArmFloatMode()

Returns the ARM EABI float mode from flags, i.e. 1 for EF_ARM_ABI_FLOAT_SOFT, 2 for EF_ARM_ABI_FLOAT_HARD or 0 for none.

Note

This is not used (anymore)

getArmLegacyGCCFlagsback to summary
public int getArmLegacyGCCFlags()

Returns the ARM EABI legacy GCC flags, maybe 0 if not an ARM EABI or not having legacy GCC flags.

getFlagsback to summary
public final int getFlags()

Returns the processor-specific flags associated with the file.

getSectionHeaderback to summary
public final SectionHeader getSectionHeader(final int type)

Returns the 1st occurence of matching SectionHeader type, or null if not exists.

getSectionHeaderback to summary
public final SectionHeader getSectionHeader(final String name)

Returns the 1st occurence of matching SectionHeader name, or null if not exists.

getSizeback to summary
public final short getSize()
queryCPUTypeSafeback to summary
private static Platform.CPUType queryCPUTypeSafe(final String cpuName)
readback to summary
public static ElfHeaderPart2 read(final ElfHeaderPart1 eh1, final RandomAccessFile in) throws IOException, IllegalArgumentException

Note

The input stream shall stay untouch to be able to read sections!

Parameters
in:RandomAccessFile

input stream of a binary file at position zero

Exceptions
IOException:
if reading from the given input stream fails or less then ELF Header size bytes
IllegalArgumentException:
if the given input stream does not represent an ELF Header
readSectionHeaderTableback to summary
pack-priv final SectionHeader[] readSectionHeaderTable(final RandomAccessFile in) throws IOException, IllegalArgumentException
toStringback to summary
public final String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object

Annotations
@Override