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

Open-source Zen Engine is out of beta

https://docs.gorules.io/changelog
1•jawns•1m ago•0 comments

Initial focus for our partnership with Motorola is a regular non-folding device

https://grapheneos.social/@GrapheneOS/117136278553665985
1•Cider9986•4m ago•0 comments

In 1957, Disney Built Our Friend the Atom. We Now Need Our Friend the AI

https://medium.com/@chipmunkworks/the-disney-solution-why-silicon-valley-needs-to-build-our-frien...
1•treelover•5m ago•0 comments

Lie Detection and Language Models

https://philosophybear.substack.com/p/lie-detection-and-language-models
1•paulpauper•6m ago•0 comments

Plotter Related Algorithms

https://drawingbots.com/algorithms/
1•msurguy•10m ago•1 comments

Show HN: Pricefight – a website leaderboard where everyone starts at the bottom

https://pricefight.lol/
1•adjohu•12m ago•0 comments

Wind energy offers a lifeline for this Kansas rancher

https://vitalsigns.edf.org/story/wind-energy-offers-lifeline-kansas-rancher
1•thunderbong•12m ago•1 comments

Turn any REST API into the shape of another

https://bryanhu.com/shotgun/
1•thatxliner•16m ago•0 comments

Towards Physics of Multimodal Pretraining

https://arxiv.org/abs/2608.05000
1•gmays•18m ago•0 comments

Touareg CR after missile attack [video]

https://www.youtube.com/watch?v=AmCAjVvaqKE
1•debo_•22m ago•0 comments

Fighting Bot Traffic

https://markustenghamn.com/blog/fighting-bot-traffic
1•sukram•24m ago•0 comments

Whiteboard: Claim Your Pixels

https://whiteboard.lol
1•insomnie•26m ago•0 comments

Vibe coding personal apps in mid-2026

https://www.flourish.org/2026/08/personal-apps/
2•birdculture•27m ago•0 comments

The Horse and Sparrow Economic Theory

http://the13thtribe.blogspot.com/2025/03/the-horse-and-sparrow-economic-theory.html
1•thunderbong•28m ago•0 comments

Passive Investing and the Decline of Active Mutual Fund Alpha

https://papers.ssrn.com/sol3/papers.cfm?abstract_id=6902444
1•toomuchtodo•30m ago•1 comments

Underrated Terminal App

https://apps.apple.com/fr/app/onepilot-ssh-shell-terminal/id6759485908
2•elearia•40m ago•0 comments

Show HN: Updating my wedding registry website with AI in 275 commits

https://benhoyt.com/writings/updating-gifty-with-ai/
1•benhoyt•40m ago•0 comments

5 years on, Afghan girls still barred from education under Taliban

https://apnews.com/article/afghanistan-girls-excluded-secondary-education-taliban-618c7f5c7659d43...
2•gmays•41m ago•0 comments

Our classifier scored "I have never seen a shadow figure" as a sighting

https://theanomalynetwork.com/notes/negation
2•kyleclouthier•43m ago•0 comments

MileClerk – Automatic mileage logging and IRS export (MileIQ alternative)

https://mileclerk.onepingfanventure.com/
1•huangheus•44m ago•0 comments

How to Measure Chess Position Complexity

https://chesscheaterdetector.com/blog/how-to-measure-chess-position-complexity/
1•domhudson•46m ago•0 comments

Mockup Nvidia GPUs on Linux systems

https://github.com/rnts08/Mock-nvidia-gpu-linux
3•rnts08•46m ago•1 comments

Ox Alpha Is Performing SOTA and as Well as GPT-5.6 Sol in Multi-Agent Arena

https://twitter.com/olam_labs/status/2090930116138582224
2•sensho•48m ago•1 comments

Show HN: AI driven civic dashboard for Palo Alto

https://paloaltocivic.com
1•brianhama•48m ago•0 comments

Plural Form(s) in Translation(s)

https://doc.qt.io/archives/qq/qq19-plurals.html
1•zebreus•48m ago•0 comments

Intel Hyper Threading Performance on the Xeon 678X "Granite Rapids-WS"

https://www.phoronix.com/review/intel-xeon-678x-ht
1•rbanffy•49m ago•0 comments

Show HN: EchoVault, an app that interviews you and answers as you after death

https://apps.apple.com/us/app/echovault-digital-legacy/id6762042028
1•kingbillion1•51m ago•1 comments

Apt Groups and Operations

https://docs.google.com/spreadsheets/d/1H9_xaxQHpWaa4O_Son4Gx0YOIzlcBWMsdvePFX68EKU/edit
2•gurjeet•52m ago•0 comments

Peanut Allergy? Fecal Transplant Might Be a Solution

https://www.usnews.com/news/health-news/articles/2026-08-06/peanut-allergy-fecal-transplant-might...
2•gmays•53m ago•0 comments

Linus: "A debug session from hell, enormously helped by an AI"

https://github.com/torvalds/linux/commit/818bebeb63dd6bf5f4e07e145f6cdbace520a34c
4•dnw•57m ago•1 comments