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

Launching Meta Enterprise Platform

https://about.fb.com/news/2026/09/launching-meta-enterprise-platform/
1•thm•1m ago•0 comments

Black robin, once down to just a single breeding pair, wins NZ bird of the year

https://www.theguardian.com/world/2026/sep/21/nz-bird-of-the-year-2026-black-robin-wins-new-zealand
2•thunderbong•2m ago•0 comments

Damned If You Do, Damned If You Don't

https://scholarlykitchen.sspnet.org/2026/09/22/damned-if-you-do-damned-if-you-dont-multilingual-r...
1•jruohonen•3m ago•1 comments

LabMCP: Open-source connectors for AI-controlled lab instruments

https://www.k-dense.ai/blog/introducing-labmcp
1•CoderLim110•3m ago•0 comments

Atwood's Duck (2022)

https://themindcollection.com/atwoods-duck/
1•nizarmah•4m ago•0 comments

Why a style panel should know which components support breakpoint objects?

https://blog.crossui.com/2026/09/your-sx-prop-is-already-a-data-structure
1•linb•4m ago•0 comments

Show HN: I emulated Roborock's cloud so my vacuum works without internet

https://github.com/Python-roborock/local_roborock_server
1•Lash-L•4m ago•0 comments

Starship Flight 14 – Live Broadcast

https://x.com/i/broadcasts/1qxvvenMPMQxB
1•JumpCrisscross•4m ago•0 comments

What Sentry's 16GB selfhosted taught me

https://epure.sh/blog/sentry-self-hosted-ram-warning
2•nonmaskable•5m ago•0 comments

'I'm 100% natural': how Japan's 90-year-old bodybuilder is still winning titles

https://www.theguardian.com/world/ng-interactive/2026/sep/25/im-100-natural-japan-90-year-old-bod...
1•RickJWagner•5m ago•0 comments

The way we talk to bots matters even if they aren't conscious

https://psyche.co/ideas/the-way-we-talk-to-bots-matters-even-if-they-arent-conscious
1•RickJWagner•6m ago•0 comments

Public library visits increased by two million nationwide in two years

https://www.rte.ie/news/ireland/2026/0926/1592997-national-library-open-day/
1•austinallegro•6m ago•0 comments

It's hard to sell a house when it's covered in baboon faeces

https://www.theguardian.com/environment/2026/sep/27/baboons-cape-town-divided-over-plan-to-remove...
1•speckx•8m ago•0 comments

What is the AI capex breakeven rate?

https://www.ft.com/content/f83b44e9-406b-4004-9fdb-83357c3ac977
1•AnodicElegy•8m ago•1 comments

Five failure modes around fact retirement in agent memory, with measurements

https://medium.com/@dat999zx/five-failure-modes-around-fact-retirement-in-agent-memory-with-measu...
1•dat999zx•9m ago•0 comments

Defend VPNs

https://www.defendvpns.com/
2•DeepLogin•10m ago•0 comments

Show HN: Libreta – Financial Models in CSV and YAML

https://github.com/danielochoa94/libreta
2•danielochoa0620•11m ago•0 comments

Debugging Postgres Performance Under Row-Level Security

https://engineering.myhoai.com/posts/debugging-postgres-performance-under-row-level-security/
1•bucket2015•12m ago•0 comments

Redbrix – A browser-based MySQL editor for non-technical users

https://redbrix.io/
2•AndyGriff•13m ago•0 comments

The next AI divide is between learning and earning

https://www.weforum.org/stories/artificial-intelligence/ai-young-skills-jobs/
1•sarnet•13m ago•0 comments

Reification (Fallacy)

https://en.wikipedia.org/wiki/Reification_(fallacy)
2•peter_d_sherman•14m ago•0 comments

Simdjson 5.0 Is Out

https://lemire.me/blog/2026/09/28/simdjson-5-0-is-out/
2•ashvardanian•15m ago•0 comments

Stop the World

https://rruxandra.github.io/stop-the-world.html
1•rruxandra•15m ago•0 comments

Examples of Well-Worn Objects

https://www.core77.com/posts/145384
1•surprisetalk•16m ago•0 comments

SpaceX Starship Orbital Launch Attempt Starting in ~10 Mins

https://x.com/SpaceX
2•somenameforme•19m ago•1 comments

Anamnesis

https://vhbelvadi.com/anamnesis
2•speckx•20m ago•0 comments

Fusion Startup Builds Reactor with Magnetic Mirrors

https://spectrum.ieee.org/magnetic-mirror-fusion
3•sohkamyung•22m ago•0 comments

KiDex – component library manager for KiCad

https://kidex.io/en/
1•cagz•22m ago•0 comments

Scholarship, authorship and GenAI: claim your work

https://ecologyisnotadirtyword.com/2026/09/04/scholarship-authorship-and-genai-claim-your-work/
2•jruohonen•26m ago•1 comments

Trolley – PvP Trolley Problem

https://trolley.typememetics.institute/
3•thehappyfellow•30m ago•0 comments