frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

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

RariaSense – vanilla JavaScript library for interactive hover sounds

https://github.com/paulo807/rariasense
1•paulo949•17s ago•0 comments

How the Fight Against Ebola Tested a Culture's Traditions (2015)

https://www.nationalgeographic.com/adventure/article/150130-ebola-virus-outbreak-epidemic-sierra-...
2•recursivecaveat•1m ago•0 comments

How the Boomers Screwed Europe

https://www.economist.com/europe/2026/05/28/how-the-boomers-screwed-europe
2•karakoram•1m ago•1 comments

Heathkit: America's Biggest Loss [video]

https://www.youtube.com/watch?v=lUQOG1hp54g
2•ynac•2m ago•0 comments

I'm waiting for Claude to rm rf my computer

https://12gramsofcarbon.com/p/agentics-local-coding-agents-are
2•theahura•2m ago•0 comments

How Long Does It Take to Plan a Bridge?

https://www.construction-physics.com/p/how-long-does-it-take-to-plan-a-bridge
2•paulpauper•3m ago•0 comments

Did the Credibility Revolution Skip Public Management?

https://papers.ssrn.com/sol3/papers.cfm?abstract_id=6816199
2•paulpauper•3m ago•0 comments

The world is bigger than you can imagine

https://scottsumner.substack.com/p/the-world-is-bigger-than-you-can
2•paulpauper•4m ago•0 comments

Public Identifiers, UUIDs and a Tiny SEO Fix

https://perlhacks.com/2026/06/public-identifiers-uuids-and-a-tiny-seo-fix/
2•scottchiefbaker•5m ago•0 comments

Search every file on your Mac by meaning – all Locally

https://hanxiao.io/omni/
2•amrrs•7m ago•0 comments

Fentanyl-to-Peptide Pivot by Chinese Cartels Supplying Gray-Market Ecosystem

https://www.chainalysis.com/blog/gray-market-peptide-crypto-boom/
2•ck2•9m ago•1 comments

How much value is AI creating?

https://www.ft.com/content/8e9ae7a4-7209-4e2c-aa36-f3af77d6ce1f
3•thm•11m ago•0 comments

Who's Running Last.fm Now?

https://support.last.fm/t/who-s-running-last-fm-now/118802
3•myfonj•16m ago•0 comments

If LLMs Have Human-Like Attributes, Then So Does Age of Empires II

https://www.openread.academy/en/paper/reading?corpusId=549270147
2•king_zee•18m ago•0 comments

Write Your Own Virtual Machine

https://www.jmeiners.com/lc3-vm/
3•redbell•18m ago•0 comments

Beyond the Memory Wall: The CPU Was Helping You All Along

https://prawns.dev/blogs/beyond-memory-wall
3•random__duck•18m ago•1 comments

A total solar eclipse will occur this summer. Everything you need to know

https://www.cnn.com/2026/06/06/science/total-solar-eclipse-path-august
2•tzury•25m ago•0 comments

An Absolutely Diabolical Phishing Email

https://twitter.com/thepatwalls/status/2060367488446017947
2•866-RON-0-FEZ•25m ago•0 comments

OpenCV 5.0 Released with Rewritten DNN Engine, Built-In LLM and VLM Support

https://www.phoronix.com/news/OpenCV-5.0-Released
2•daesorin•26m ago•0 comments

Ape: A New Vulkan Driver Written in the Zig Programming Language

https://www.phoronix.com/news/Vulkan-Ape-Driver
3•daesorin•28m ago•0 comments

Scientists Edit Human Embryo Genes with Startling Precision

https://www.nytimes.com/2026/06/04/science/embryos-gene-editing-crispr.html
2•birriel•29m ago•0 comments

Improving LM Studio's MLX Engine for Agentic Workflows

https://twitter.com/ostensiblyneil/status/2063006720616734835
2•tosh•32m ago•0 comments

There's a 137-Inch Bugatti TV Now, and It Folds

https://www.thedrive.com/news/theres-a-137-inch-bugatti-tv-now-and-it-folds
2•cf100clunk•33m ago•0 comments

Meshtastic Node Explained: Types, Range, Kits, and How to Choose the Best Setup

https://www.seeedstudio.com/blog/2026/03/17/meshtastic-node-guide/
2•RickJWagner•33m ago•2 comments

Computer Lessons

https://technicshistory.com/2026/06/06/computer-lessons/
1•cfmcdonald•35m ago•0 comments

Guardian 100 best novels (stats and errors)

https://mpaldridge.github.io/blog/guardian-novels.html
1•robin_reala•36m ago•0 comments

First Commodore PET sold, June 5, 1977

https://dfarq.homeip.net/first-commodore-pet-sold-june-5-1977/
3•erickhill•37m ago•0 comments

Show HN: Founder VC Horror Stories

https://rocketplace.org/stories
2•remarketme•38m ago•1 comments

K: Remarks on Style (1995) [pdf]

https://nsl.com/papers/style.pdf
1•tosh•39m ago•0 comments

Anthropic_API_key? Anthropic will bill your API account instead of your Max plan

https://old.reddit.com/r/ClaudeAI/comments/1tbaq2d/psa_if_your_project_has_an_anthropic_api_key_in/
3•behnamoh•41m ago•1 comments