frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

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

OpenAI is offering ChatGPT Plus to citizens of Malta for a year

https://www.engadget.com/2174473/openai-is-offering-chatgpt-plus-to-citizens-of-malta-for-a-year/
1•SpyCoder77•1m ago•0 comments

Assembly Language – Jesse Colin Jackson's Marching Cubes

https://www.creativeapplications.net/project/assembly-language-jesse-colin-jacksons-marching-cubes/
1•figomore•2m ago•0 comments

Your brain is always a fraction of a second behind the present

https://www.sciencefocus.com/the-human-body/brain-lives-past
2•amichail•4m ago•0 comments

Experimental weight-loss drug outperforms original GLP-1s

https://www.foxnews.com/health/experimental-obesity-drug-outperforms-traditional-weight-loss-trea...
2•paulpauper•6m ago•0 comments

We built a zero-telemetry Native Rust AI engine. (Ghost Lock included)

https://github.com/jrabbass/-esai-community-edition
1•jrabbass•7m ago•0 comments

Show HN: QuantTakeoff – Construction PDFs to takeoff and 3D scene

1•acaciabengo•10m ago•0 comments

Ane: CLI editor that uses LSPs to let agents explore/edit code with fewer tokens

https://github.com/prettysmartdev/ane
2•archnet•11m ago•0 comments

AI's eyes to help with component inspections

https://newsreleases.sandia.gov/ai-inspections/
1•hhs•11m ago•0 comments

Show HN: Where do I stand? – Household Health

https://wheredoistand.me/
1•vgrocha•14m ago•0 comments

Singapore Foreign Minister's Keynote at AI Engineer Singapore

https://www.youtube.com/watch?v=t-4a20_iYhg
1•doppp•16m ago•0 comments

White monkeys to make Chinese business look more global

https://www.theguardian.com/lifeandstyle/2026/may/16/fake-lawyers-scientists-chefs-punters-white-...
1•andsoitis•17m ago•1 comments

The mysterious disappearance of growth in US manufacturing: Was it China shock?

https://www.aeaweb.org/articles?id=10.1257/pandp.20261041
1•hhs•27m ago•0 comments

A Nicer Voltmeter Clock

https://lcamtuf.substack.com/p/a-nicer-voltmeter-clock
3•surprisetalk•33m ago•0 comments

'Transported' book review: Lost in a musical daydream

https://www.wsj.com/arts-culture/books/transported-review-lost-in-a-musical-daydream-83d8f76d
1•hhs•34m ago•0 comments

AI Memory Reader – Native macOS app for browsing Claude Code memory files

https://github.com/nvwalj/ai-memory-reader
2•nvwalj•37m ago•0 comments

The Futility of Lava Lamps: What Random Means

https://loup-vaillant.fr/articles/lava-lamps-and-randomness
1•birdculture•38m ago•0 comments

Living with Class

https://philosophersmag.com/living-with-class/
1•Wicher•42m ago•0 comments

Adonis was Sumerian before he was Greek

https://storica.club/blog/adonis-was-sumerian/
6•aralsamuel•42m ago•0 comments

Token spend breaks budgets – what next?

https://newsletter.pragmaticengineer.com/p/the-pulse-token-spend-breaks-budgets
4•eneveu•46m ago•1 comments

Wish You Were Her

https://www.nplusonemag.com/issue-53/essays/wish-you-were-her/
3•gmays•46m ago•0 comments

Hacker's Manual 2025 error at page 29

3•eahm•48m ago•0 comments

Mecha Comet's April Voyage – Open Modular Handheld on mainline Linux 7.0 kernel

https://mecha.so/blog/the-comets-april-voyage
1•walterbell•49m ago•0 comments

LeetCode Token Golf – Training for the interviews that matter

https://github.com/whitecell-dev/LeetCode-Token-Golf
2•MaykonMan•51m ago•0 comments

My -Tech

https://fingolas.eu/MyTech/
1•doener•52m ago•1 comments

A checkbox to enable the Django debug toolbar

https://mdk.fr/blog/django-debug-toolbar-checkbox.html
1•julienpalard•53m ago•0 comments

MCP Hello Page

https://www.hybridlogic.co.uk/blog/2026/05/mcp-hello-page
23•Dachande663•53m ago•10 comments

Zerostack – A Unix-inspired coding agent written in pure Rust

https://crates.io/crates/zerostack/1.0.0
34•gidellav•55m ago•2 comments

Jane Street Designed Its New Data Center: A Tour with Dwarkesh Patel [video]

https://www.youtube.com/watch?v=8J-GUnfSqeE
3•canarymark•56m ago•0 comments

Zerostack – Tiny Rust Coding Agent in 8MB of RAM

https://github.com/gi-dellav/zerostack/tree/main
3•gidellav•57m ago•0 comments

Steve Blank: Secret History of Silicon Valley (2008) [video]

https://www.youtube.com/watch?v=ZTC_RxWN_xo
1•stmw•59m ago•0 comments