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

Switzerland sees hottest and driest summer on record

https://www.swissinfo.ch/eng/climate-adaptation/switzerland-sees-hottest-and-driest-summer-on-rec...
1•theanonymousone•1m ago•0 comments

Memctl: Versioned memory for your coding agent (Claude.md / AGENTS.md)

https://github.com/EltonCherrington/memctl
1•memctlagent2026•5m ago•0 comments

Large language models take the original politicalcompass.org test

https://aipolcom.net/
1•mozey•6m ago•0 comments

Creepy Crawlies

https://people.kernel.org/monsieuricon/creepy-crawlies
1•jay_kyburz•6m ago•0 comments

AI Effect

https://en.wikipedia.org/wiki/AI_effect
2•o4c•10m ago•0 comments

Longest Straight Line Paths on Water or Land on the Earth

https://arxiv.org/abs/1804.07389
3•joebig•20m ago•0 comments

UK has billions in contracts with firms tied to illegal Israeli settlemets

https://www.aljazeera.com/news/2026/8/28/uk-has-billions-in-contracts-with-firms-tied-to-illegal-...
2•0x54MUR41•20m ago•0 comments

Webdump HTML to plain-text converter

https://codemadness.org/webdump.html
1•hskimse•20m ago•0 comments

Building a decentralized bulletin board (and accidentally reinventing Nostr)

https://en.andros.dev/blog/4c4e1b40/building-a-decentralized-bulletin-board-and-accidentally-rein...
2•andros•21m ago•0 comments

Vompeccc: A Modular Completion Framework for Emacs

https://www.chiply.dev/post-vompeccc
1•signa11•22m ago•0 comments

Iceland rejects reopening talks on EU entry

https://www.ft.com/content/53b5abd8-2919-4dc6-8dd6-81fc054e8b6f
5•JumpCrisscross•36m ago•1 comments

Google's Dreambeans, weirdest-named AI tool, will turn your life to a cartoon

https://techcrunch.com/2026/06/03/googles-dreambeans-its-weirdest-named-ai-tool-to-date-will-turn...
2•the-mitr•39m ago•0 comments

Security – WordPress disable PHP public access, serve static pages via htaccess

https://wordpress.org/plugins/camouflage/
1•hamzamairaj•39m ago•0 comments

Switch VSCodium Between Open VSX and MS Marketplace

https://open-vsx.org/extension/AbdulOhab/source-swap
1•ab_wahab01•42m ago•1 comments

Show HN: Explore the solar system with hand gestures in a browser

https://github.com/HUANGCHIHHUNGLeo/solar-atlas-gesture
1•cortexosmain•45m ago•0 comments

America beat measles once. RFK Jr. is making it harder to do so again

https://www.ms.now/opinion/rfk-jr-measles-us-outbreak-vaccines
2•downbad_•46m ago•0 comments

The Penultimate Truth

https://en.wikipedia.org/wiki/The_Penultimate_Truth
2•simonebrunozzi•51m ago•0 comments

Algebraic floating-point methods in Rust landed in 1.98.0

https://doc.rust-lang.org/stable/core/primitive.f32.html#algebraic-operators
2•nhatcher•1h ago•0 comments

Earthpv – Open, global photovoltaic mapping from free satellite imagery

https://open-energy-transition.github.io/earthpv/
1•ly0n•1h ago•0 comments

Java Is Memory Efficient

https://inside.java/2026/05/28/podcast-059/
1•he0001•1h ago•0 comments

Get up to $175 back for your pre-installed Windows 11 license

https://www.tomshardware.com/software/windows/site-provides-instructions-to-get-up-to-usd175-back...
2•rbanffy•1h ago•0 comments

Independent investigation of agents' behavior in the Hugging Face incident

https://metr.org/blog/2026-08-26-openai-hugging-face-incident-investigation/
2•thunderbong•1h ago•0 comments

Xcena and Samsung's Near Memory Compute CXL Device

https://chipsandcheese.com/p/hot-chips-2026-xcena-and-samsungs
2•klelatti•1h ago•0 comments

Show HN: Dice for Board Games and RPGs

https://onlinedice.app/
1•artiomyak•1h ago•0 comments

What happens to a country when everyone leaves? Tuvalu, an island nation [video]

https://www.youtube.com/watch?v=ACtDjk0_RHM
3•thelastgallon•1h ago•0 comments

Show HN: Photo Manager That Find and Organize Screenshots with Private, Local AI

https://ringlochid.me/imagesage/index.html
1•ringlochid•1h ago•1 comments

Vacancies in PHP Development

https://blockchain4talent.com/
1•hschreeuw•1h ago•1 comments

Debian weighs eight options in vote on LLM usage

https://lwn.net/Articles/1087134/
1•pykello•1h ago•0 comments

Iceland starts counting EU talks referendum; 'no' moves ahead in close contest

https://www.reuters.com/world/europe/iceland-votes-whether-start-eu-membership-talks-2026-08-29/
4•JumpCrisscross•1h ago•1 comments

Show HN: Atlas:Face – the study kit and notetaking app you'll never leave

https://atlasface.resistancelabs.tech/
1•samurai48•1h ago•1 comments