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

Trump wanted Jensen Huang back. Now, the president is all alone in Washington

https://www.cnbc.com/2026/11/24/trump-jensen-huang-nvidia.html
1•donsupreme•3m ago•0 comments

Jensen Huang Spy Story Is a Hoax

https://www.kenklippenstein.com/p/jensen-huang-spy-story-is-a-hoax
2•vinyl7•6m ago•0 comments

Responding to objections to recursive self-improvement

https://www.dwarkesh.com/p/rsiobjections
1•gmays•7m ago•0 comments

Ontario police solve 1968 murder of teen Jackie Dunleavy using genetic genealogy

https://ici.radio-canada.ca/rci/en/news/2302539/london-ont-police-solve-1968-murder-of-teenager-j...
1•Teever•9m ago•0 comments

VP vs. VNP Explained and Animated

https://www.scott.xyz/clankers/vp/
1•clankers_shanno•9m ago•0 comments

Show HN: Rhebok – free local RAG for your coding agent

https://github.com/Stellenbosch-Technologies/rhebok
1•jagma•9m ago•0 comments

Using AI Without Losing Your Humanity

https://www.dbreunig.com/2026/11/24/using-ai-without-losing-your-humanity.html
1•dbreunig•10m ago•1 comments

Men in Tech YesAllMen [video]

https://media.ccc.de/v/emf2026-240-1-men-in-tech-yesallmen
1•vibebingo•15m ago•0 comments

Impossible volcanic eruption spotted in deepest part of the ocean

https://www.livescience.com/planet-earth/impossible-volcanic-eruption-spotted-in-deepest-part-of-...
1•gmays•15m ago•0 comments

Fujitsu Showcases 2nm Monaka Arm CPU at SC26 – Casrai

https://casrai.org/news/fujitsu-monaka-2nm-cpu-server-sc26-2026
1•rbanffy•16m ago•0 comments

Why each story made the Think Weirder Volume 2 cut

https://thinkweirder.com/v2/why/index.html
1•mojoe•17m ago•0 comments

Usage tiers and quotas for Google Workspace APIs and MCP servers

https://developers.google.com/workspace/guides/quota-usage-tiers
1•rahimnathwani•19m ago•1 comments

I Got Postgres into a Single Binary

https://progrium.xyz/articles/2026/single-binary-postgres/
1•birdculture•20m ago•0 comments

MountainGraph: Profiling data drawn as 3D landscapes

https://github.com/pcdv/mountain-graph
1•pacoverdi•21m ago•0 comments

Strongly Typed Variadic Functions in TypeScript

https://tgrecojs.com/posts/variadic-functions-in-typescript
1•tgrecojs•23m ago•0 comments

Predicting LoRA size for any dataset

https://engram.com/blog/lora-size
1•jxmorris12•24m ago•0 comments

IncludeOS: A minimal, resource efficient unikernel for cloud services

https://github.com/includeos/IncludeOS
1•turrini•24m ago•0 comments

EU capping imports of Chinese hybrids

https://www.theguardian.com/business/2026/nov/24/eu-cap-chinese-hybrid-ev-imports-tariff-uk
1•newAccount2025•26m ago•0 comments

Specialized brain cells help wasps recognize other wasp faces

https://news.wfu.edu/2026/11/23/specialized-brain-cells-help-wasps-recognize-other-wasp-faces/
1•gmays•26m ago•0 comments

AI is moving way too fast (Nate Silver)

https://www.natesilver.net/p/ai-is-moving-way-too-fast
1•abnry•26m ago•0 comments

A Year of Agentic Coding

https://inmve.github.io/agentic-coding-practices/
1•codeclimber•29m ago•0 comments

Meaningful Human-in-the-Loop GenAI Synthesis Checking for Restricted Languages

http://muratbuffalo.blogspot.com/2026/11/meaningful-human-in-loop-checking-of.html
3•matt_d•30m ago•0 comments

Anthropic CEO Dario Amodei and Sister Daniela Sold $561M in Stock During IPO

https://www.forbes.com/sites/siladityaray/2026/11/24/anthropic-ceo-dario-amodei-sold-280-million-...
7•Betelbuddy•31m ago•0 comments

Scan your social media data export for risky old posts, in the browser

https://chromewebstore.google.com/detail/easy-old-posts-checker-–/hfojhgibcgdcffcbimonoaobmaefggkf
1•easybulkclean•31m ago•0 comments

Fable 5.2 Tries Less on Some Hard Tasks When a Shortcut Is Available

https://goodhartlabs.com/blog/fable-5-2-tries-less-on-some-hard-tasks-when-a-shortcut-is-available
2•atlun•31m ago•1 comments

US Justice Dept announces 800 arrests of scammers in crackdown

https://www.upi.com/Top_News/US/2026/11/24/-justice-department-scammers-crackdown/8201795549582/
2•nephihaha•32m ago•0 comments

Incremental rust builds up to 92x faster

https://github.com/indexable-inc/blaze
1•alex_hirner•33m ago•2 comments

Things inspiring us to push the edges of our craft

https://edges.ideo.com/posts/25-things-inspiring-us-to-push-the-edges-of-our-craft
1•ioanarebeca•33m ago•1 comments

Building for Privacy: Securing the Mobile Network with Cape

https://buildexante.substack.com/p/building-for-privacy-securing-the
1•tony101•33m ago•0 comments

Unreal Engine 6 removes Blueprints and we're doing the exact opposite

https://luna-park.app/blog/unreal-engine-6-removes-blueprints
1•Herobrine2084•36m ago•1 comments