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

Microsoft Quantum Development Kit

https://github.com/microsoft/qdk
1•andyjohnson0•3m ago•0 comments

Godot Foundation Receives donation of console porting technology from W4 Games

https://godotengine.org/article/godot-foundation-receives-donation-of-console-porting-technology-...
2•redbell•7m ago•0 comments

Falfurrias Capital Partners Makes Investment in B2B Influencer Marketing Firm

https://falfurrias.com/falfurrias-capital-partners-makes-majority-investment-in-freeman-forrest-t...
1•mooreds•10m ago•0 comments

Ludonarrative Dissonance

https://en.wikipedia.org/wiki/Ludonarrative_dissonance
1•nomilk•10m ago•0 comments

Self-Serve Drill Bits Are a CIAM Use Case

https://ciamweekly.substack.com/p/self-serve-drill-bits-are-a-ciam
2•mooreds•14m ago•0 comments

A Different Kind of High Agency

https://cutlefish.substack.com/p/tbm-454-a-different-kind-of-high
1•mooreds•15m ago•0 comments

Indeed job postings vs. interest rates paired with model releases

https://indeed-datasette.wasmer.app/chart
1•someguy101010•16m ago•0 comments

Gumption Traps for Agents

https://draft.caps.is/posts/gumption-traps-for-agents/
1•garmzon•17m ago•0 comments

V3K – Pure-Go Lossless Compressor, Domain Cartridges (and If It Beats Brotli-11)

https://github.com/thiag02011/hyperpack
1•thiag02011•17m ago•0 comments

The desire to be (seen as) smart [video]

https://www.youtube.com/watch?v=AikakFecTCs
1•joebig•17m ago•0 comments

Slate text editor – Goldilocks Design

https://github.com/jamesccupps/Slate
1•SpinningDisc•19m ago•1 comments

The AI backlash has arrived. Silicon Valley refuses to blink

https://www.latimes.com/business/story/2026-12-03/ai-backlash-has-arrived-silicon-valley-refuses-...
3•gwu78•22m ago•0 comments

What We Learned Running an LLM Honeypot Network

https://vectoral.com/blog/llm-honeypot-network
2•mlenhard•23m ago•0 comments

Tesla's Annual Meeting Proved It Needs a SpaceX Bailout

https://www.barrons.com/articles/tesla-stock-price-annual-meeting-spacex-0f4028f8
3•gwu78•27m ago•0 comments

Show HN: Fish Wrangler, my 2008 Facebook game, still running 18 years later

https://fishwrangler.com/
1•joefaron•27m ago•1 comments

Show HN: Job Board for Bicycle Jobs

https://bikejobboard.com/
2•Wdorf•29m ago•0 comments

Harvard is bad for your grandchildren

https://becomingnoble.substack.com/p/harvard-is-bad-for-your-grandchildren
2•osnium123•31m ago•0 comments

How to recover from secp256k1 breaking in crypto for bip32 wallets

1•jaekwon•32m ago•0 comments

One APE became 268M, and ApeChain is now switched off

https://blog.everstrike.io/one-ape-became-268-million-and-apechain-is-now-switched-off-2/
2•martin_hansen•33m ago•0 comments

Early stage guidance and seeeking for pre-seed investment

https://trulyhello.com
1•gutha9966•33m ago•0 comments

The Scientific 7-Minute Workout

https://www.nytimes.com/interactive/projects/well/workouts/7-minute-workout/
2•gurjeet•36m ago•0 comments

Is 256-bit ECC broken? A running timeline with notes and commentary

https://christophetd.fr/cryptopocalypse/
1•christophetd•37m ago•0 comments

Living and dying in a 3°C world

https://climatecasino.substack.com/p/living-and-dying-in-a-3c-world
3•andyjohnson0•39m ago•0 comments

Sameer Samat on X: "Android 18 Beta 1 is out

https://twitter.com/ssamat/status/2128987744303034634
2•OptionOfT•39m ago•1 comments

Is it just me or are you also being asked by YouTube to verify your age?

1•lubitelpospat•40m ago•1 comments

Editor Simon Winder looks back on a curious attempt to make philosophy popular

https://web.archive.org/web/20121026173659/http://thepenguinblog.typepad.com/the_penguin_blog/201...
1•eatitraw•40m ago•1 comments

Personal cryptography: the return of security via obscurity

https://praveshkoirala.com/2026/12/05/personal-cryptography-the-return-of-security-via-obscurity/
3•pkoird•41m ago•2 comments

Omamobile: Native Omarchy with a mainline kernel on mobile devices

https://omamobile.org/
1•SweetSoftPillow•42m ago•0 comments

CarlOS: Give your old Android a second life

https://trycarlos.dev/
1•als0•46m ago•0 comments

The Shepherds Release the Flock

https://www.math.columbia.edu/~woit/wordpress/?p=16018
1•xqcgrek2•46m ago•0 comments