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

GPT-4 finished training four years ago today

https://twitter.com/gdb/status/2086092396023120286
1•nekofneko•1m ago•0 comments

Dithered QR Codes

https://www.andrewt.net/dithered-qr-codes/wtf/
1•jmusall•2m ago•0 comments

Big Tech Changed Health Care. The System Must Keep Up

https://www.newsweek.com/big-tech-changed-health-care-the-system-must-keep-up-opinion-12291938
1•brandonb•5m ago•0 comments

Show HN: VD – TUI Password Manager and OTP Authenticator for Unix

https://github.com/ahmedhosssam/vd
1•ahmedhosssam•7m ago•0 comments

Ask HN: If Social network is created today, what do you want to see?

2•kocial•9m ago•2 comments

The Fool (Tarot Card)

https://en.wikipedia.org/wiki/The_Fool_(tarot_card)
1•jackhalford•15m ago•0 comments

How AI is breaking the British State

2•andsoitis•17m ago•0 comments

You can build an AI agent's memory layer with only Go's standard library

https://towardsdev.com/the-memory-efficient-ai-agent-building-a-context-engine-in-go-d4b7557c44d8...
2•cheikhdev•17m ago•0 comments

Google DeepMind enters a new era as co-founder Demis Hassabis shifts AI role

https://www.theguardian.com/technology/2026/aug/08/google-demis-hassabis-deepmind-shifts-role
2•flancian•17m ago•0 comments

Ask HN: Why is Open POWER Foundation a wasteland?

2•climate_denier_•17m ago•0 comments

My server is a phone now

https://seg6.space/posts/phone-server/
2•seg6•18m ago•0 comments

Show HN: Try Benzi – A coding harness/agent beating Claude Code itself on Sonnet

https://benzi.fly.dev/about
1•showhz•19m ago•0 comments

Show HN: iPhone app takes simultaneous images from 2 lenses, fuses into 1 photo

https://photosynthesis.camera
1•sajomes•20m ago•0 comments

How to Handle a Difficult Colleague

https://www.thetrueengineer.com/p/surviving-the-workplace-how-to-handle
1•adletbalzhanov•21m ago•0 comments

Should you stop cracking your knuckles?

https://www.bbc.com/future/article/20260807-should-i-stop-cracking-my-knuckles
2•tchalla•31m ago•0 comments

Confessions of a Democratic Socialist [video]

https://www.youtube.com/watch?v=61tUsrNejRM
1•donsupreme•33m ago•0 comments

Shopify replaced Redis with MySQL for inventory reservations–and it scaled

https://shopify.engineering/scaling-inventory-reservations
3•adletbalzhanov•34m ago•0 comments

How Can LLM RL Work Despite Information-Theoretic Inefficiency

https://www.beren.io/2026-07-26-How-Can-LLM-RL-Work-Despite-Information-Theoretic-Inefficiency/
1•sshh12•34m ago•0 comments

Show HN: Turn tweets into beautiful, shareable photos

https://tweet.download/
1•azeemkafridi•38m ago•0 comments

Show HN: ExpertCache – Run the Full GPT-OSS 120B (63GB) on a 16GB M1 Pro

https://github.com/amos-labs/expertcache
1•rick_barkley•38m ago•0 comments

Show HN: Inertia – Not your Grandfathers animation editor

https://inertiagraphics.com/
1•hpen•40m ago•0 comments

SpaceX Earnings Reveal X's Shrinking Ad Biz

https://www.mediapost.com/publications/article/417046/spacex-q2-earnings-show-xs-shrunken-ad-biz....
4•keeda•41m ago•1 comments

Roku Fairgound, a new 24/7 AI slop channel

https://therokuchannel.roku.com/details/b484db42f3d31b6dc2f604d453c694a0/fairground-ai-creator-tv
2•timoth3y•41m ago•1 comments

Why I'm gone [video][59 mins]

https://www.youtube.com/watch?v=0VbyhUmtuBw
2•Bender•42m ago•0 comments

AI Settles a 25 Year-Old Problem We Left Behind

https://twitter.com/DimitrisPapail/status/2086158118354887060
4•amichail•45m ago•0 comments

Ask HN: Books Written for Polyglots?

1•s4074433•45m ago•0 comments

High-frequency trading firm just hired Bjarne Stroustrup (creator of C++)

https://www.efinancialcareers.com/news/a-high-frequency-trading-firm-just-hired-bjarne-stroustrup...
4•refp•45m ago•1 comments

Super Mario Derivations

https://fzakaria.com/2026/08/05/super-mario-derivations
3•mtlynch•46m ago•1 comments

Solar eclipse threatens to tighten Europe's electricity squeeze

https://www.ft.com/content/06a25d8d-77d8-4dd5-8cd6-a105423544b2
1•JumpCrisscross•47m ago•0 comments

You don't know what DevOps means

https://vsyrakis.dev/blog/you-dont-know-devops/
2•adletbalzhanov•50m ago•0 comments