frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

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

External Clock Generation on RTX 50 Series

https://www.xtremesystems.us/post/external-clock-generation-on-rtx-50-series
1•mfro•3m ago•0 comments

Virtual Precision Clock

https://mitxela.com/projects/vpc
1•8organicbits•3m ago•0 comments

The American Missile Crisis

https://research.contrary.com/report/the-american-missile-crisis
1•JumpCrisscross•8m ago•0 comments

Texas Adds Another Solar Farm as Ercot Grid Demand Soars

https://electrek.co/2026/06/01/texas-adds-another-huge-solar-farm-ercot-grid-demand-soars/
2•m463•20m ago•0 comments

Perfect randomness realised for the first time

https://ethz.ch/en/news-and-events/eth-news/news/2026/05/perfect-randomness-realised-for-the-firs...
1•jonbaer•20m ago•0 comments

User-Replaceable Batteries Are Coming Back in a Big Way

https://www.theverge.com/column/939026/user-replaceable-batteries-eu-european-union-legislation
2•m463•22m ago•0 comments

Rsync and Outrage

https://medium.com/@tridge60/rsync-and-outrage-d9849599e5a0
5•st3fan•22m ago•0 comments

More police turn to simple drones clever effort to catch illegal e-bike riders

https://electrek.co/2026/06/02/more-police-turn-to-simple-drones-in-clever-effort-to-catch-illega...
1•Bender•23m ago•0 comments

China's Rise in Drug Development Looms over U.S.

https://www.nytimes.com/2026/05/30/business/china-lung-cancer-drugs-asco.html
1•lxm•24m ago•0 comments

PostgreSQL CLI Setup

https://sandrock.co.za/carl/2026/05/my-postgresql-cli-setup/
1•chthonicdaemon•24m ago•1 comments

The Four Signals of AI Observability

https://thoughtbot.com/blog/the-four-signals-of-ai-observability
1•iroha1203•26m ago•0 comments

HHS is overriding peer review to require changes to research scope, design

https://www.science.org/content/article/exclusive-hhs-now-weighing-science-nih-grants
2•SubiculumCode•31m ago•0 comments

NC lawmakers target 'addictive' apps in teen social media bill

https://www.wral.com/news/nccapitol/north-carolina-lawmakers-weigh-social-media-restrictions-unde...
2•01-_-•33m ago•0 comments

Florida sues OpenAI and CEO Altman, claiming company concealed serious risks

https://apnews.com/article/sam-altman-openai-lawsuit-florida-396d70c5a2d9bae7e95a8ee9adaef836
3•1vuio0pswjnm7•33m ago•0 comments

The case for memory safe desktop Linux distribution

http://fiedzia.blogspot.com/2026/06/the-case-for-memory-safe-desktop-linux.html
2•fiedzia•35m ago•0 comments

Vaping alters genes linked to cancer, heart and lung disease

https://www.dailymail.com/health/article-15866661/Vaping-genes-cancer-heart-lung-disease.html
1•Bender•35m ago•0 comments

The Bluesky firehose if everyone was messaging you

https://hah.spencer.place/messages
2•4lx87•36m ago•0 comments

GameStop Discloses First Quarter 2026 Results

https://investor.gamestop.com/news-releases/news-details/2026/GameStop-Discloses-First-Quarter-20...
1•mmh0000•38m ago•0 comments

A Whole Generation Seems to Be Using 'POV' Wrong

https://www.nytimes.com/2026/06/01/magazine/pov-gen-z-linguistics.html
2•lxm•42m ago•0 comments

Show HN: AI-Powered PDF to Markdown Converter

https://pdftomdconverter.com
1•QingWu•43m ago•2 comments

Google's $80B equity raise adds to that giant AI sucking sound

https://www.ft.com/content/2fe1fff9-f619-4a25-9b30-05bdc3bdea70
2•1vuio0pswjnm7•43m ago•0 comments

Back to the Metal

https://betocmn.com/blog/back-to-the-metal/
2•bertdc•44m ago•0 comments

AI Corporate Governance and Ben & Jerry's Risk

https://corpgov.law.harvard.edu/2026/05/11/ai-corporate-governance-and-ben-jerrys-risk/
1•ChrisArchitect•46m ago•1 comments

More harmful than helpful': young people sour on AI

https://www.ft.com/content/73fc962e-ce68-4521-9c5d-841a666eed10
3•1vuio0pswjnm7•47m ago•1 comments

Show HN: LiteHarness – One SDK for Claude Agent, OpenAI Agent, Pi AI

https://github.com/LiteLLM-Labs/lite-harness
1•ij23•57m ago•1 comments

Scott Pelley fired at CBS News after blowups with Bari Weiss,60 Minutes producer

https://www.foxnews.com/media/scott-pelley-fired-cbs-news-after-blowups-bari-weiss-new-60-minutes...
11•osnium123•1h ago•0 comments

Show HN: SeaTicket – AI agent that resolve issues from GitHub, email and forums

1•Daniel-Pan•1h ago•1 comments

The New Internet Era

https://blogs.newardassociates.com/blog/2026/titit-llms-and-internet.html
1•damowangcy•1h ago•0 comments

At the Autograph Show

https://oldster.substack.com/p/at-the-autograph-show
1•NaOH•1h ago•0 comments

Tab Tender – Split the bar tab in seconds

https://tabtender.app
1•MitchelRut•1h ago•1 comments