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

Show HN: Try SpikeUI (for free) and make .exe apps the easy way

https://nimoxi.com/spikeui/
1•Caronte3D•3m ago•0 comments

Ten Years of the Creative Independent

https://thecreativeindependent.com/ten-years/
1•cookingoils•3m ago•0 comments

Wall-mounted vegetable garden growing peppers over 2 meters tall [video]

https://www.youtube.com/watch?v=Wvb52q9TKKM
1•moltean•4m ago•0 comments

Qualcomm Unveils Snapdragon 8 Elite Gen 6 and Elite Extreme Gen 6

https://www.servethehome.com/qualcomm-unveils-snapdragon-8-elite-gen-6-and-elite-extreme-gen-6-ne...
1•cisc•11m ago•0 comments

Details of how Tumbler Ridge mass shooter used ChatGPT

https://www.cbc.ca/news/canada/british-columbia/mother-jones-chatgpt-safeguards-tumbler-ridge-bc-...
2•Alien1Being•13m ago•0 comments

Show HN: Twitter GIF Downloader and Conversation Browser-Based

https://twitee.co/twitter-gif-downloader
1•nohuman-labs•15m ago•0 comments

Getting root on OnePlus 15 from an untrusted app

https://blog.nns.ee/2026/09/24/oneplus-root/
1•shscs911•17m ago•0 comments

The Hannibal Directive

https://en.wikipedia.org/wiki/Hannibal_Directive
1•chasil•27m ago•1 comments

A free, keyless MCP Server for CVE data and per-CVE internet Exposure

1•echelongraph•37m ago•0 comments

Reelizer: Film Art, Curated

https://www.reelizer.com/about
1•thecosas•39m ago•0 comments

Stanford research suggests human brain might be two organs fused together

https://caliber.az/en/post/stanford-research-suggests-human-brain-might-be-two-organs-fused-together
2•wellpast•39m ago•1 comments

Earth microbes survive simulated conditions of Saturn moon's ocean

https://www.theguardian.com/science/2026/sep/25/earth-microbes-survive-conditions-enceladus-satur...
2•saikatsg•44m ago•0 comments

Technology and Marketing Law Blog

https://blog.ericgoldman.org/
2•peter_d_sherman•44m ago•0 comments

One, Two, Three, Eyes on Me (2017)

https://www.lrb.co.uk/the-paper/v39/n19/george-duoblys/one-two-three-eyes-on-me
2•Tomte•45m ago•0 comments

Show HN: The City – a native Mac app that shows Claude Code as a city of robots

https://github.com/Slaymish/theCity
1•slaymish•46m ago•0 comments

Show HN: Esh – English to Shell

https://github.com/numericalworks/esh
1•mindaslab•54m ago•0 comments

Unusual earthquake activity detected at site of former N. Korea nuclear facility

https://www.independent.co.uk/news/science/earthquake-north-korea-nuclear-mountain-mantap-b305227...
2•saikatsg•54m ago•0 comments

Online Sound Meter

https://asoundmeter.com/
1•artiomartiom•56m ago•0 comments

Citizenship Restored (2023)

https://www.lrb.co.uk/the-paper/v45/n18/daniel-trilling/diary
2•Tomte•59m ago•0 comments

Show HN: Practice ordering ramen from a Japanese ticket machine

https://ajin.im/is/building/kenbaiki/
1•poppypetalmask•1h ago•0 comments

The rise of the Jim Crow theobros

https://religionnews.com/2026/09/24/the-rise-of-the-jim-crow-theobros/
1•Anon84•1h ago•0 comments

Eikos - OSS Jev-like model

https://github.com/caiovicentino/eikos
1•emersonrsantos•1h ago•0 comments

Eliza Effect

https://en.wikipedia.org/wiki/ELIZA_effect
1•extr0pian•1h ago•0 comments

Solomon's Paradox

https://en.wikipedia.org/wiki/Solomon%27s_paradox
2•thelastgallon•1h ago•0 comments

Linux Unreal Tournament 2003 Master Server patch + Ultrawide and No Sound Fix

https://github.com/rokyed/ut2003-ultrawide-screen-patch
2•rokyed•1h ago•0 comments

Perfectly Replicating Red Bull Then Making It Caffeine-Free [video]

https://www.youtube.com/watch?v=7pTqGJ3KSLE
1•gw32•1h ago•0 comments

Hermann Weyl – Frank Aydelotte memorandum (1945)

https://albert.ias.edu/server/api/core/bitstreams/9feac6ca-38d1-4f5c-9876-75915f1a5762/content
1•georgecmu•1h ago•0 comments

Sydney retiree bids to be first to travel Australia on electric motorcycle

https://www.abc.net.au/news/2026-09-27/man-aims-to-travel-australia-on-electric-motorcycle/107190208
3•defrost•1h ago•0 comments

If we do not stop to help each other, what do we become?

https://blog.codinghorror.com/if-we-do-not-stop-to-help-each-other-what-do-we-become/
68•signa11•1h ago•13 comments

Nom Army: Don't trust coding agents when they say they're done

https://github.com/rayson-tech/nomarmy
3•RaysonTech•1h ago•0 comments