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

Datasette Apps: Host custom HTML applications inside Datasette

https://simonwillison.net/2026/Jun/18/datasette-apps/
1•lumpa•31s ago•0 comments

Observation is the layer under taste. We built it for AI runtime

https://twitter.com/damnventures/status/2067394719756251468
14•Cherepukhin•4m ago•0 comments

How to Build ChatGPT from Scratch: Understanding LLMs Step by Step

https://nextweekai.com/blog/build-chatgpt-from-scratch-guide/
1•javatuts•9m ago•0 comments

AI Governance Cannot Be a Tool Call

https://tenureai.dev/writing/ai-governance-cannot-be-a-tool-call/
3•jflynt76•13m ago•0 comments

Captcha audio going nuts (concerning) [video]

https://www.youtube.com/shorts/lbPwZyNsCR0
1•threaderr•13m ago•1 comments

What I Learned from Being Burned Alive

https://www.wsj.com/lifestyle/what-i-learned-from-being-burned-alive-95e91c88
2•Anon84•22m ago•1 comments

Meta lobbies Congress for protection from child-harm lawsuits

https://www.reuters.com/world/meta-lobbies-congress-protection-child-harm-lawsuits-2026-06-18/
5•jethronethro•24m ago•0 comments

1992 view of the problems of computer programming in 1992

https://blog.plover.com/2026/06/18/#fortran-i
2•tjwds•24m ago•0 comments

AI Holdouts in Tech Face 3 Times Higher Layoff Odds, Gallup Finds

https://finance.yahoo.com/technology/ai/articles/ai-holdouts-tech-face-3-095310222.html
2•littlexsparkee•32m ago•1 comments

Teen summer employment is headed for its worst year since 1948

https://fortune.com/2026/06/18/teen-summer-jobs-record-low-2026/
2•cheschire•33m ago•1 comments

Did Massachusetts Legalize Haggis?

https://www.cbsnews.com/boston/news/haggis-massachusetts-legal-scotland/
2•speckx•45m ago•0 comments

Writing Postcards with a 3D Printer

https://severinbucher.com/posts/writing-postcards-with-a-3d-printer/
3•typesafeJ•46m ago•0 comments

The Job Market Is Thawing

https://www.theatlantic.com/newsletters/2026/06/job-market-hiring-may/687640/
5•littlexsparkee•46m ago•1 comments

How Meter Pricing Is Testing the Economics of AI

https://www.bloomberg.com/news/articles/2026-06-18/ai-costs-what-shift-from-flat-rate-to-token-pr...
2•1vuio0pswjnm7•47m ago•0 comments

Mae vs. MSE: more than just the mean vs. median debate

https://idlemachines.co.uk/essays/mae-vs-mse
1•smaddrellmander•48m ago•0 comments

Show HN: Flashback – an agent skill that references 127 years of design trends

https://toby.github.io/flashback/
3•tobypadilla•52m ago•0 comments

Show HN: Drydock – VM Sandboxes for macOS Autonomous Coding Agents

https://github.com/sricola/drydock
1•sricola•53m ago•0 comments

Standout Startups from YC's Demo Day, According to VCs

https://techcrunch.com/2026/06/18/the-11-standout-startups-from-ycs-demo-day-according-to-vcs/
3•simonpure•59m ago•0 comments

College students are swapping coding for healthcare: Goldman Sachs

https://finance.yahoo.com/economy/article/college-students-are-swapping-coding-for-healthcare-gol...
2•gbourne1•1h ago•1 comments

GitLab 19.1

https://docs.gitlab.com/releases/19/gitlab-19-1-released/
3•ilreb•1h ago•0 comments

Waymo Recalling 3,800+ Robotaxis over Risk of Entering Construction Zones

https://www.wsj.com/business/autos/waymo-recalling-more-than-3-800-robotaxis-over-risk-of-enterin...
3•1vuio0pswjnm7•1h ago•0 comments

HN Returning "Sorry."

2•christopher8827•1h ago•2 comments

Can LLMs change the hiring economics of legacy engineers?

https://exhaustedmind.substack.com/p/ask-hn-can-llms-change-the-hiring
1•Psychoterapist•1h ago•0 comments

Show HN: AA-Briefcase: a frontier knowledge work evaluation

https://artificialanalysis.ai/articles/aa-briefcase
10•declanjackson•1h ago•2 comments

The effect of worked examples on learning solution steps and knowledge transfer

https://www.tandfonline.com/doi/full/10.1080/01443410.2023.2273762
1•indigodaddy•1h ago•0 comments

Office workers of the world unite: it's time to revive the three-martini lunch

https://www.theguardian.com/commentisfree/2026/jun/18/three-martini-lunch
3•andsoitis•1h ago•1 comments

Haker Pra Free Fare

1•thaillan•1h ago•1 comments

Elon Musk's SpaceX plots $20B bond deal after record IPO

https://www.ft.com/content/8b73b4ce-3855-4b89-9110-3d892567f28a
2•JumpCrisscross•1h ago•0 comments

Ask HN: Any VPS / VPN with Dedicated IP Address in Cayman Islands?

1•JumpinJack_Cash•1h ago•0 comments

Update on Ocean Observatories Initiative

https://www.nsf.gov/news/update-ocean-observatories-initiative
67•andsoitis•1h ago•12 comments