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

Years Late, Billions over Budget: California High-Speed Rail Hasn't Laid a Track

https://www.wsj.com/us-news/years-late-billions-over-budget-californias-high-speed-rail-hasnt-lai...
1•petethomas•53s ago•0 comments

Haiku R1 Beta 6 Released After 2 Years; BeOS Inspired Project Turns 25 Next Week

https://www.phoronix.com/news/Haiku-R1-Beta-6
1•mdp2021•1m ago•0 comments

Show HN: Forgot the Command? Stay in the Terminal

https://humansh.com/
1•mdarabi•1m ago•0 comments

Show HN: Contextual – local codebase memory for AI coding agents

https://contextuallabs.dev
1•aarjunm04•4m ago•0 comments

Meta settles for 18B over teen addiction

https://www.theguardian.com/technology/2026/aug/26/meta-social-media-addiction-trial-settlement
1•skor•6m ago•0 comments

Soju – Battle.net and Diablo II on Apple Silicon with a Free Wine Stack

https://github.com/BCD1210/soju
1•mikey9220•6m ago•0 comments

Misogynistic views are biggest red flag for violent extremism, report finds

https://www.abc.net.au/news/2026-08-25/rising-misogyny-in-young-people/107053640
2•rendx•9m ago•0 comments

Show HN: Trace where a link goes before opening it

https://securl.online/check-link
1•ktbatterham•11m ago•0 comments

Your AI Generated Menu Triggered My Trypophobia

https://shubhamjain.co/2026/08/27/ai-food-photos-trypophobia/
2•shubhamjain•14m ago•0 comments

What a century of data tells us about today's corporate bond spreads

https://www.ft.com/content/0a50dff4-27f4-46f1-9bdd-9dc047842b2e
2•latentframe•15m ago•0 comments

Amsterdam| Full Time, hybrid – HFT C++ Engineer – Low-latency systems

https://www.42.com/careers/hft-core-engineer
2•mardariya•15m ago•0 comments

How a Ukrainian commander sped through the 'kill zone' to save wounded troops

https://www.reuters.com/world/how-ukrainian-commander-sped-through-kill-zone-save-wounded-troops-...
2•petethomas•16m ago•0 comments

What is the Sapir-Whorf hypothesis? (1984) [pdf]

https://linguistics.berkeley.edu/kay/Kay&Kempton.1984.pdf
2•the-mitr•19m ago•0 comments

Vue Streaming Tutorial: Build a Live Video Streaming App with WebRTC (WHEP)

https://www.red5.net/blog/how-to-create-webrtc-publisher-clients-with-adaptive-live-encoding/
3•mondainx•20m ago•0 comments

The UK Power Grid Has a Phantom Data Center Problem

https://www.wired.com/story/uk-data-centers-logjam-ofgem-regulations/
3•kuuuzya•22m ago•1 comments

The Seniors Against Senior Housing

https://www.bloomberg.com/news/features/2026-08-19/senior-housing-faces-opposition-from-seniors-t...
2•littlexsparkee•25m ago•0 comments

Claudeforce

https://twitter.com/salesforce/status/2092741578045497762
2•tosh•26m ago•0 comments

Show HN: Flint

https://flint.thingg.co
3•aosmith•29m ago•0 comments

AWS billing bug causes 1000x increase in token prices

https://repost.aws/questions/QUveO4Hv5ITKmWvfoCNizR4A/from-1k-to-400k-monthly-usage-billing-with-...
3•nawitus•29m ago•1 comments

Launching Aroha Astrology – would love feedback from fellow founders

https://play.google.com/store/apps/details?id=com.aroha.astrology&hl=en_US
2•subir17•29m ago•0 comments

Whoop just made its most stylish band yet

https://mashable.com/tech/whoop-meridian-band-announcement-price
2•kuuuzya•29m ago•0 comments

Lounge Discussion

https://dis.tinychan.net/lounge/
2•allgirl•32m ago•1 comments

C can be memory-safe

https://blog.erratasec.com/2023/02/c-can-be-memory-safe.html
1•signa11•32m ago•0 comments

Why Israeli Authorities Are Encouraging Settler Violence Against Palestinians

https://www.newyorker.com/news/q-and-a/why-israeli-authorities-are-encouraging-settler-violence-a...
1•hebelehubele•32m ago•1 comments

Metaⁿ: Recursive Self-Improvement Through Emergent Depth

https://arxiv.org/abs/2608.24735
1•sbulaev•33m ago•0 comments

The U.K. Is Falling for Palantir's Salesmanship

https://foreignpolicy.com/2026/08/26/palantir-operator-starmer-united-kingdom-nhs-software/
3•CaptainZapp•33m ago•0 comments

Flat vs. segmented memory – it's recursive

https://www.humprog.org/~stephen/blog/2026/08/25/#flat-vs-segmented
1•signa11•37m ago•0 comments

Meta $16.68B settlement with 29 states

https://oag.dc.gov/release/attorney-general-schwalb-announces-meta-will-pay
2•Sentralis•39m ago•1 comments

Claudeforce

https://www.salesforce.com/claudeforce/?bc=HL
1•makeramen•42m ago•0 comments

Baltimore neighborhoods rely on private security to fill policing gaps

https://www.baltimoresun.com/2024/09/20/baltimore-neighborhoods-rely-on-private-security-to-fill-...
1•allgirl•42m ago•1 comments