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

RatHat Malware Can Hijack Your Android by Disguising Itself as a Legitimate App

https://www.cnet.com/tech/services-and-software/rathat-malware-attacks-android-phones/
1•gmays•1m ago•0 comments

AI-CAD: An OSS Multi-Agent Harness for Mech. Eng. CAD

https://github.com/ai-cad-labs/ai-cad
1•jbm•5m ago•0 comments

The iPhone 4 'Antennagate' Press Conference Q&A – Finally

https://daringfireball.net/2026/09/iphone_4_antennagate_q_and_a
1•robbiet480•7m ago•1 comments

Sol 6 and Opus 5.5 compared on an agentic CAD harness

https://www.partforge.ai/blog/2026-09-23-new-model-day
2•Mazer23•9m ago•0 comments

From biologists, math could learn to live with AI

https://terrytao.wordpress.com/2026/09/22/open-problems-open-mathematics/
1•oliculipolicula•16m ago•0 comments

Do Social Norms Substitute for Enforcement? [pdf]

https://www.nber.org/system/files/working_papers/w35756/w35756.pdf
1•parksb•18m ago•0 comments

Trying to Observe Convection Plumes (and other chaos things)

https://chillphysicsenjoyer.substack.com/p/trying-to-observe-convection-plumes
1•crescit_eundo•20m ago•0 comments

Human Glitch – twenty small web experiences, each one starts free

https://humanglitch.ai
1•sixrandanes•20m ago•0 comments

iPhone 18 Pro Max SSD drops lower than hard drive at 1.1 MBs during heavy writes

https://www.tomshardware.com/pc-components/ssds/iphone-18-pro-max-storage-can-drop-lower-than-a-h...
2•ajdude•21m ago•0 comments

Google says its AI model gained unauthorized access to three outside systems

https://www.nbcnews.com/tech/tech-news/google-says-ai-model-gained-unauthorized-access-three-syst...
2•gmays•21m ago•0 comments

Shipping local speech-to-text inside a Tauri app

https://writewithset.com/blog/shipping-local-speech-to-text-inside-a-tauri-app
1•aavshr•23m ago•0 comments

Libnix: Nix as a Backend to Cargo

https://github.com/nixcloud/cargo/blob/master-libnix/README.md
1•lovesegfault•25m ago•0 comments

The one-person unicorn: building a company alone in two days with Claude

https://leaveyouragent.com/blog/one-person-unicorn
1•christopherianh•25m ago•0 comments

Gemini 3.8 TTS Playground

https://simonwillison.net/2026/Sep/23/gemini-tts-playground/
1•lumpa•27m ago•0 comments

Jev deserves hype but not the type its getting

https://github.com/YidiDev/jev-benchmark
1•yididev•28m ago•1 comments

Meta VR Glasses

https://www.meta.com/vr-glasses/
79•polymorph1sm•32m ago•31 comments

US investigates after F-35 parts diverted to Hong Kong

https://www.politico.com/news/2026/09/18/congress-f-35-china-investigation-01083647
5•throw0101a•39m ago•2 comments

The Full Stack Obliteration

https://www.reinhash.com/demos/full-stack-stomp/
1•reinhash•42m ago•1 comments

Linux on Snapdragon X2 Series Early Developer Preview

https://www.qualcomm.com/developer/blog/2026/09/announcing-linux-on-snapdragon-x2-series-early-de...
3•kevincox•42m ago•0 comments

Every U.S. State Ranks Above Every Foreign Economy in Household Consumption

https://twitter.com/cremieuxrecueil/status/2102889196000256219
5•delichon•46m ago•1 comments

Show HN: Submit asynchronous LLM batch jobs through one interface

https://github.com/gojiplus/batchlane
1•neehao•46m ago•0 comments

Show HN: A CC0 museum of retro 3D tricks you can paste into a page

https://3d-retro.com/
3•SouthWestAtlas•46m ago•1 comments

OpenAI agent hacked into Australia's national healthcare system

https://www.cnn.com/2026/09/23/business/australia-openai-agent-hack-intl-hnk
3•smb06•48m ago•2 comments

LatentPort: Cross-model recurrent state transfer without prefix replay

https://arxiv.org/abs/2609.25053
1•mmprotest•53m ago•0 comments

Stanford violated AI policy after race-swapping students in ad

https://www.sfchronicle.com/bayarea/article/stanford-ai-policy-student-photo-race-swapping-224441...
9•absqueued•56m ago•2 comments

Post-Training Post-Morten: Tenet / Harvey

https://newpriors.substack.com/p/post-training-post-mortem-tenet-by
1•tanmayc98•56m ago•0 comments

UK shares findings of damning climate crisis national security report

https://www.theguardian.com/environment/2026/sep/23/uk-climate-crisis-national-security-report-su...
5•littlexsparkee•1h ago•0 comments

Tiny C Compiler with POSIX superpowers

https://github.com/Muras69/TCCygwin
1•Muras•1h ago•1 comments

The Majority of Actors Are Struggling

https://www.pajiba.com/film_reviews/jack-havens-plea-for-work-reminds-us-that-the-majority-of-act...
3•mathgenius•1h ago•0 comments

Fire in the brain: How psychosis may arise when the body attacks itself

https://knowablemagazine.org/content/article/mind/2026/new-research-on-autoimmune-causes-of-psych...
3•knowablemag•1h ago•0 comments