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

Rescue Trucks at LaGuardia and JFK Get Trackers After Fatal Crash

https://www.nytimes.com/2026/08/31/nyregion/rescue-trucks-at-laguardia-and-jfk-get-trackers-after...
1•bookofjoe•1m ago•1 comments

SteamDB Joins Nexus Mods

https://steamdb.info/blog/steamdb-nexus-mods/
1•Nazar1ky•3m ago•0 comments

Taiwan's six-year hunt for China's undercover chip labs

https://restofworld.org/2026/taiwan-china-chip-investigations/
1•donohoe•4m ago•0 comments

VibeGuard – security linter for AI-generated code

https://github.com/zeroFhacker/vibeguard
1•obadafid•4m ago•0 comments

Emily Wilson is completely re-translating The Odyssey

https://apnews.com/article/emily-wilson-odyssey-translation-homer-a05084e4753528dff13766703161d24d
1•throw0101a•7m ago•0 comments

AI data center investment will top $1T by 2027, raising insurance exposures

https://beinsure.com/news/ai-data-center-investment-will-top-1trn/
1•Beinsure•7m ago•0 comments

This North Carolina County Is Taking Mug Shots Offline. Not Everyone Agrees

https://www.wsj.com/us-news/this-north-carolina-county-is-taking-mug-shots-offline-not-everyone-a...
1•impish9208•8m ago•1 comments

AmiGTA1 – A native AmigaOS 68k port of Grand Theft Auto is in the works

https://www.indieretronews.com/2026/08/amigta1-native-amigaos-68k-port-of.html
1•doener•11m ago•0 comments

Ame framinPII redaction and tamper-evident audit logs for LiteLLM, no sidecars

https://github.com/Rishikesh-glitch/Cloakwall-v0.1
1•Rishikesh-glitc•17m ago•0 comments

State of Postgres in 2026

https://www.datadoghq.com/state-of-postgres/
1•plaur782•17m ago•0 comments

CBallast – Quick Procurement Guide

https://cballast.com/
1•IndustrialProcu•18m ago•0 comments

Running in sari, 47-year-old woman wins race for daughters' education

https://www.edexlive.com/news/running-barefoot-in-sari-47-year-old-woman-wins-race-for-daughters-...
1•thunderbong•19m ago•0 comments

Why are there no flow batteries with symmetric ferrocyanide electrolytes?

https://chemisting.com/2026/09/02/why-are-there-no-flow-batteries-with-symmetric-ferrocyanide-ele...
1•DamonHD•19m ago•0 comments

Whose interview process has caught up to the new way of working?

1•verygoodenginee•22m ago•0 comments

DevWars – Battle for Attention

https://devwars.lol/
1•PatsTools•23m ago•0 comments

BRIMAR (STC) Tunograph, Visual Tuning Indicator

https://lampes-et-tubes.info/ti/ti014.php
1•Bluestein•24m ago•0 comments

Show HN: Make open-source contributions fun and meaningful

https://helpwanted.dev/
2•LeonidBugaev•25m ago•0 comments

My notes on Pre-Seed in 2026

https://twitter.com/brettcalhounn/status/2094800636000804978
1•tosh•26m ago•0 comments

The flame graph was wrong by 57×. So I'm building a profiler

https://minogin.com/the-flame-graph-was-wrong-by-57x-so-im-building-a-profiler/
1•minogin•30m ago•0 comments

Deployah v0.8.0: tasks, CronJobs, and an init wizard

https://deployah.dev/
5•atkrad•30m ago•1 comments

Fast Kernel Headers (2022)

https://lwn.net/ml/linux-kernel/YdIfz+LMewetSaEB@gmail.com/
1•tosh•32m ago•0 comments

Where will RISC-V be in 20 years? Poll results

https://thechipletter.substack.com/p/where-will-risc-v-be-in-20-years
1•klelatti•36m ago•0 comments

Show HN: Bags for Your Coins

https://www.21bags.io/
3•npguy•37m ago•0 comments

Show HN: Use AI API and scheduled Active Recall to pass any exam: LongTerMemory

https://longtermemory.com
1•aledevv•37m ago•0 comments

Show HN: Connection-Agnostic Presence Tracking for Distributed Back End

https://zenodo.org/records/21717242
1•duckydude20•37m ago•0 comments

Pmarca Guide to Personal Productivity (2007)

https://pmarchive.com/guide_to_personal_productivity.html
1•tosh•40m ago•0 comments

Internet Movie Cars Database

https://www.imcdb.org
2•dewey•42m ago•0 comments

Clean up your Android TV

https://tv.cobanov.dev/
1•giuliomagnifico•42m ago•0 comments

Three Common Misconfigurations in DMARC, BIMI, and SPF Records

https://senderledger.com/articles/three-common-misconfigurations-dmarc-bimi-spf
1•adulion•43m ago•0 comments

NATO DIANA announces 15 innovators to move forward to Mission Track

https://foxandlion.pub/news/nato-diana-announces-full-cohort-of-15-innovators-to-move-forward-to-...
5•ewfeber•46m ago•0 comments