• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
      • X86isa
      • Execloader
        • Elf-reader
          • Elf64_sym
          • Elf32_sym
          • Elf-header
          • Elf-section-header
          • Elf64-segment-header
          • Elf32-segment-header
          • Elf_bits32
          • Elf_bits8
          • Elf_bits64
          • Elf_bits16
          • Section-info
          • Read-elf-header
          • Read-section-headers
          • Read-segment-headers-64
          • Read-segment-headers-32
          • Read-section-names
          • Elf64_sym-info
          • Elf32_sym-info
          • Parse-symtab-entries
          • Is-elf-content-p
          • Populate-elf-contents
          • Get-string-section-data
          • Get-section-info1
          • Set-elf-stobj-fields
          • Get-named-section-headers
          • Elf-read-mem-null-term
          • Get-section-info
          • Find-label-address-from-elf-symtab-info
          • Section-names
          • Get-symtab-entries
            • Populate-elf
            • Get-label-addresses
            • Get-label-address
            • Elf-read-string-null-term
            • Good-elf-p
            • Elf64_sym-equiv-under-mask
            • Elf64-segment-headers
            • Elf32_sym-equiv-under-mask
            • Elf32-segment-headers
            • Section-info-list
            • Elf64_sym-info-list
            • Elf32_sym-info-list
            • Elf-section-headers
            • Elf64_sym-debug
            • Elf32_sym-debug
          • Mach-o-reader
          • Merge-first-split-bytes
          • Split-bytes
          • Charlist->bytes
          • Take-till-zero
          • Merge-bytes
          • Bytes->charlist
          • Bytes->string
          • String->bytes
        • Axe
      • Testing-utilities
      • Math
    • Elf-reader

    Get-symtab-entries

    Get all symbol table entries, with names mapped to entries in the string table

    Signature
    (get-symtab-entries elf) → elf-entries

    Definitions and Theorems

    Function: get-symtab-entries

    (defun
       get-symtab-entries (elf)
       (declare (xargs :stobjs (elf)))
       (declare (xargs :guard t))
       (let ((__function__ 'get-symtab-entries))
            (declare (ignorable __function__))
            (b* ((elf-header (@elf-header elf))
                 (sections (@sections elf))
                 ((section-info symtab-section)
                  (get-section-info ".symtab" sections))
                 ((section-info strtab-section)
                  (get-section-info ".strtab" sections))
                 ((elf-section-header symtab-header)
                  symtab-section.header)
                 (elf64? (equal (elf-header->class elf-header)
                                2))
                 (symtab-entries
                      (parse-symtab-entries elf64? symtab-header.entsize
                                            symtab-section.bytes
                                            strtab-section.bytes)))
                symtab-entries)))

    Theorem: elf32_sym-info-list-p-of-get-symtab-entries

    (defthm
         elf32_sym-info-list-p-of-get-symtab-entries
         (b* ((?elf-entries (get-symtab-entries elf)))
             (implies (not (equal (elf-header->class (@elf-header elf))
                                  2))
                      (elf32_sym-info-list-p elf-entries))))

    Theorem: elf64_sym-info-list-p-of-get-symtab-entries

    (defthm elf64_sym-info-list-p-of-get-symtab-entries
            (b* ((?elf-entries (get-symtab-entries elf)))
                (implies (equal (elf-header->class (@elf-header elf))
                                2)
                         (elf64_sym-info-list-p elf-entries))))