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

The Most Overlooked Taste in the World [video]

https://www.youtube.com/watch?v=zC1v19wfoTA
1•pinkmuffinere•2m ago•0 comments

Multiplayer Pong over SSH

https://antics.gg/ssh
2•thatslast•5m ago•0 comments

No More Camera Glasses – Even Realities

https://www.evenrealities.com/blogs/stories/no-more-camera-glasses-by-will-wang-founder-ceo-even-...
1•tash_2s•8m ago•0 comments

NAZA: Netanyahu orders identification and prosecution of film's interviewees

https://www.theguardian.com/film/2026/oct/12/naza-netanyahu-orders-identification-prosecution-int...
4•hebelehubele•11m ago•1 comments

OpenAI algorithm for the FFT is less a breakthrough and more a malicious exploit

https://www.argmin.net/p/faster-fourier-transforms
2•mochomocha•16m ago•0 comments

Climate Finder

https://weather.theojaffee.net/
1•bonefishgrill•16m ago•0 comments

Why does checking for software updates often take so long?

3•nick_•17m ago•1 comments

Lüften, or 'home burping,' yields sweet smell of success for your home

https://www.cpr.org/2026/06/24/home-burping-brings-outdoor-air-inside/
2•andsoitis•18m ago•0 comments

Leaving Tech

https://ryanbigg.com/2026/10/leaving-tech
64•jonahx•23m ago•39 comments

Kioxia, SanDisk show off the tiny chip which could go in first 1 PB SSD

https://www.techradar.com/pro/kioxia-sandisk-show-off-the-tiny-chip-which-could-go-in-worlds-firs...
2•peter_d_sherman•30m ago•0 comments

Woman who rescued injured crow keeps getting 'thank-you gifts' from birds [video]

https://www.youtube.com/watch?v=sjNpfz4UzqU
2•johnnyApplePRNG•30m ago•0 comments

Show HN: BellRun. Gamified Stock Trading

https://bellrun.com/office
3•twism•31m ago•0 comments

IsEven API

https://isevenapi.xyz/
3•basilikum•32m ago•2 comments

Army turning to AI in its fight against biological threats

https://defensescoop.com/2026/10/12/army-turning-to-ai-in-its-fight-against-biological-threats/
2•snarky-comments•33m ago•0 comments

Asus Hyper M.2 x16 Gen5 PCIe Card – up to four NVMe M.2 SSD's at up to 512 Gbps

https://www.asus.com/us/motherboards-components/motherboards/accessories/hyper-m-2-x16-gen5-card/
6•peter_d_sherman•36m ago•0 comments

Astrocytic Clock Controls Circadian PNN Remodeling, Synapse Strength, Learning

https://onlinelibrary.wiley.com/doi/10.1002/glia.70213
2•randomImmigrant•37m ago•1 comments

China Overtakes U.S. For First Time as Top Spender on R&D in 2024

https://japannews.yomiuri.co.jp/science-nature/science/20260908-347742/
11•mushstory•38m ago•0 comments

Show HN: MEF LLM Studio – Learn how LLMs generate text, token by token

https://www.mef-llm-studio.com/en/
3•walti1972•38m ago•0 comments

RustGIS – GIS in pure Rust for mapping, analyzing and sharing geospatial data

https://rustgis.app/
1•carnevalem•43m ago•0 comments

Could steam help California strawberry farmers grow more with fewer chemicals?

https://www.latimes.com/business/story/2026-10-09/could-steam-help-california-strawberry-farmers-...
3•thunderbong•48m ago•0 comments

I gave 16 IA's control of the AI nations in Humankind

https://mod.io/g/humankind/m/realpolitik
2•lcaresia•52m ago•0 comments

The Dock on Mac, from OS 10 to macOS 27

https://blog.jim-nielsen.com/2026/macos-dock-icons-over-time/
5•soheilpro•53m ago•0 comments

AI Models Can Provably Hide Arbitrary Capabilities

https://arxiv.org/abs/2610.13928
6•sbulaev•55m ago•0 comments

Show HN: Multi-FPGA Usable Newbie Chips

https://github.com/guilt/munch
4•vkaku•1h ago•0 comments

New OSS for Cloud Security Graph

https://opensourceom.org/
4•cyber_oss_coder•1h ago•1 comments

Can Postgres survive a bad query?

https://clickhouse.com/blog/can-your-postgres-survive-a-bad-query
1•saisrirampur•1h ago•0 comments

Show HN: Boxsh – a WASM shell sandbox that runs in the browser

https://www.npmjs.com/package/@boxsh/sandbox
4•cat-whisperer•1h ago•0 comments

Rae Greiner, "1909: The Introduction of the Word 'Empathy' into English"

https://branchcollective.org/?ps_articles=rae-greiner-1909-the-introduction-of-the-word-empathy-i...
5•bryanrasmussen•1h ago•0 comments

LittleJS is 2D and 3D now

https://frankforce.com/littlejs-is-2d-and-3d-now/
4•dmit•1h ago•0 comments

Diablo 2 in VR

https://github.com/bearstonem/d2r-pcvr
5•skolos•1h ago•0 comments