Package org.eclipse.cdt.utils.elf
Class Elf
java.lang.Object
org.eclipse.cdt.utils.elf.Elf
- All Implemented Interfaces:
- AutoCloseable
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionclassclassstatic classException indicating thatElf.ELFhdr.ELFCLASSNONEheader is read.classclassclassclass
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected ERandomAccessFileprotected Elf.ELFhdrstatic final intstatic final intstatic final intstatic final intprotected Stringprotected Stringprotected byte[]protected Elf.Section[]
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidclose()voiddispose()protected voidfinalize()Make sure we do not leak the fds.static Elf.AttributegetAttributes(byte[] array) static Elf.AttributegetAttributes(String file) getDynamicSections(Elf.Section section) Elf.PHdr[]getPHdrs()getSectionByName(String name) getSections(int type) Creates a new symbol reader instance on each call.static booleanisElfHeader(byte[] e_ident) voidstatic longmakeUnsignedLong(byte[] val, int offset, boolean isle) protected longprotected Stringstring_from_elf_section(Elf.Section section, int index) org.eclipse.cdt.utils.elf.Elf.ElfSectionIteratorsymbolIterator(Elf.Section section) Get a symbol iterator
- 
Field Details- 
ELF32_ADDR_SIZEpublic static final int ELF32_ADDR_SIZE- See Also:
 
- 
ELF32_OFF_SIZEpublic static final int ELF32_OFF_SIZE- See Also:
 
- 
ELF64_ADDR_SIZEpublic static final int ELF64_ADDR_SIZE- See Also:
 
- 
ELF64_OFF_SIZEpublic static final int ELF64_OFF_SIZE- See Also:
 
- 
efile
- 
ehdr
- 
sections
- 
file
- 
section_strtabprotected byte[] section_strtab
- 
EMPTY_STRING
 
- 
- 
Constructor Details- 
Elfprotected Elf()
- 
Elf- Throws:
- IOException
 
- 
Elf- Throws:
- IOException
 
 
- 
- 
Method Details- 
string_from_elf_section- Throws:
- IOException
 
- 
getPHdrs- Throws:
- IOException
 
- 
getDynamicSections- Throws:
- IOException
 
- 
getELFhdr- Throws:
- IOException
 
- 
getAttributes- Throws:
- IOException
 
- 
getAttributes- Throws:
- IOException
 
- 
getAttributes- Throws:
- IOException
 
- 
isElfHeaderpublic static boolean isElfHeader(byte[] e_ident) 
- 
closepublic void close()- Specified by:
- closein interface- AutoCloseable
 
- 
disposepublic void dispose()
- 
finalizeMake sure we do not leak the fds.
- 
getSectionByName- Throws:
- IOException
 
- 
getSections- Throws:
- IOException
 
- 
getSections- Throws:
- Elf.ElfClassNoneException- if- Elf.ELFhdr.ELFCLASSNONEheader is read
- IOException
 
- 
symbolIteratorpublic org.eclipse.cdt.utils.elf.Elf.ElfSectionIterator symbolIterator(Elf.Section section) throws IOException Get a symbol iterator- Parameters:
- section- the section to iterate over
- Returns:
- an iterator that returns symbols of a given section
- Throws:
- IOException- If the file is corrupt
- Since:
- 7.0
 
- 
loadSymbols- Throws:
- IOException
 
- 
getSymbols
- 
getDynamicSymbols
- 
getSymtabSymbols
- 
getSymbol
- 
getFilename
- 
readUnsignedLong- Throws:
- IOException
 
- 
getSymbolReaderCreates a new symbol reader instance on each call. Caller is responsible for closing the symbol reader- Returns:
- symbol reader or nullif couldn't create symbol reader
 
- 
makeUnsignedLong- Throws:
- IOException
- Since:
- 5.4
 
 
-