Class Elf

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    public class Elf
    extends java.lang.Object
    implements java.lang.AutoCloseable
    • Constructor Detail

      • Elf

        protected Elf()
      • Elf

        public Elf​(java.lang.String file,
                   long offset)
            throws java.io.IOException
        Throws:
        java.io.IOException
      • Elf

        public Elf​(java.lang.String file)
            throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • string_from_elf_section

        protected java.lang.String string_from_elf_section​(Elf.Section section,
                                                           int index)
                                                    throws java.io.IOException
        Throws:
        java.io.IOException
      • getPHdrs

        public Elf.PHdr[] getPHdrs()
                            throws java.io.IOException
        Throws:
        java.io.IOException
      • getDynamicSections

        public Elf.Dynamic[] getDynamicSections​(Elf.Section section)
                                         throws java.io.IOException
        Throws:
        java.io.IOException
      • getELFhdr

        public Elf.ELFhdr getELFhdr()
                             throws java.io.IOException
        Throws:
        java.io.IOException
      • getAttributes

        public Elf.Attribute getAttributes()
                                    throws java.io.IOException
        Throws:
        java.io.IOException
      • getAttributes

        public static Elf.Attribute getAttributes​(java.lang.String file)
                                           throws java.io.IOException
        Throws:
        java.io.IOException
      • getAttributes

        public static Elf.Attribute getAttributes​(byte[] array)
                                           throws java.io.IOException
        Throws:
        java.io.IOException
      • isElfHeader

        public static boolean isElfHeader​(byte[] e_ident)
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
      • dispose

        public void dispose()
      • finalize

        protected void finalize()
                         throws java.lang.Throwable
        Make sure we do not leak the fds.
        Overrides:
        finalize in class java.lang.Object
        Throws:
        java.lang.Throwable
      • getSectionByName

        public Elf.Section getSectionByName​(java.lang.String name)
                                     throws java.io.IOException
        Throws:
        java.io.IOException
      • getSections

        public Elf.Section[] getSections​(int type)
                                  throws java.io.IOException
        Throws:
        java.io.IOException
      • getSections

        public Elf.Section[] getSections()
                                  throws java.io.IOException
        Throws:
        java.io.IOException
      • symbolIterator

        public org.eclipse.cdt.utils.elf.Elf.ElfSectionIterator symbolIterator​(Elf.Section section)
                                                                        throws java.io.IOException
        Get a symbol iterator
        Parameters:
        section - the section to iterate over
        Returns:
        an iterator that returns symbols of a given section
        Throws:
        java.io.IOException - If the file is corrupt
        Since:
        7.0
      • loadSymbols

        public void loadSymbols()
                         throws java.io.IOException
        Throws:
        java.io.IOException
      • getDynamicSymbols

        public Elf.Symbol[] getDynamicSymbols()
      • getSymtabSymbols

        public Elf.Symbol[] getSymtabSymbols()
      • getFilename

        public java.lang.String getFilename()
      • readUnsignedLong

        protected long readUnsignedLong​(ERandomAccessFile file)
                                 throws java.io.IOException
        Throws:
        java.io.IOException
      • makeUnsignedLong

        public static long makeUnsignedLong​(byte[] val,
                                            int offset,
                                            boolean isle)
                                     throws java.io.IOException
        Throws:
        java.io.IOException
        Since:
        5.4