Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/cortex/blob/main/tests/fts/gen_flog_table.py # cortex aien-dev/cortex Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `cortex / tests / fts / gen_flog_table.py` 28 lines ยท 1409 bytes Raw Blame History 1 #!/usr/bin/env python3 2 """Generator (not product code) for the data table in om/flog.om. 3 4 Reads the 274 doubles of glibc 2.39's __log_data (ln2hi, ln2lo, poly[5], poly1[11], 5 tab[128]{invc,logc}) out of the exact libm.so.6 the Rust cortex-rs binary links on this 6 machine, at the address its `log` code loads them from (vaddr 0x78880, see disassembly of 7 log@@GLIBC_2.29 in evidence/fts/glibc-log.dis), and prints them as one Omega text literal 8 of decimal u64 bit patterns. 9 10 Usage: python3 tests/fts/gen_flog_table.py [/usr/lib/aarch64-linux-gnu/libm.so.6] 11 """ 12 import hashlib, struct, sys 13 14 path = sys.argv[1] if len(sys.argv) > 1 else '/usr/lib/aarch64-linux-gnu/libm.so.6' 15 blob = open(path, 'rb').read() 16 VA = 0x78880 17 phoff = struct.unpack_from('