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

Pentagon weighs pulling nearly a third of U.S. forces from Europe

https://www.nbcnews.com/politics/national-security/pentagon-weighs-pulling-nearly-third-us-forces...
1•consumer451•48s ago•0 comments

The open source version of Claude Project that gives you the context ownershp

https://github.com/zqiren/Orbital
1•10keane•1m ago•0 comments

Essays of Dario Amodei are why people are worried about artificial intelligence

https://www.nytimes.com/2026/09/17/technology/dario-amodei-anthropic-essays-ai.html
1•Alien1Being•2m ago•0 comments

Jev plays Roulette Wars on its own

https://twitter.com/NicoSaraintaris/status/2100745151622664392
1•lafferty•3m ago•0 comments

LeanReact: Expressing Composable and Correct React Components in Lean

https://theoric.com/blog/leanreact_introduction/
1•hargup•7m ago•0 comments

Shapelearn Qwen 3.8 27B (13.1 GB VRAM)

https://byteshape.com/blogs/Qwen3.8-27B/
1•syntaxing•11m ago•0 comments

Minimal Phone 2

https://minimalcompany.com/
2•nashashmi•15m ago•0 comments

Ubuntu 26.10 Moves cp, mv and rm Over To Rust Coreutils For 100% Transition

https://www.phoronix.com/news/Ubuntu-Completes-Rust-Coreutils
2•thunderbong•15m ago•0 comments

AWS now supports spend limits

https://docs.aws.amazon.com/accounts/latest/reference/create-spend-limit.html
1•xyos•16m ago•0 comments

You can run Git on object storage if you re-make packfiles

https://www.tigrisdata.com/blog/objgit-packfiles/
2•zbentley•19m ago•1 comments

.agt – The Agent Namespace

https://agtnames.substack.com/p/introducing-agt
2•danschmitz•28m ago•1 comments

Tiny e-readers aren't small Kindles. They're a different bet

https://www.readme.club/news/tiny-e-readers-aren-t-just-small-kindles
5•billybuckwheat•28m ago•0 comments

Unix Was Right. We Made Linux Too Complicated [video]

https://www.youtube.com/watch?v=wmmsdT93ils
3•jamesgill•36m ago•0 comments

This California Educational Juggernaut Doesn't Need the SAT

https://www.nytimes.com/2026/09/16/opinion/university-of-california-sat.html
3•like_any_other•37m ago•2 comments

Spectral AI Architecture: Executive Summary and Core Concepts

https://github.com/srdwy99m5j-lab/glowing-rotary-phone
2•paskinz69•38m ago•0 comments

What Is LPO, NPO, CPO? Knowledge of Optical Interconnect Technologies

https://www.fiber-mart.com/news/what-is-lpo-npo-cpo-knowledge-of-optical-interconnect-technologie...
2•peter_d_sherman•39m ago•0 comments

Ask A Monk – A digital wilderness for thoughts with no immediate answer

https://askamonk.online
2•13613288957•41m ago•0 comments

Kubernetes v1.37: Hardening emptyDir and bind mounts

https://kubernetes.io/blog/2026/09/16/kubernetes-v1-37-hardening-container-storage/
3•iamsyr•47m ago•0 comments

Fender Is Making Enemies with a Messy Fight over Its Iconic Strat

https://www.bloomberg.com/news/features/2026-09-17/fender-takes-on-the-electric-guitar-industry-o...
2•ilamont•52m ago•1 comments

Show HN: PortButler – send files from macOS to a device with no way to receive

https://portbutler.sshlab.dev
4•swq115•53m ago•0 comments

How often people say a habit, therapy, diet or supplement changed their life

https://www.jeravalue.com/en/life-changing
2•nreece•56m ago•0 comments

Fingerprinting Network Honeypots with Weighted Behavioral Scoring Engine

https://meetcyber.net/fingerprinting-network-honeypots-with-weighted-behavioral-scoring-engine-86...
2•ls1911•1h ago•0 comments

Claude Code from Source

https://claude-code-from-source.com/
15•pykello•1h ago•4 comments

SEC Issues "Innovation Exemption" to Facilitate Trading of Tokenized NMS Stock

https://www.sec.gov/newsroom/press-releases/2026-90-sec-issues-innovation-exemption-facilitate-tr...
3•BiraIgnacio•1h ago•0 comments

Hackers Used Anthropic's Claude to Break into OpenAI

https://www.wsj.com/tech/ai/hackers-used-anthropics-claude-to-break-into-openai-b40ba883
5•impish9208•1h ago•2 comments

Jev means structured output is interesting again

https://www.seangoedecke.com/jev-means-structured-output-is-interesting-again/
5•iacguy•1h ago•0 comments

Hypercomb – AI open software platform

https://hypercomb.io
2•jwizestackz•1h ago•0 comments

Type Declaration Syntax

https://citrons.xyz/journal/2026-09-09
2•birdculture•1h ago•0 comments

Telstra outage: The night a network decided the year was 2006

https://www.netnod.se/blog/telstra-outage-night-network-decided-year-was-2006
10•TMWNN•1h ago•2 comments

Goose: 1.16x faster than C++ and 1.12x than safe Rust, while memory safe

https://github.com/aardappel/goose/tree/master
29•bobbydigitales•1h ago•19 comments