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

public Class SectionHeader

extends Object
Class Inheritance
Imports
java.io.IOException, .RandomAccessFile, java.nio.ByteBuffer

ELF ABI Section Header

References:

Field Summary

Modifier and TypeField and Description
public final ElfHeaderPart2
eh2

Public access to the elf header

private final int
private String
public final Shdr
raw

Public access to the raw elf section header

public static final short
public static final short
public static final short
public static final short
public static final short
public static final short
public static final short
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int

Constructor Summary

AccessConstructor and Description
pack-priv
SectionHeader(final ElfHeaderPart2 eh, final byte[] buf, final int offset, final int length, final int sectionIdx)

pack-priv
SectionHeader(final ElfHeaderPart2 eh, final ByteBuffer buf, final int idx)

Method Summary

Modifier and TypeMethod and Description
public long
getFlags()

Returns the flags of this section.

public int
getIndex()

Returns the index of this section within the Elf section header table.

public String
getName()

Returns this section name, maybe null if not read.

public long
getSize()

Returns the size of this section.

public int
getType()

Returns the type of this section.

pack-priv void
initName(final Section
the SectionHeader#SHT_STRTAB section containing all strings
strS
,
final int
name offset within strS
nameOffset
)

public Section
readSection(final RandomAccessFile
file owning the section
in
)

Returns the Section referenced w/ this section header

public Section
readSection(final RandomAccessFile
file owning the section
in
,
final byte[]
destination buffer
b
,
final int
offset in destination buffer
b_off
,
final int
requested read length in bytes, which shall be ≤ than this section size
r_len
)

Returns the Section referenced w/ this section header using given byte array.

pack-priv Section
readSectionImpl(final RandomAccessFile in, final byte[] b, final int b_off, final int r_len)

public String
toString()

Overrides java.lang.Object.toString.

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

Field Detail

eh2back to summary
public final ElfHeaderPart2 eh2

Public access to the elf header

idxback to summary
private final int idx
nameback to summary
private String name
rawback to summary
public final Shdr raw

Public access to the raw elf section header

SHN_ABSback to summary
public static final short SHN_ABS
SHN_COMMONback to summary
public static final short SHN_COMMON
SHN_HIPROCback to summary
public static final short SHN_HIPROC
SHN_HIRESERVEback to summary
public static final short SHN_HIRESERVE
SHN_LOPROCback to summary
public static final short SHN_LOPROC
SHN_LORESERVEback to summary
public static final short SHN_LORESERVE
SHN_UNDEFback to summary
public static final short SHN_UNDEF
SHT_AARCH64_ATTRIBUTESback to summary
public static final int SHT_AARCH64_ATTRIBUTES

. FIXME: Same as SHT_ARM_ATTRIBUTES, ok?

SHT_ARM_ATTRIBUTESback to summary
public static final int SHT_ARM_ATTRIBUTES
SHT_ARM_DEBUGOVERLAYback to summary
public static final int SHT_ARM_DEBUGOVERLAY
SHT_ARM_EXIDXback to summary
public static final int SHT_ARM_EXIDX
SHT_ARM_OVERLAYSECTIONback to summary
public static final int SHT_ARM_OVERLAYSECTION
SHT_ARM_PREEMPTMAPback to summary
public static final int SHT_ARM_PREEMPTMAP
SHT_DYNAMICback to summary
public static final int SHT_DYNAMIC
SHT_DYNSYMback to summary
public static final int SHT_DYNSYM
SHT_HASHback to summary
public static final int SHT_HASH
SHT_HIPROCback to summary
public static final int SHT_HIPROC
SHT_HIUSERback to summary
public static final int SHT_HIUSER
SHT_LOPROCback to summary
public static final int SHT_LOPROC
SHT_LOUSERback to summary
public static final int SHT_LOUSER
SHT_NOBITSback to summary
public static final int SHT_NOBITS
SHT_NOTEback to summary
public static final int SHT_NOTE
SHT_NULLback to summary
public static final int SHT_NULL
SHT_NUMback to summary
public static final int SHT_NUM
SHT_PROGBITSback to summary
public static final int SHT_PROGBITS
SHT_RELback to summary
public static final int SHT_REL
SHT_RELAback to summary
public static final int SHT_RELA
SHT_SHLIBback to summary
public static final int SHT_SHLIB
SHT_STRTABback to summary
public static final int SHT_STRTAB
SHT_SYMTABback to summary
public static final int SHT_SYMTAB

Constructor Detail

SectionHeaderback to summary
pack-priv SectionHeader(final ElfHeaderPart2 eh, final byte[] buf, final int offset, final int length, final int sectionIdx)
SectionHeaderback to summary
pack-priv SectionHeader(final ElfHeaderPart2 eh, final ByteBuffer buf, final int idx)

Method Detail

getFlagsback to summary
public long getFlags()

Returns the flags of this section.

getIndexback to summary
public int getIndex()

Returns the index of this section within the Elf section header table.

getNameback to summary
public String getName()

Returns this section name, maybe null if not read.

getSizeback to summary
public long getSize()

Returns the size of this section.

getTypeback to summary
public int getType()

Returns the type of this section.

initNameback to summary
pack-priv void initName(final Section strS, final int nameOffset) throws IndexOutOfBoundsException
Parameters
strS:Section

the SectionHeader#SHT_STRTAB section containing all strings

nameOffset:int

name offset within strS

readSectionback to summary
public Section readSection(final RandomAccessFile in) throws IOException, IllegalArgumentException

Returns the Section referenced w/ this section header

Parameters
in:RandomAccessFile

file owning the section

Exceptions
IOException:
if read error occurs
IllegalArgumentException:
if section offset or size mismatch including size > Integer#MAX_VALUE
readSectionback to summary
public Section readSection(final RandomAccessFile in, final byte[] b, final int b_off, final int r_len) throws IOException, IllegalArgumentException

Returns the Section referenced w/ this section header using given byte array.

Parameters
in:RandomAccessFile

file owning the section

b:byte[]

destination buffer

b_off:int

offset in destination buffer

r_len:int

requested read length in bytes, which shall be ≤ than this section size

Exceptions
IOException:
if read error occurs
IllegalArgumentException:
  • if section offset or size mismatch including size > Integer#MAX_VALUE
  • if requested read length is > section size
readSectionImplback to summary
pack-priv Section readSectionImpl(final RandomAccessFile in, final byte[] b, final int b_off, final int r_len) throws IOException, IllegalArgumentException
toStringback to summary
public 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