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

Project Management in Your Repo

https://github.com/lovelace-co/lovelace
1•LambrosP•30s ago•0 comments

Show HN: LLM-budget-cap – atomic Redis spend cap for LLM APIs

https://github.com/Rentheria/llm-budget-cap
1•Rentheria•58s ago•0 comments

Show HN: Grounded-forge – RAG with summaries and task views precomputed ingest

https://github.com/chrisgagne/grounded-forge
1•chrisgagne•2m ago•0 comments

Show HN: Experimental freshness-first caching library for FastAPI

https://github.com/grandimam/zinda
1•grandimam•2m ago•0 comments

Technology Modernization Fund: Small Savings Achieved So Far

https://www.gao.gov/products/gao-26-107737
1•Jimmc414•5m ago•0 comments

Moss Is Generating Electrical Waves That Look Startlingly Like a Neural Network

https://www.sciencealert.com/moss-behaves-a-little-like-a-really-slow-brain-scientist-discovers
1•petethomas•6m ago•0 comments

How the most-used zero-knowledge proof system (Groth16) works

https://blog.zksecurity.xyz/posts/pudding-10-groth16/
1•baby•6m ago•0 comments

Demand for extra CPU capacity? Use a bug in POWER8 firmware

https://theibmi.org/2017/05/25/bug-in-mme-firmware/
1•rbanffy•6m ago•0 comments

One Schema for Every Eval

https://evalevalai.com/projects/every-eval-ever/
1•NickDouglas•8m ago•0 comments

Do Co-Located AI Training Jobs Synchronize?

https://arxiv.org/abs/2607.19638
1•Jimmc414•10m ago•0 comments

Rhino Horn, Leopard Skin and Tiger Claws Sold Openly on Facebook

https://www.bellingcat.com/news/2026/06/24/rhino-horn-leopard-skin-and-tiger-claws-sold-openly-on...
1•Jimmc414•10m ago•0 comments

Show HN: OpenTrust – Browser trust signals for the AI era

https://github.com/rafaelEt/opentrust
1•rafaeltadesse•11m ago•0 comments

Save Up to 70% on Claude Code Costs with PNG Prompts?

https://ai-karma-tracker.github.io/blog/pxpipe-png-prompts/
1•javatuts•11m ago•0 comments

Wreckage of Pan Am plane that shaped aviation safety found 74 years on

https://www.bbc.com/news/articles/cdrvyllxj71o
1•rmason•11m ago•2 comments

Sahil Lavingia – God Mode (Oct 2024)

https://sahillavingia.com/god
1•rmason•12m ago•0 comments

The Guide to Software Factories

https://twitter.com/zachlloydtweets/status/2077056692987027758
1•gmays•14m ago•0 comments

Ask HN: What verb best describes what a developer does in 2026?

2•jdlib•16m ago•1 comments

Show HN: Run Claude Code Through Codex, Kimi, Grok, or Cursor

https://github.com/raine/claude-code-proxy
1•rane•16m ago•0 comments

What 4,523 AI investment forecasts revealed about model disagreement

https://ipulseai.substack.com/p/4523-ai-forecasts-opposing-views
1•russlan•16m ago•0 comments

Show HN: Practice chess openings with a voice coach

https://chessmaster.alirizasaral.com
1•alirizasaral•18m ago•0 comments

A local RAG assistant for a Romanian government agency, built on an 8GB laptop

https://arxiv.org/abs/2607.18756
1•rotariuvladimir•19m ago•0 comments

How the OS Works [video]

https://www.youtube.com/watch?v=0y_2mZqP3cc
1•dalvrosa•20m ago•0 comments

BBC Sound Effects

https://sound-effects.bbcrewind.co.uk/
1•mellosouls•21m ago•0 comments

Where to find inspiration for a (reactive) personal website?

1•mryingster•21m ago•1 comments

DARPA Robotic mechanic for broken satellites launched

https://www.darpa.mil/news/2026/robotic-servicing-of-geosynchronous-satellites-lifts-off
1•GlenTheMachine•23m ago•0 comments

AI Agent Pull Requests on GitHub: Frequency, Structure, and Merge Conflict Rates

https://arxiv.org/abs/2607.04697
1•imrakibul•23m ago•0 comments

Are Agent Code Reviews for AI-Generated Code Worth It?

https://mattmccormick.ca/are-agent-code-reviews-for-ai-generated-code-worth-it/
1•mattm•24m ago•0 comments

The Solar Panel That Beats Silicon's Limit [video]

https://www.youtube.com/watch?v=vtmX0st3uOk
1•thelastgallon•24m ago•0 comments

AI Kill Switch Act [pdf]

https://lieu.house.gov/sites/evo-subsites/lieu-evo.house.gov/files/evo-media-document/ai-kill-swi...
1•bifftastic•24m ago•0 comments

Saudis must recognise Israel for nuclear deal, says Trump

https://www.bbc.com/news/articles/cwye71yq8wwo
1•thisislife2•25m ago•0 comments