import syntax import pseudo_compile import objdump import logic import re logic.arm_none_eabi_gnu_thumb_mode = True f = open ('%s/insertsort.elf.symtab' % target_dir) (lsymbs, lsects) = objdump.build_syms (f) f.close () symbols.update (lsymbs) sections.update (lsects) f = open ('%s/insertsort_C_graph.txt' % target_dir) syntax.parse_and_install_all (f, 'C') f.close () f = open ('%s/insertsort_mc_graph.txt' % target_dir) (astructs, afunctions, aconst_gs) = syntax.parse_and_install_all (f, 'ASM') f.close () assert not astructs assert not aconst_gs assert logic.aligned_address_sanity (afunctions, symbols, 4) #f = open ('%s/insertsort.elf.rodata' % target_dir) #rodata[:] = objdump.build_rodata (f) #f.close () print 'Pseudo-Compiling.'
import target_objects import syntax import pseudo_compile import objdump import logic import re f = open ('%s/loop-O1.elf.symtab' % target_dir) (lsymbs, lsects) = objdump.build_syms (f) f.close () symbols.update (lsymbs) sections.update (lsects) f = open ('%s/CFunDump.txt' % target_dir) syntax.parse_and_install_all (f, 'C') f.close () f = open ('%s/ASMO1Funs.txt' % target_dir) (astructs, afunctions, aconst_gs) = syntax.parse_and_install_all (f, 'ASM') f.close () assert not astructs assert not aconst_gs assert logic.aligned_address_sanity (afunctions, symbols, 4) print 'Pseudo-Compiling.' pseudo_compile.compile_funcs (functions) print 'Checking.' syntax.check_funs (functions)
import target_objects import syntax import pseudo_compile import objdump import logic import re f = open ('%s/kernel.elf.symtab' % target_dir) (lsymbs, lsects) = objdump.build_syms (f) f.close () symbols.update (lsymbs) sections.update (lsects) f = open ('%s/CFunctions.txt' % target_dir) syntax.parse_and_install_all (f, 'C') f.close () f = open ('%s/ASMFunctions.txt' % target_dir) (astructs, afunctions, aconst_globals) = syntax.parse_and_install_all (f, 'ASM',skip_functions= ['fastpath_call', 'fastpath_reply_recv','c_handle_syscall']) f.close () assert not astructs assert not aconst_globals assert logic.aligned_address_sanity (afunctions, symbols, 4) f = open ('%s/kernel.elf.rodata' % target_dir) rodata[:] = objdump.build_rodata (f) f.close () print 'Pseudo-Compiling.'
# # Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) # # SPDX-License-Identifier: BSD-2-Clause # from target_objects import target_dir, structs, functions, const_globals from target_objects import symbols, sections, rodata, pairings, danger_set import syntax import objdump import logic f = open('%s/Functions.txt' % target_dir) syntax.parse_and_install_all(f, None) f.close() print 'Checking.' syntax.check_funs(functions) #print 'Pseudo-Compiling.' #pseudo_compile.compile_funcs (functions) #print 'Duplicate-sharing.' #pseudo_compile.combine_function_duplicates (functions) def run_pairings(): for f in functions: if f.startswith('C.'): f2 = 'mc_' + f[2:]
# * # * This software may be distributed and modified according to the terms of # * the BSD 2-Clause license. Note that NO WARRANTY is provided. # * See "LICENSE_BSD2.txt" for details. # * # * @TAG(NICTA_BSD) from target_objects import target_dir, structs, functions, const_globals from target_objects import symbols, sections, rodata, pairings, danger_set import syntax import objdump import logic f = open ('%s/Functions.txt' % target_dir) syntax.parse_and_install_all (f, None) f.close () print 'Checking.' syntax.check_funs (functions) #print 'Pseudo-Compiling.' #pseudo_compile.compile_funcs (functions) #print 'Duplicate-sharing.' #pseudo_compile.combine_function_duplicates (functions) def run_pairings (): for f in functions: if f.startswith ('C.'): f2 = 'mc_' + f[2:]
from target_objects import target_dir, structs, functions from target_objects import symbols, sections, rodata, pairings import target_objects import syntax import pseudo_compile import objdump import logic import re f = open ('%s/kernel.elf.symtab' % target_dir) objdump.install_syms (f) f.close () f = open ('%s/CFunctions.txt' % target_dir) syntax.parse_and_install_all (f, 'C') f.close () f = open ('%s/ASMFunctions.txt' % target_dir) (astructs, afunctions, aconst_globals) = syntax.parse_and_install_all (f, 'ASM',skip_functions= ['fastpath_call', 'fastpath_reply_recv','c_handle_syscall','arm_swi_syscall']) f.close () assert not astructs assert not aconst_globals assert logic.aligned_address_sanity (afunctions, symbols, 4) f = open ('%s/kernel.elf.rodata' % target_dir) objdump.install_rodata (f, [('Section', '.rodata'), ('Symbol', 'kernel_devices'), ('Symbol', 'avail_p_regs')]) f.close ()