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

Practical Foundations for Programming Languages [pdf]

http://profs.sci.univr.it/~merro/files/harper.pdf
1•andsoitis•1m ago•0 comments

I made a byte-range cache for object storage

https://github.com/xav-db/range-cache
2•xavcochran•3m ago•1 comments

AI and Consciousness: A Skeptical Overview

https://www.cambridge.org/core/elements/ai-and-consciousness/E77C92088DA3C9F89E7FE7C75CBB1896
1•dhfbshfbu4u3•4m ago•0 comments

Artists Built a Site to Escape AI. Scrapers Are Coming for It Anyway

https://www.forbes.com/sites/robsalkowitz/2026/08/23/artists-built-a-site-to-escape-ai-scrapers-a...
1•PixelForg•7m ago•0 comments

Ask HN: MCP vs. Agent Harness

1•gpt4o•10m ago•1 comments

Hugging Face has been exploring a sale that could value it at $13B+

https://www.businessinsider.com/hugging-face-could-be-acquired-13-billion-2026-8
1•shscs911•11m ago•0 comments

I tested whether locking interface contracts helps AI app rebuilds

https://github.com/Parker-Fawcett/rebuild-dossier
1•Parker_Fawcett•12m ago•0 comments

Show HN: Agent Mayday

https://agentmayday.org
1•pingou•12m ago•0 comments

Training AI to Paint with Code

https://surya.website/rling-qwen-to-paint-with-code
3•Tiberium•17m ago•0 comments

Fixable Things That Make Life Harder for the Elderly, the Sick, and the Poor

https://abio.substack.com/p/11-fixable-things-that-make-life
3•fkozlowski•19m ago•0 comments

Regular Expression Engine for Scryer Prolog and ISO Prolog Systems

https://github.com/dougransom/regexp_dcg/
2•triska•19m ago•0 comments

'The Nerd Reich' tracks the 'unmasking of Silicon Valley's true politics'

https://www.npr.org/2026/08/10/nx-s1-5925350/the-nerd-reich-tracks-the-unmasking-of-silicon-valle...
14•rbanffy•21m ago•0 comments

Are America's Gulf bases worth rebuilding?

https://www.ft.com/content/6f664a31-ca24-4a16-a6e9-5978fdf2512c
3•tcp_handshaker•23m ago•1 comments

Google Workspace thinks my domain is an email provider

https://blog.elis.cc/articles/google-workspace-thinks-my-domain-is-an-email-provider/
2•el1s7•27m ago•0 comments

Can machines even be conscious?

https://crackedbeefcake.com/on/machines/
4•lazerjesus•27m ago•4 comments

Show HN: FramePin – Turn screen recordings into beautiful interactive guides

https://framepin.com/
3•aksuta•27m ago•0 comments

Show HN: Know the true cost of egg freezing upfront

https://eggfreezingfacts.org/
3•wowinter15•30m ago•0 comments

The $28,000 Course for an AI Job Nobody Quite Understands Yet

https://www.bloomberg.com/news/articles/2026-08-21/how-executives-are-training-to-become-chief-ai...
3•wslh•30m ago•1 comments

Controlling what information enters my mind

https://puffer.bearblog.dev/info-control/
2•Gecko4072•30m ago•0 comments

How I Find Problems to Solve as a Staff Engineer

https://lalitm.com/post/find-problems-staff-engineer/
10•vanpra•33m ago•3 comments

Claude reaching limits quickly then ever

3•gpt4o•33m ago•0 comments

Show HN: Cartopolis, 3D virtual world (Rust/Bevy/OSM)

2•jvanveen•35m ago•1 comments

Drydock – turn messy specifications into working software

https://webcloudstudio.com/
2•happyed•35m ago•2 comments

British Kids Are Skipping Top Colleges for White-Collar Apprenticeships

https://www.wsj.com/lifestyle/careers/british-kids-are-skipping-top-colleges-for-white-collar-app...
3•bookofjoe•36m ago•1 comments

My experience as a first time speaker

https://blog.guillheu.dev/articles/first-time-speaker/
2•crowdhailer•39m ago•0 comments

Show HN: Doop – open-source live canvas for AI agents to design

https://github.com/kgoedecke/doop
2•kgoedecke•42m ago•0 comments

Study: Men and women who marry early are poorer [pdf]

https://link.springer.com/content/pdf/10.1007/s12546-026-09430-4.pdf
2•rustoo•43m ago•0 comments

Hot Chips 2026: Samsung and HBM Base Die Opportunities

https://chipsandcheese.com/p/hot-chips-2026-samsung-and-hbm-base
2•pella•48m ago•0 comments

Mystery AI Model Ox Alpha Draws Developers with Free Access

https://www.bloomberg.com/news/articles/2026-08-23/mystery-ai-model-ox-alpha-draws-developers-wit...
2•tosh•50m ago•1 comments

Fable and the End of the Free Lunch

https://www.dbreunig.com/2026/08/23/fable-the-end-of-moore-s-law.html
10•dbreunig•50m ago•0 comments