• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
      • Legacy-defrstobj
      • C
      • Proof-checker-array
      • Soft
      • Farray
      • Rp-rewriter
      • Instant-runoff-voting
      • Imp-language
      • Sidekick
      • Ethereum
      • Leftist-trees
      • Java
      • Riscv
      • Taspi
      • Bitcoin
      • Zcash
      • Des
      • X86isa
      • Sha-2
      • Yul
      • Proof-checker-itp13
      • Regex
      • ACL2-programming-language
      • Json
      • Jfkr
      • Equational
      • Cryptography
      • Axe
      • Poseidon
      • Where-do-i-place-my-book
      • Aleo
      • Bigmems
      • Builtins
      • Execloader
        • Elf-reader
        • Mach-o-reader
          • Read-load_commands
          • Read-section_data_sz_structures
          • Mach-o-section-header
          • Mach-o-header
          • Populate-mach-o-contents
          • Good-mach-o-p
          • Fill-data-segment-bytes
            • Fill-text-text-section-bytes
            • Fill-text-segment-bytes
            • Fill-text-cstring-section-bytes
            • Fill-text-const-section-bytes
            • Fill-data-dyld-section-bytes
            • Fill-data-data-section-bytes
            • Fill-data-const-section-bytes
            • Fill-data-common-section-bytes
            • Fill-data-bss-section-bytes
            • Read-mach_header
            • Populate-mach-o
            • Mach-o-section-headers
          • Merge-first-split-bytes
          • Split-bytes
          • Take-till-zero
          • Charlist->bytes
          • Merge-bytes
          • Bytes->charlist
          • String->bytes
          • Bytes->string
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Community
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Mach-o-reader

    Fill-data-segment-bytes

    Fill the sections of the __DATA segment into mach-o

    Signature
    (fill-data-segment-bytes h-size lc-size remaining-file mach-o state) 
      → 
    (mv err new-mach-o new-state)
    Arguments
    remaining-file — Guard (byte-listp remaining-file).
    Returns
    new-mach-o — Type (good-mach-o-p new-mach-o), given (good-mach-o-p mach-o).
    new-state — Type (state-p new-state), given (state-p state).

    Definitions and Theorems

    Function: fill-data-segment-bytes

    (defun fill-data-segment-bytes
           (h-size lc-size remaining-file mach-o state)
      (declare (xargs :stobjs (mach-o state)))
      (declare (type (unsigned-byte 64) h-size)
               (type (unsigned-byte 64) lc-size))
      (declare (xargs :guard (byte-listp remaining-file)))
      (let ((__function__ 'fill-data-segment-bytes))
        (declare (ignorable __function__))
        (b* (((mv flg mach-o state)
              (fill-data-data-section-bytes
                   h-size
                   lc-size remaining-file mach-o state))
             ((when flg) (mv flg mach-o state))
             ((mv flg mach-o state)
              (fill-data-dyld-section-bytes
                   h-size
                   lc-size remaining-file mach-o state))
             ((when flg) (mv flg mach-o state))
             ((mv flg mach-o state)
              (fill-data-const-section-bytes
                   h-size
                   lc-size remaining-file mach-o state))
             ((when flg) (mv flg mach-o state))
             ((mv flg mach-o state)
              (fill-data-bss-section-bytes
                   h-size
                   lc-size remaining-file mach-o state))
             ((when flg) (mv flg mach-o state))
             ((mv flg mach-o state)
              (fill-data-common-section-bytes
                   h-size
                   lc-size remaining-file mach-o state))
             ((when flg) (mv flg mach-o state)))
          (mv flg mach-o state))))

    Theorem: good-mach-o-p-of-fill-data-segment-bytes.new-mach-o

    (defthm good-mach-o-p-of-fill-data-segment-bytes.new-mach-o
     (implies
      (good-mach-o-p mach-o)
      (b*
       (((mv ?err ?new-mach-o ?new-state)
         (fill-data-segment-bytes h-size
                                  lc-size remaining-file mach-o state)))
       (good-mach-o-p new-mach-o)))
     :rule-classes :rewrite)

    Theorem: state-p-of-fill-data-segment-bytes.new-state

    (defthm state-p-of-fill-data-segment-bytes.new-state
     (implies
      (state-p state)
      (b*
       (((mv ?err ?new-mach-o ?new-state)
         (fill-data-segment-bytes h-size
                                  lc-size remaining-file mach-o state)))
       (state-p new-state)))
     :rule-classes :rewrite)