frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

Ask HN: Help with doing statistics over machine code

2•phafu•1y ago
I'd like to do some statistics over the machine code gcc generates, such as a histogram of used instructions, average volatile/preserved registers usage of functions etc. For now just x86_64 SysV-ABI would be enough.

However I'm not aware of any pre-existing tool that lets me easily do this. The options I currently see are either make gcc output assembly and write a parser for the GNU Assembler format (possibly by reusing the asm-parser of the compiler-explorer project), or write a tool that reads (disassembles) object files directly using elfutils.

Any hints, prior work, further ideas, links to useful resources, or any other kind of help would be much appreciated.

Comments

baobun•1y ago
"Static analysis" should be a relevant search term. Assuming you don't need to tie the instructions back to C code then the "gcc" part seems circumstancial for implementation? I guess you might want to parse the ASM into an Abstract Syntax Tree (AST) represenation and work on that?

If you do want to tie it back to the source, this looks relevant: http://icps.u-strasbg.fr/~pop/gcc-ast.html

phafu•1y ago
For my purpose I don't need to get back to the original source, no.

The gcc part is only relevant with regards to what dialect of assembler I need to parse. If I go that route, I'd write a parser for the GNU assembler, and that would of course work with any code in that dialect, regardless from which compiler it came from (I haven't checked whether other compilers can produce GNU assembler though).

Elastic Cloud (Public) Status – Replication bug causing slow recoveries

https://status.elastic.co/incidents/l6zgdnvvg41j
1•kyisaiah47•2m ago•0 comments

Meta launches Muse, a personal AI agent

https://apps.apple.com/us/app/muse-from-meta/id6760173601
1•fourfire•4m ago•0 comments

Navier-Stokes – Sebastien Bubeck

https://twitter.com/SebastienBubeck/status/2097379411691516310
2•Palmik•5m ago•1 comments

Not in My Git Yard: Catching Backdoors at Commit and Release Time

https://arxiv.org/abs/2607.26719
2•matt_d•10m ago•0 comments

Apple Releases Firmware Update for 140W USB-C Power Adapter

https://www.macrumors.com/2026/09/08/apple-releases-140w-usb-c-charger-firmware-update/
2•hentrep•11m ago•0 comments

The Secret Life of Circuits: An Illustrated Guide to Electronic Circuit Design

https://nostarch.com/secret-life-of-circuits
1•teleforce•11m ago•0 comments

Show HN: LazyReader – Read ebooks and stream audiobooks directly from your cloud

https://lazyreader.lindocode.com
1•ekaftnuocca10•14m ago•0 comments

Vial contains a new drug called PAC-3310

https://twitter.com/douglasyaody/status/2097377733466800489
2•victor82•15m ago•0 comments

Open Parliamentary Accountability EXchange

https://opax.com.au/
3•jacobtracey•21m ago•0 comments

Practical PCB Design: From Breadboard to Production

https://nostarch.com/practical-PCB-design
1•teleforce•21m ago•0 comments

Gmail AI Threat Scanner–zero-infra email anomaly detection

https://github.com/ajaynyayapathi/Gmail-AI-Threat-Scanner
1•nvajay•22m ago•0 comments

Inflation is back around the world–as is the fight against it

https://www.economist.com/finance-and-economics/2026/09/06/inflation-is-back-around-the-world-as-...
2•andsoitis•24m ago•1 comments

How to search for long hashes and IDs with dict='keywords_32k'

https://medium.com/@s_nikolaev/how-to-search-for-long-hashes-and-ids-with-dict-keywords-32k-732e0...
1•snikolaev•26m ago•0 comments

Freelancers are getting buried with 'soulless' AI slop cleanup

https://www.theguardian.com/technology/2026/sep/02/ai-jobs-freelance-cleanup
3•oogali•29m ago•0 comments

Why OpenAI's NS Singularity Requires Forcing: Response Functionals and Clay B

https://reddawnacademicpress.org/2026/09/08/openai-camlin-clay-response/
2•jcamlin•32m ago•0 comments

A Case Study on Emergent Cheating, Whistleblowing in Autonomous Research Swarms

https://arxiv.org/abs/2609.04170
3•the-mitr•32m ago•0 comments

An Affair in the Nonlocality Community

https://mateusaraujo.info/2026/07/19/a-strange-affair-in-the-nonlocality-community/
4•brimtown•34m ago•1 comments

DHH's Omarchy Considering Replacing Arch/AUR with Nix

https://github.com/omacom/omarchy/blob/97a86af116b71ffd6b6dd0afc27cdefce5cacee2/plans/nix.md
2•djfergus•35m ago•1 comments

Inzerosight

https://github.com/inzerosight/inzerosight
2•planetrenox•38m ago•0 comments

The Architecture of Open Source Applications

https://aosabook.org/en/
2•zasz•40m ago•1 comments

Sex and Drugs and Guns and Code

https://third-bit.com/sdgc/
2•mooreds•41m ago•0 comments

Phoenix V2: persistent memory, emotional state, self-model for AI (MIT)

https://github.com/cleversonbrsantos-art/Phoenix
1•cleversonBr•50m ago•0 comments

Make your Mac displays work as one

https://displayspan.app/
1•ashing•53m ago•0 comments

Iran says it captured US submarine drone in Strait of Hormuz

https://www.reuters.com/world/middle-east/iran-says-it-captured-us-submarine-drone-strait-hormuz-...
22•harambae•55m ago•2 comments

Statement from AMS Leadership on Navier-Stokes Problem

https://www.ams.org/news?news_id=7686
5•wslh•55m ago•1 comments

A lab notebook of number theory results, including what didn't hold up

https://ras2045.github.io/reproducing-set/
2•rsardinifb•56m ago•0 comments

Driverless F-1 Competition Came to Italy [video]

https://www.yahoo.com/news/videos/driverless-cars-compete-f1-style-002939363.html
1•fuzzfactor•58m ago•1 comments

Harvard study predicts most suicide attempts a week in advance

https://current.fas.harvard.edu/stories/harvard-study-predicts-most-suicide-attempts-week-advance
74•jodacola•1h ago•34 comments

X402-trinity-gaming – Headless payment back end for the gaming economy

https://github.com/devmster/x402-trinity-gaming
1•devmster•1h ago•0 comments

Optimizing Your NFS Filesystem

https://www.admin-magazine.com/HPC/Articles/Useful-NFS-Options-for-Tuning-and-Management
1•ankitg12•1h ago•0 comments