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

The Manufactured Normalcy Field

https://www.urbanhonking.com/index.html
1•nvader•42s ago•0 comments

Freenet: A Peer-to-Peer Platform for Real-Time Decentralized Apps (Whitepaper) [pdf]

https://freenet.org/pdf/freenet-whitepaper.pdf
1•sanity•3m ago•0 comments

An Open Call to Flipper Devices: Problems with Flipper and How They Can Improve

https://spicemesh.de/posts/open-call-to-flipper/
1•muxdervish•3m ago•0 comments

Dusklight is a reverse-engineered reimplementation of Twilight Princess

https://github.com/TwilitRealm/dusklight
1•Plasmoid•7m ago•0 comments

TP-7 Field Recorder

https://teenage.engineering/products/tp-7
2•nirkalimi•9m ago•1 comments

Clippy Config Should Be Stricter

https://emschwartz.me/your-clippy-config-should-be-stricter/
1•birdculture•14m ago•0 comments

Tokenization Is the Bottleneck You're Not Measuring

https://ranvier.systems/2026/05/25/tokenization-is-the-bottleneck-youre-not-measuring.html
1•mindsaspire•16m ago•0 comments

ContextVault – Local-First AI Conversation Recorder for ChatGPT, Claude, Gemini

https://context-vault-two.vercel.app/
1•aliabdm•19m ago•0 comments

I built a new app and I don't know how I feel about it

https://philna.sh/blog/2026/05/25/i-built-a-new-app-and-i-dont-know-how-i-feel-about-it/
1•philnash•20m ago•0 comments

What is 'pink-slime' journalism and has it infiltrated Australian media?

https://www.abc.net.au/news/2026-05-22/pink-slime-journalism-regional-australia-ai/106639600
2•MarxOk•26m ago•0 comments

The UX Cost of Swipe Culture

1•BrittanyHale•27m ago•0 comments

Radvd 2.21 – Linux IPv6 Router Advertisement Daemon

https://radvd.litech.org/
1•neustradamus•27m ago•0 comments

AlphaProof Nexus is out, but Hassabis said solving Erdős isn't real invention

https://www.youtube.com/watch?v=bgBfobN2A7A
1•muditsrivastava•28m ago•0 comments

Creating a More Human Online Dating Experience

https://nataliyajr.blogspot.com/
2•NicoleCarterhj•28m ago•0 comments

Presentation and promulgation of the Encyclical Letter "Magnifica humanitas"

https://www.vatican.va/content/leo-xiv/en/events/event.dir.html/content/vaticanevents/en/2026/5/2...
1•KnuthIsGod•29m ago•2 comments

Sweden now considered a smoke free country

https://www.sverigesradio.se/artikel/sweden-now-considered-a-smoke-free-country
2•aleda145•30m ago•0 comments

Wyoming Company Uses High-Tech AI Sprinklers to Save Homes from Wildfire

https://cowboystatedaily.com/2026/05/25/wyoming-company-uses-high-tech-ai-sprinklers-to-save-home...
1•Bender•31m ago•1 comments

Ask HN: How do you get Internships with no work experience but cool projects?

1•dragonsenseiguy•33m ago•0 comments

Stack Overflow Sold to Tech Giant Prosus for $1.8B (2021)

https://www.wsj.com/business/deals/software-developer-community-stack-overflow-sold-to-tech-giant...
4•poly2it•35m ago•1 comments

Leadwerks Game Engine 5.1 Beta Releases with Support for "Potato PCs"

https://www.leadwerks.com/community/blogs/entry/2896-leadwerks-51-beta-is-now-available-with-supp...
3•Josh_Klint•48m ago•0 comments

Promising One and done heart disease genetic therapy

https://www.nytimes.com/2026/05/25/health/cholesterol-ldl-gene-therapy.html
2•anjel•55m ago•0 comments

CVE-2026-28952: Apple macOS 26.5 Kernel Vuln found by Claude

https://support.apple.com/en-us/127115
31•dragonsenseiguy•56m ago•1 comments

Google is its own worst enemy

https://disconnect.blog/google-is-its-own-worst-enemy/
7•cdrnsf•56m ago•0 comments

The Vatican-Anthropic relationship that's reshaping the AI ethics debate

https://religionnews.com/2026/05/22/why-anthropic-is-helping-unveil-the-popes-new-encyclical-on-ai/
4•cdrnsf•57m ago•0 comments

Performance of Rust Language [pdf]

https://github.com/yugr/rust-slides/
2•tanelpoder•59m ago•0 comments

Vim Classic

https://vim-classic.org/
3•GalaxyNova•1h ago•0 comments

SkiFreedle, a daily game version of SkiFree (1991)

https://skifreedle.com/
2•gfysfm•1h ago•1 comments

LLMs require curated context for reliable political fact-checking

https://arxiv.org/abs/2511.18749
2•teleforce•1h ago•0 comments

I Found the Lost Amiga Unix 2.02 [video]

https://www.youtube.com/watch?v=sDei4Tyo6yA
1•zdw•1h ago•0 comments

Secure TUI to Monitor Docker

https://toricli.sh
2•imbobbytables•1h ago•0 comments