frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Ask HN: Help with doing statistics over machine code

2•phafu•7mo 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•7mo 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•7mo 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).

Making the Most of Bit Arrays in Gleam

https://gearsco.de/blog/bit-array-syntax/
1•crowdhailer•20s ago•0 comments

Variable Size MoEs

https://hbfreed.com/2025/12/16/variable-size-experts.html
2•hbfreed•2m ago•0 comments

Hardware-Attested Nix Builds

https://garnix.io/blog/attested-nix-builds/
1•todsacerdoti•5m ago•0 comments

De Tocqueville and the French Exception

https://www.economist.com/interactive/primers/liberalism/primer-2
1•finghin•6m ago•1 comments

Project Vend: Phase Two

https://www.anthropic.com/research/project-vend-2
1•dcre•7m ago•0 comments

Show HN: A lightweight DLP browser extension to prevent data leaks in LLM tools

https://www.asturic.com/
1•__alberto•7m ago•0 comments

Relocating for Tech Jobs in 2026

https://relocateme.substack.com/p/tech-talent-relocation-forecast-for
1•andrewstetsenko•7m ago•0 comments

Byrne and Storm's UK Online Safety Act Year in Review for 2025

https://prestonbyrne.com/2025/12/18/byrne-storms-uk-online-safety-act-year-in-review-for-2025/
1•iamnothere•7m ago•0 comments

Show HN: Call Santa AI with your kids. My new side project

https://callsantatonight.com/
1•s-stude•8m ago•0 comments

Ask HN: PMs using Linear: how do you keep decision context from getting lost?

1•istvan_intrnd•11m ago•0 comments

America's work-from-home capitals are in a sorry state

https://www.economist.com/graphic-detail/2025/11/27/americas-work-from-home-capitals-are-in-a-sor...
2•campuscodi•11m ago•1 comments

Principles of AI Product Design: Keep the User in the Driver's Seat

https://blog.dfeldman.co/principles-of-ai-product-design-keep-the-user-in-the-drivers-seat-170ae4...
1•schvenk•12m ago•1 comments

Show HN: MiraTTS, a 48kHz Open-Source TTS at 100x Real-Time Speed

https://github.com/ysharma3501/MiraTTS
1•Yatharth3501•13m ago•0 comments

Frontier AI Trends Report

https://www.aisi.gov.uk/frontier-ai-trends-report
1•jacekm•14m ago•0 comments

In secret missile factory, Ukraine is ramping up its domestic arms industry

https://www.bbc.co.uk/news/articles/c1dz6wgn2w9o
3•dredmorbius•14m ago•0 comments

Lunar impact flash detected on the Moon

https://armaghplanet.com/lunar-impact-flash-detected-on-the-moon-by-armagh-observatory-and-planet...
2•stevenjgarner•15m ago•0 comments

React Handbook

https://devouringdetails.com/resources/react-handbook
1•onuar•15m ago•0 comments

Trump Media to merge with nuclear fusion firm in $6B deal

https://www.bbc.co.uk/news/articles/cp9kv9lld38o
3•iamflimflam1•16m ago•0 comments

Show HN: Codeboards – A Developer Portfolio That Updates Itself

1•mkozak•17m ago•0 comments

Example for Minimalist Software Design

https://pokerino.io
1•swupel•17m ago•0 comments

Response Healing: Reduce JSON Defects by 80%+

https://openrouter.ai/announcements/response-healing-reduce-json-defects-by-80percent
8•numlocked•17m ago•0 comments

Em Dash in Reddit Comments, Interactive

https://intervolz.com/emdash-observer/
5•intervolz•18m ago•1 comments

Facebook tests £9.99 monthly subscription for sharing more than two links

https://www.bbc.com/news/articles/cp9kv3lezgro
1•victorbuilds•18m ago•0 comments

A little bit uncomfortable – All Things Distributed

https://www.allthingsdistributed.com/2025/12/a-little-bit-uncomfortable.html
2•rbanffy•18m ago•0 comments

McCarthy's 91-function: an unfortunate paradigm (EWD 845)

https://www.cs.utexas.edu/~EWD/transcriptions/EWD08xx/EWD845.html
2•throwoutway•19m ago•0 comments

A Codebase by an Agent for an Agent

https://ampcode.com/by-an-agent-for-an-agent
1•misternugget•21m ago•0 comments

Recommend a web article to speech tool

2•a99c43f2d565504•21m ago•1 comments

Helical rover wheel balloons from 9 to 20 inches and survives fire

https://newatlas.com/space/expanding-airless-wheel-fire-damage-resistance/
1•thunderbong•23m ago•0 comments

Amazon is prospective tenant for data center developer rocked by stock plunge

https://www.businessinsider.com/fermi-america-amazon-tenant-texas-data-centers-2025-12
1•ilamont•24m ago•0 comments

What does Game theory have to do with physical AI and the Space Race?

https://nervousmachine.substack.com/p/the-epistemic-barrier-of-siloed-physics
1•nervousmachine•24m ago•0 comments