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

Could A.I. Find Brazil's Next Pelé?

https://www.nytimes.com/2026/06/24/world/americas/brazil-soccer-ai-scout-fc-santos.html
1•thm•52s ago•0 comments

Hellenic Fire System satellites launched for Greece

https://www.esa.int/Applications/Observing_the_Earth/Hellenic_Fire_System_satellites_launched_for...
1•geox•7m ago•0 comments

How Some Private-Equity Managers Collect Big Fees on Paper Gains

https://www.wsj.com/finance/investing/how-some-private-equity-managers-collect-big-fees-on-paper-...
1•impish9208•12m ago•1 comments

Exercises Dataset

https://github.com/hasaneyldrm/exercises-dataset
1•taubek•13m ago•0 comments

Cambium AI

https://github.com/pkjaslam/Cambium_AI
1•pkjaslam•14m ago•0 comments

China Has Matched Anthropic in Cybersecurity, Resetting AI Race

https://www.wsj.com/tech/ai/chinese-ai-anthropic-mythos-cybersecurity-574b02c2
1•watchdogtimer•16m ago•0 comments

Why is Claude Code ending Converstaion

https://medium.com/@thesuperrepemail/calude-code-got-sentimental-6fe965a3acc5
1•rajkverma123•18m ago•0 comments

Students are doing worse than you think

https://www.economist.com/international/2026/06/25/students-are-doing-worse-than-you-think
1•u1hcw9nx•19m ago•4 comments

The Extra Gear

https://fabioscagliola.com/blog/the-extra-gear/
1•scaglio•24m ago•0 comments

Bobby McFerrin – Don't Worry Be Happy [video]

https://www.youtube.com/watch?v=d-diB65scQU
3•keepamovin•26m ago•1 comments

The Court That Will Believe Anything Is 'Race-Neutral

https://www.theatlantic.com/ideas/2026/06/scotus-asylum-racial-discrimination/687710/
2•Alien1Being•27m ago•0 comments

Benchmarking real-time voice translation

https://startpinch.com/research/en/speech_translation_benchmark
2•christiansafka•31m ago•0 comments

Th0rgal/open_oura: a Rust toolkit for the Oura Ring (Gen 3/4/5)

https://github.com/Th0rgal/open_oura
1•0xcrypto•36m ago•1 comments

DLL that was not present in memory despite not being formally unloaded

https://devblogs.microsoft.com/oldnewthing/20260625-00/?p=112467
4•ibobev•44m ago•0 comments

Software Taste vs. Slop in the Age of AI – TWSoftwareDev26

https://blog.herlein.com/post/wisdom-in-specs/
2•gherlein•46m ago•0 comments

Show HN: I built a strategic PvP word game where each move is just one letter

https://letterphile.com
2•sonOfHades•48m ago•2 comments

Local semantic search engine in Rust, no external DB

https://github.com/Gabriele06-local/LocalMind
1•Gabriele06_•49m ago•0 comments

Show HN: Claudete – Command a legion of Claude Code instances and shells

https://claudete.co
2•morion4000•51m ago•2 comments

Auditable Commercial License v1.0

https://www.auditablelicense.org/
1•ilreb•52m ago•0 comments

Kubernetes CPU requests and limits, explained through cgroups

https://roszigit.com/en/blog/kubernetes-cpu-request-limit/
1•lkanwoqwp•55m ago•0 comments

Cancellation of Windows Runtime activities is asynchronous

https://devblogs.microsoft.com/oldnewthing/20260624-00/?p=112465
1•ibobev•55m ago•0 comments

openENOC – Scalable Ethernet-Based Network-on-Chip

https://github.com/eniokaljic/openENOC/
1•ssenseiss•55m ago•1 comments

Brace Expansion Tree

https://www.johndcook.com/blog/2026/06/27/brace-expansion-tree/
1•ibobev•56m ago•1 comments

Tiny LLM Benchmark: Jetson Orin Nano Super 8GB

https://www.smolhub.com/posts/jetson-nano-super-benchmark-non-reasoning/
1•orbanlevi•1h ago•0 comments

Guards Guards – small gotcha in Elixir guard expressions

https://hauleth.dev/post/guards-guards/
1•hauleth•1h ago•0 comments

If You Can Facilitate a Retrospective, You Can Audit Your AI

https://age-of-product.com/ai-delegation-audit/
2•swolpers•1h ago•0 comments

A guide on how to run Nemotron 3 Super 120B Thinking on 2 Nvidia DGX Spark

https://corti.com/serving-nemotron-super-120b-with-a-1m-token-context-on-a-2-node-dgx-spark-cluster/
2•TechPreacher•1h ago•1 comments

Grok Is More Important Than Clean Air, DOJ Says

https://www.motherjones.com/environment/2026/06/grok-doj-justice-naacp-clean-air-act-gas-turbine-...
2•virgildotcodes•1h ago•2 comments

The post that no one will read

https://twitter.com/MedMarrouchi/status/2071161041598157196
2•medmarrouchi•1h ago•0 comments

Polymarket customers lose $3M in supply-chain attack

https://www.bleepingcomputer.com/news/security/polymarket-customers-lose-3-million-in-supply-chai...
1•01-_-•1h ago•0 comments