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

Australian Insurance Brands – AI Search Ranks

https://somantra.ai/aeo-research/australia/insurance/may-2026
1•prasaar•4m ago•0 comments

Learning another language appears to slow brain ageing by up to 13 years

https://www.theguardian.com/education/2026/jul/06/learning-another-language-appears-to-slow-brain...
1•giuliomagnifico•5m ago•0 comments

Microsoft PhotoDNA flags users child sexual abusers on images containing a grid

https://twitter.com/tallcowyt/status/2073904860182008174
1•miohtama•7m ago•0 comments

The Art of Computer Programming by Donald E. Knuth

https://www-cs-faculty.stanford.edu/~knuth/taocp.html
1•archargelod•9m ago•0 comments

Every AI Company Needs a Context Graph. None of Them Need the Same One

https://hydradb.com/blog/ai-context-graph-ontology-infrastructure
2•manveerc•13m ago•0 comments

Show HN: FCS – an open protocol for splitting contributions in pre-company teams

https://github.com/zlaska/FCS
1•zlaska•14m ago•1 comments

Effect HTTP Recorder

https://github.com/anomalyco/effect-http-recorder
1•handfuloflight•14m ago•0 comments

Maestro: Agentic Mobile UI Testing

https://maestro.dev/
2•handfuloflight•15m ago•0 comments

GPTBot is the most blocked crawler among websites that get organic traffic

https://sitestatsdb.com/explore/blocked-bots
1•keywordian•17m ago•0 comments

Steam Summer Sale Simulator

https://steamsalesimulator.com/
1•evo_9•17m ago•0 comments

EU to delay pre-authorised travel system after border chaos

https://www.ft.com/content/de332c29-8270-44d8-b535-aabc42692f03
2•JumpCrisscross•18m ago•1 comments

Why Gen Z is falling in love with film photography

https://theconversation.com/why-gen-z-is-falling-in-love-with-film-photography-282454
2•0in•21m ago•0 comments

Odin 1.0 Announcement

https://www.youtube.com/watch?v=dLPAqXi9In0
3•jhack•22m ago•0 comments

Loan – Stashfin

https://play.google.com/store/apps/details?id=com.stashfin.android&hl=en
1•Chirag12boss•29m ago•0 comments

Jet Engine on a Tractor: AI's Big Productivity Trap

https://www.uptimelabs.io/articles/jet-engine-on-a-tractor-ais-big-productivity-trap
1•aravindputrevu•31m ago•0 comments

Hayabusa2 captures images of asteroid Torifune

https://global.jaxa.jp/press/2026/07/20260706-3_j.html
1•pinewurst•33m ago•0 comments

How Prompt Tuning Improved GPT-5.5 in VS Code

https://code.visualstudio.com/blogs/2026/07/06/optimizing-vscode-coding-harness-model-providers
1•PieUser•33m ago•0 comments

Show HN: Slidown – Markdown to PowerPoint in pure Go, no AI in generation

https://github.com/Songmu/slidown
1•Songmu•33m ago•0 comments

Parents are blaming Snapchat for their teens' fentanyl deaths (2025)

https://www.latimes.com/business/story/2025-03-05/snap-lawsuit-fentanyl-death-teens
1•1vuio0pswjnm7•35m ago•0 comments

Show HN: Brunelly AI Native Platform v26.06

https://brunelly.com/
1•RihabAI•37m ago•0 comments

China built a 40-story tower that stores wind power by stacking concrete

https://boingboing.net/2026/07/06/post-china-built-a-40-story-tower-that-stores-wind-powe.html
2•eric_h•46m ago•0 comments

Supreme Court won't block Texas enforcing age verification law for app downloads

https://apnews.com/article/texas-age-mobile-app-verification-law-supreme-court-362137cccb26fc5f5d...
2•1vuio0pswjnm7•46m ago•1 comments

How Europe would fight without America

https://www.ft.com/content/ffd323d9-8a8c-4b67-ae0d-208c8f994ece
1•JumpCrisscross•49m ago•1 comments

Ask HN: Where do you hire interns for startups?

1•guptadeepak•50m ago•1 comments

Section 139(8A) of Income Tax Act: Guide, Rules and Benefits – SMFG India Credit

https://www.smfgindiacredit.com/knowledge-center/section-139-8a-of-income-tax-act.aspx
1•saumyaraut11•50m ago•0 comments

Xbox 'OG' Adventures

https://mamoniem.com/xbox-og-adventures/
1•davikr•52m ago•0 comments

"The Borgias" vs. "Borgia: Faith and Fear" (accuracy in historical fiction)

https://www.exurbe.com/the-borgias-vs-borgia-faith-and-fear/
2•walterbell•1h ago•0 comments

The Consciousness Atlas: Visualizing the Landscape of Consciousness

https://www.consciousnessatlas.com/
2•lucasrufkahr•1h ago•0 comments

The Socialist Temptation of Sam Altman

https://www.wsj.com/opinion/openai-government-sam-altman-donald-trump-ai-5b2676a2
4•thm•1h ago•0 comments

Show HN: Conquer the Top Leagues 38-0 Games

https://38-0.one/
1•cksmct•1h ago•1 comments