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).

Europe is pouring billions into space. Can Glasgow's satellite industry keep up?

https://www.bbc.co.uk/news/articles/cm2kedyp348lo
1•zeristor•5m ago•0 comments

Show HN: Purify-edge, DOMPurify without jsdom that runs on Cloudflare Workers

https://github.com/anzal1/purify-edge
1•AnzalAbidi•6m ago•0 comments

Scaling Kubernetes Workloads with Node Swap

https://kubernetes.io/blog/2026/10/05/scaling-kubernetes-workloads-with-node-swap/
1•frostbyte7•8m ago•0 comments

Why does earthquake prediction remain impossible

https://www.trtworld.com/article/12797396
1•teleforce•8m ago•0 comments

Where Is the Love in Renoir?

https://medium.com/counterarts/where-is-the-love-in-renoir-4479cab55a56
1•cadeos•9m ago•0 comments

Scala Almost Succeeded

https://medium.com/@fommil/scala-almost-succeeded-c3b1028b02c5
1•birdculture•10m ago•0 comments

Show HN: Thyme – A New AI-Based App Reverse Engineering Tool

https://apppipeline.online/
3•neocanable•11m ago•0 comments

Long-Gone Newspaper Was the Best Job I Ever Had

https://tedium.co/2026/10/05/link-newspaper-virginian-pilot-remembrance/
2•rdmuser•14m ago•0 comments

PHPStan 2.3: Leap in Performance, Generics, Detecting Unused Variables

https://phpstan.org/blog/phpstan-2-3-leap-in-performance
1•Y-bar•14m ago•0 comments

Ask HN: Alternatives to NeurIPS, ICLR and ICML

1•john-titor•15m ago•0 comments

New repository settings for configuring pull request access

https://github.blog/changelog/2026-02-13-new-repository-settings-for-configuring-pull-request-acc...
1•Bluestein•16m ago•0 comments

Ask HN: Would you pay for saving AI cost?

2•berdayaai•16m ago•0 comments

Proof-Carrying-BPF Programs for the eBPF Verifier

https://al.radbox.org/doi/10.1145/3837779.3838158
1•matt_d•19m ago•0 comments

Show HN: YardSmart – a simpler way to rent construction equipment locally

https://yardsmart.io
1•oscar417•21m ago•0 comments

Effects of creatine supplementation with and without exercise

https://pubmed.ncbi.nlm.nih.gov/42578920/
1•tosh•23m ago•0 comments

Big Blob of Compute: The Essay That Started the AI Race

https://kevinroose.substack.com/p/the-essay-that-started-the-ai-race
1•danielmorozoff•26m ago•0 comments

Schelling-Based Adjudication on Solana

https://useaccord.xyz/
1•xeroc•27m ago•0 comments

We are going to kill "unalive"

https://www.anildash.com/2026/10/06/kill-unalive/
4•Tomte•28m ago•0 comments

Apple Is Now Fucked

https://www.youtube.com/watch?v=jnQBhiipsQM
3•cable2600•28m ago•0 comments

Autolith: A self-modifiable general purpose Lisp AI agent

https://github.com/lambda-symbolics/autolith
2•long____cat•28m ago•0 comments

Jev vs. Clef

https://twitter.com/sztwiorok/status/2107356946844070190
5•sztwiorok•32m ago•1 comments

Afterr

https://afterr.org
2•CurtisDarzee•35m ago•0 comments

Warren McCollough on Neural Nets [video]

https://www.youtube.com/watch?v=wawMjJUCMVw
1•_doctor_love•40m ago•0 comments

Global diesel crunch sends cost pressures down the supply chain

https://www.oxfordeconomics.com/resource/global-diesel-crunch-sends-cost-pressures-down-the-suppl...
1•geox•44m ago•0 comments

OpenAI Does Not Trust Its Own Models, and Rightly So

https://www.vincentschmalbach.com/openai-does-not-trust-its-own-models/
1•vincent_s•45m ago•0 comments

Show HN: Open-source iPhone app that streams Claude like the Siri app

https://github.com/unionst/swift-chat-ai-starter
1•blsage•46m ago•0 comments

The ride that will bankrupt you

https://melvynschobel.substack.com/p/the-alto-line-the-ride-that-will
1•dorygold•47m ago•0 comments

Sentry: Learning to Recover from LLM Agent Failures at Test Time

https://github.com/nuglifeleoji/Sentry
1•matt_d•51m ago•0 comments

Our minds aren't equipped to handle AI

https://www.theverge.com/ai-artificial-intelligence/1003794/ai-education-computational-model-thought
3•zishha1b0njq•53m ago•1 comments

DeepSeek to Raise at Least $12B in Tencent-Backed Funding

https://www.bloomberg.com/news/articles/2026-10-06/deepseek-to-raise-at-least-12-billion-in-tence...
4•doppp•58m ago•0 comments