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

Meta Project OT plan to replace employees with AI agents

https://www.thestreet.com/technology/mark-zuckerberg-shocking-message-meta-employee-layoffs-artif...
3•elboru•10m ago•0 comments

Incorrect geo location for some Cloudflare WARP users – Cloudflare Status

https://www.cloudflarestatus.com/incidents/9g65dxfbcjln
1•kyisaiah47•11m ago•0 comments

Postgres isn't slow. Your storage is

https://clickhouse.com/blog/posette-talk-recap-postgres-isnt-slow-your-storage-is
2•gpavanb•20m ago•0 comments

President Trump Signs Executive Order to Create US Space Academy

https://www.nasa.gov/news-release/president-trump-signs-executive-order-to-create-us-space-academy/
5•efavdb•23m ago•1 comments

How-to-Dev

https://howtodev.vercel.app
1•kalleo•27m ago•0 comments

Tyler Cowen grills Acemoglu on liberalism, automation, edu elitism

https://www.youtube.com/watch?v=e5O1Y-5phEU
2•oliculipolicula•32m ago•0 comments

Infinite Interdimensional Cable

https://twitter.com/rehan_shei/status/2093528415576211819
2•nico•34m ago•1 comments

Hy4 Preview

https://hy.tencent.ai/research/hy4-preview
1•vismit2000•34m ago•0 comments

Ditch the 40-Ounce Water Bottle: You're Probably Hydrated Enough

https://www.wsj.com/health/wellness/ditch-the-40-ounce-water-bottle-youre-probably-hydrated-enoug...
1•Anon84•34m ago•3 comments

Show HN: Free English shadowing app for your own videos

https://github.com/TideSparrow/shadowing-english
1•markyuan123•39m ago•1 comments

FreeCORE TrueNAS Core – Continued

https://freecore.org/
22•sashk•40m ago•8 comments

China is fueling America's data center rage

https://www.axios.com/2026/08/28/china-ai-data-center-backlash-bots
5•ksec•40m ago•4 comments

Hirigana and Katakana keyboard touch type practice

http://thefreeschool.info/hirigana.html
1•dosmithds2060•51m ago•0 comments

I feel like AI start being a reflect of the CEO behind it (his political)

https://baseline-rouge-mu.vercel.app/
1•SachaSOL•51m ago•1 comments

I Tried to Trick Pangram. I Lost

https://awaitinginput.substack.com/p/i-tried-to-trick-pangram-i-lost
2•bsovran•52m ago•0 comments

A glacier collapse triggered a deadly landslide and flooding

https://www.reuters.com/graphics/NEPAL-FLOODS/MAP/byvrdywwlve/
2•mdani•58m ago•1 comments

Benjamin Franklin's Alter Egos Gave Him the Most Freedom

https://www.smithsonianmag.com/history/among-all-great-things-benjamin-franklin-invented-discover...
3•cisc•1h ago•0 comments

Anthropic's Claude for Mac desktop app now has built-in browser

https://thenewstack.io/claude-built-in-browser-cowork/
2•thoughtpeddler•1h ago•0 comments

Anthropic was illegally blacklisted by the Trump administration, court rules

https://www.theverge.com/ai-artificial-intelligence/985947/anthropic-supply-chain-risk-lawsuit-ju...
2•sbulaev•1h ago•0 comments

Show HN: Turn your GitHub activity into a receipt

https://receipthub.io/github
1•sleepy_duck•1h ago•0 comments

AI is changing religion and religions are trying to change AI

https://economist.com/international/2026/08/27/ai-is-changing-religion-and-religions-are-trying-t...
1•andsoitis•1h ago•0 comments

ProveIT – a short game to help you learn how formal proofs work in Logic

https://voxelrifts.itch.io/proveit
1•vismit2000•1h ago•0 comments

.

https://economist.com/international/2026/08/27/ai-is-changing-religion-and-religions-are-trying-t...
1•andsoitis•1h ago•0 comments

Crbro – Local, file-based persistent memory for AI agents (MCP)

https://github.com/Octonove/crbro-memory
1•cerebromcp•1h ago•0 comments

Cancer vaccine shows promise in preventing recurrence of melanoma

https://www.nbcnews.com/health/health-news/merck-moderna-say-melanoma-vaccine-promise-prevent-rec...
1•gmays•1h ago•0 comments

He co-founded Burning Man. It was the least interesting thing he ever did

https://www.sfgate.com/sf-culture/article/burning-man-co-founder-least-interesting-thing-20826295...
2•andsoitis•1h ago•0 comments

Build Your Customer Service Team with AI Agents

https://aimujib.com/
2•anaspro•1h ago•1 comments

Why America's prisons are shrinking and racial gaps are closing

https://www.nature.com/articles/s41562-026-02536-y
3•marojejian•1h ago•2 comments

Open Oscar Server: open-source server compatible with AIM and ICQ clients

https://github.com/mk6i/open-oscar-server
3•gregsadetsky•1h ago•2 comments

Show HN: HN Mirror with Image Previews

https://hackernews.beliantech.com/
1•ernsheong•1h ago•1 comments