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

While Oracle Will Rake in Big Bucks on AI, Profits Are Hard to Predict

https://www.nextplatform.com/cloud/2026/06/12/while-oracle-will-rake-in-big-bucks-on-ai-profits-a...
1•rbanffy•1m ago•0 comments

Upscaling Space Quest 3 [video]

https://www.youtube.com/watch?v=Zozc1xGuO7Q
1•skibz•5m ago•0 comments

Network service termination for certain Sony Electronics products

https://www.sony.com/electronics/support/articles/00398725
1•croes•6m ago•0 comments

Sygnet – Hash any document with SHA3-512 and declare your AI usage level

https://mysygnet.com
1•Pistachero•8m ago•0 comments

Zuckerberg says Meta made 'mistakes' in AI workforce shift

https://www.reuters.com/business/metas-zuckerberg-admits-mistakes-made-ai-transformation-2026-06-12/
1•jgilias•9m ago•0 comments

Superpowers for Claude, Codex etc.

https://github.com/obra/superpowers
1•wood_spirit•9m ago•0 comments

Nockchain vs. Pearl: The Great Compute War

https://x.com/blocmates/article/2065357097353764868
1•MrBuddyCasino•12m ago•0 comments

A Rant about IPOs

https://dampedspring101.substack.com/p/ipo-rant-everybody-lies
1•rwmj•17m ago•0 comments

Trial of 12mph bike lane speed limit grinds gears of Dutch cyclists

https://www.theguardian.com/world/2026/jun/14/trial-of-12mph-bike-lane-speed-limit-grinds-gears-o...
3•defrost•28m ago•0 comments

Cursed Knowledge

https://obscura.com/cursed-knowledge/
2•Cider9986•29m ago•0 comments

An architectural blueprint to excise MS-DOS device debt (CON, NUL) from Windows

https://feedbackportal.microsoft.com/feedback/idea/dca14930-b767-f111-9b47-6045bdbd0989
1•breakthematrix•32m ago•0 comments

New Brunswick woman sues OpenAI, alleging ChatGPT led to daughter's death

https://www.cbc.ca/news/canada/new-brunswick/sue-open-ai-suicide-chat-gpt-9.7234630
1•uladzislau•41m ago•0 comments

Don't trust large context windows

https://garrit.xyz/posts/2026-05-06-dont-trust-large-context-windows
5•computersuck•42m ago•2 comments

China Is Propping Up the World Economy by Importing Less Oil

https://www.wsj.com/business/energy-oil/china-is-propping-up-the-world-economy-by-importing-a-lot...
5•PankajGhosh•51m ago•0 comments

Introduction to (Multimodal) LLM-as-a-Judge

https://yinghonglan.substack.com/p/introduction-to-multimodal-llm-as
3•rented_mule•52m ago•0 comments

Mining And refining: uranium and plutonium (2024)

https://hackaday.com/2024/04/24/mining-and-refining-uranium-and-plutonium/
2•leonidasrup•56m ago•0 comments

How an astrophysicist uses Codex to help simulate black holes

https://openai.com/index/using-codex-to-simulate-black-holes/
3•gmays•1h ago•0 comments

AI: Surgeon's Assistant or Commodity on a Meter?

https://replicated.wiki/blog/stream.html
2•gritzko•1h ago•0 comments

Show HN: Hanzi Popup – Chinese Language Reader for iOS

https://krmanik.github.io/hanzipopupapp/
1•krmani•1h ago•0 comments

Effective Note Taking

https://isgin01.github.io/posts/effective-note-taking/
1•pullshark91•1h ago•0 comments

SchemaFlow: Agentic Database Change Impact Analysis, SQL Gen and Eval Guardrails

https://developers.openai.com/cookbook/examples/partners/schemaflow_design_guide/schemaflow_cookbook
2•gmays•1h ago•0 comments

Making FlashAttention-4 faster for inference

https://modal.com/blog/flash-attention-4-faster
3•birdculture•1h ago•0 comments

A Missing Woman from Germany Reappears in the Epstein Files

https://www.spiegel.de/international/world/the-mystery-of-michele-a-missing-woman-from-germany-re...
5•doener•1h ago•0 comments

Consciousness likely not unique to earthlings, paper says

https://news.ucr.edu/articles/2026/06/10/consciousness-likely-not-unique-earthlings-paper-says
2•giuliomagnifico•1h ago•0 comments

As Donald Trump turns 80, he faces a foe he can never defeat: Father Time

https://www.theguardian.com/news/ng-interactive/2026/jun/14/donald-trump-turns-80-faces-foe-fathe...
4•hebelehubele•1h ago•1 comments

An O(x)Caml book that runs

https://kcsrk.info/ocaml/oxcaml/teaching/nptel/llm/2026/06/13/an-oxcaml-book-that-runs/
2•matt_d•1h ago•0 comments

Tribblix: The retro Illumos distribution

http://tribblix.org/
17•naturalmovement•1h ago•6 comments

How (and Why) SpaceX Will Colonize Mars

https://waitbutwhy.com/2015/08/how-and-why-spacex-will-colonize-mars.html
2•kunalsin9h•1h ago•1 comments

Digg Reborn

https://digg.com/tech
4•gurjeet•1h ago•0 comments

Story of How Im Running an Unlimited $6/Month AI Provider on 4x RTX 3090s

3•yolo-auto•1h ago•1 comments