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

Jonathan Glazer says Israel's retaliation over NAZA more venal than anticipated

https://www.theguardian.com/film/2026/oct/16/jonathan-glazer-says-israels-retaliation-over-naza-m...
1•mo7061•13s ago•0 comments

Processing My Father's Death by Climbing in His Footsteps

https://www.nytimes.com/interactive/2026/10/14/magazine/yosemite-climbing-dad-east-buttress.html
1•elemeno•3m ago•0 comments

I turned my brain MRI into an interactive 3D model you can explore

https://volodymyrsmirnov.github.io/brain/
1•vsmim•4m ago•0 comments

Show HN: Three philosophers vote on your questions

https://sage-verdict.vercel.app/
1•notkant•6m ago•0 comments

Order to limit Starshield for Ukraine came from inside White House, sources say

https://www.yahoo.com/news/articles/exclusive-order-limit-starshield-ukraine-230733575.html
2•pseudolus•10m ago•1 comments

GHC 9.14.1 is now bootstrappable from C via Hugs and MicroHs

https://discourse.haskell.org/t/what-s-needed-to-bootstrap-ghc-with-hugs/6205?page=5
1•internet_points•10m ago•0 comments

Where Your Data Lives Matters: EU Data Residency and Why We Run in Europe-West4

https://docent.digital/blog/eu-data-residency
2•hamedniavand•10m ago•0 comments

We reverse-engineered Blender and made it open source. Introducing BlenderCraft

https://reddit.com/r/blender/comments/1x79j0p/we_did_it_we_reverseengineered_blender_with_ai/
2•haunter•12m ago•0 comments

Creatine may help shield the brain from damage linked to gut inflammation

https://medicalxpress.com/news/2026-10-popular-sports-supplement-shield-brain.html
1•pseudolus•13m ago•0 comments

Writing Books with AI: How Do Manually Written Books Stay Relevant?

https://www.ssp.sh/brain/writing-books-with-ai-study/
3•zazuke•13m ago•0 comments

CVE-2026-99999: Linux IPv4: validate checksum_start before completing checksum

https://app.opencve.io/cve/CVE-2026-99999
1•rwmj•14m ago•0 comments

Pedantle – a game to find the words in a Wikipedia page

https://pedantle.certitudes.org/
1•thinkingemote•17m ago•0 comments

Unified Harness Protocol

https://unifiedharnessprotocol.org/
1•ilreb•17m ago•0 comments

The Case for Lowercase

https://www.wired.com/story/the-case-for-lowercase/
2•FinnLobsien•20m ago•1 comments

The People's Graphic Design Archive

https://peoplesgdarchive.org/
1•amar-laksh•24m ago•0 comments

Geoffrey Hinton: 'We're creating alien beings. I'm willing to choose humans'

https://www.theguardian.com/us-news/2026/oct/13/geoffrey-hinton-trump-ai-tech
5•Michelangelo11•25m ago•0 comments

C64-hw-SIM simulates the motherboard of the Commodore 64

https://github.com/antirez/c64-hw-simulator
2•sohkamyung•26m ago•0 comments

Python 3.14 Subinterpreters vs. Celery. Here is why my RAM usage dropped by 48%

https://pypi.org/project/solid-jobs-py/
2•nicolasva•26m ago•0 comments

Ask HN: Has anyone started using OpenAI Agents API

1•pitifulsurround•26m ago•0 comments

Behind the Scenes of Paper Writing

https://www.sophielwang.com/blog/paper-writing
2•sharma-arjun•28m ago•0 comments

Japan mistakenly issues warning for magnitude 9.9 earthquake

https://bnonews.com/index.php/2026/10/japan-mistakenly-issues-warning-for-magnitude-9-9-earthquake/
3•Shank•30m ago•1 comments

AI Safety Is Not a Corporate Plot

https://www.astralcodexten.com/p/ai-safety-is-not-a-corporate-plot
1•Michelangelo11•31m ago•0 comments

Unihertz won't release the GPL'd kernel source, so I ported LineageOS anyway

https://osquera.com/blog/unihertz-jellystar-lineageos-port/
3•osquera•36m ago•1 comments

Porn showing choking or incest to be banned in UK from early November

https://www.bbc.co.uk/news/articles/cmpqgepejr2ro
2•b800h•36m ago•3 comments

Neophyte combines capture and browser automation to capture product flows

https://neophyte.run/
1•cruink•36m ago•1 comments

Studio.Design Was Breached

https://violet353984.studio.site/updates/unauthorized-access-2026-10
1•amanverasia•37m ago•0 comments

Reverse Engineering Hong Kong's New Traffic Lights

https://thereallo.dev/blog/reverse-engineering-hong-kong-traffic-lights
1•tnychn•39m ago•0 comments

Ask HN: What world do you want to live in?

1•dfps•39m ago•1 comments

I recreated the Vision Pro palm-flip gesture on Apple Watch

https://github.com/Ag3497120/SpatialCue
1•kofuudai•40m ago•0 comments

Ledger Unveils $899 Smartphone After $90M Crypto Theft

https://www.bloomberg.com/news/articles/2026-10-15/ledger-unveils-899-smartphone-like-device-afte...
1•SXX•40m ago•0 comments