• 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-string-section-data

    Signature
    (get-string-section-data string-section-index 
                             sec-headers file-byte-list) 
     
      → 
    bl
    Arguments
    string-section-index — Guard (natp string-section-index).
    sec-headers — Guard (elf-section-headers-p sec-headers).
    file-byte-list — Guard (byte-listp file-byte-list).
    Returns
    bl — Type (byte-listp bl), given (byte-listp file-byte-list).

    Definitions and Theorems

    Function: get-string-section-data

    (defun
     get-string-section-data
     (string-section-index sec-headers file-byte-list)
     (declare (xargs :guard (and (natp string-section-index)
                                 (elf-section-headers-p sec-headers)
                                 (byte-listp file-byte-list))))
     (let
      ((__function__ 'get-string-section-data))
      (declare (ignorable __function__))
      (b*
       ((sec-headers-from-string-section-index
             (nthcdr string-section-index sec-headers))
        ((unless (and (consp sec-headers-from-string-section-index)
                      (elf-section-headers-p
                           sec-headers-from-string-section-index)))
         (prog2$ (er hard? 'elf-file-read
                     "String-section-index header not found!~%")
                 nil))
        (header (car sec-headers-from-string-section-index))
        ((elf-section-header header))
        (string-section-header-bytes
             (take header.size
                   (nthcdr header.offset file-byte-list)))
        ((unless (byte-listp string-section-header-bytes))
         (prog2$
             (er hard? 'elf-file-read
                 "Not enough bytes to read string-section-header data!")
             nil)))
       string-section-header-bytes)))

    Theorem: byte-listp-of-get-string-section-data

    (defthm
     byte-listp-of-get-string-section-data
     (implies
         (byte-listp file-byte-list)
         (b* ((bl (get-string-section-data string-section-index
                                           sec-headers file-byte-list)))
             (byte-listp bl)))
     :rule-classes :rewrite)