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

From Rg to Zg: Local Search Beyond Keywords

https://zvec.org/en/blog/2026-08-28-zvec-grep-open-source/
1•fang2hou•19s ago•0 comments

Statutory Copyleft

https://www.thomas-huehn.com/statutory-copyleft/
1•Tomte•2m ago•0 comments

Tech Pilgrims Flock to China

https://www.reuters.com/world/china/tech-pilgrims-flock-china-global-innovation-race-heats-up-202...
1•TechTechTech•2m ago•0 comments

Brave for Desktop Outperforms Other Browsers in Speed and Performance

https://brave.com/blog/brave-outperforms-other-browsers/
2•crbelaus•4m ago•0 comments

Germany on track for strongest GDP growth since 2022

https://www.ft.com/content/6b396499-d71d-4e8f-b2a4-66318b1d9426
2•mertbio•5m ago•1 comments

Outdoor displays fail in places you don't expect

https://duobond-display.com/news/display-interfaces-system-integration/532.html
1•Todorov•7m ago•0 comments

Hackers Don't Break in Anymore, They Log In

https://redmondmag.com/articles/2026/03/10/hackers-dont-break-in-anymore.aspx
1•janandonly•8m ago•0 comments

Show HN: Shri-io – a privacy-first, self-hosted URL shortener

https://github.com/barats/shrl-io
1•baratsemet•8m ago•0 comments

AI and the collapse of the intelligence-based hierarchy of merit

https://mattbruenig.com/2026/08/31/more-thoughts-on-ai/
1•rzk•13m ago•0 comments

Do you code in silence or do you listen to music?

https://textlog.cc/post/1078
2•stagas•14m ago•0 comments

Reticulum Is Not a Democracy

2•supernihil•16m ago•0 comments

Code Review Is Dead?

https://gioorgi.com/2026/code-review-dead/
1•daitangio•16m ago•1 comments

False Completion Is the Real Failure Mode of Coding Agents

https://medium.com/@giladha/false-completion-is-the-real-failure-mode-of-coding-agents-744be5a8c9c4
1•giladha•19m ago•0 comments

Apple Speech vs. Whisper: How Good Is Apple's New SpeechAnalyzer?

https://whispernotes.app/blog/apple-speech-vs-whisper
1•mazzystar•19m ago•0 comments

AI agents carried out every step of this ransomware attack – then left

https://www.theregister.com/security/2026/09/02/ai-agents-carried-out-every-step-of-this-ransomwa...
2•sbulaev•20m ago•0 comments

Why Ilya Sutskever's $32B SSI Valuation Highlights a Fatal Epistemic Vacuum

https://zenodo.org/records/22162749
1•AaRubinstein_CA•21m ago•0 comments

Three schoolgirls in Kinsale pulled up a pea plant covered in warts

https://scienceblog.com/b-three-schoolgirls-in-kinsale-pulled-up-a-pea-plant-covered-in-warts-and...
3•DamonHD•23m ago•1 comments

The Download: AI puzzles and a path to our nearest star system

https://www.technologyreview.com/2026/09/02/1143283/the-download-ai-puzzles-alpha-centauri-mission/
1•joozio•25m ago•0 comments

Sandbox

2•cyteeditor•25m ago•0 comments

Chat Bots Compared: An interactive quiz to find AI companions

https://chatbotscompared.com/
1•Sharanxxxx•25m ago•0 comments

Pre-Release of Polars 2.0

https://pola.rs/posts/announcing-polars-2/
2•komape•28m ago•0 comments

The birthday paradox and why hashes are 256 bits, not 128

https://sslog.dpdns.org/birthday-attack.html
1•Shaurya_Sharma•31m ago•0 comments

An open-source design plugin that helps your AI build less generic websites

https://github.com/MickeyAlton33/web-designer-plugin
1•Nina_antalpha•35m ago•0 comments

Sex After AGI

https://twitter.com/Joshbocanegra/status/2093122061116035105
1•jbai•36m ago•0 comments

Terence Tao: Protecting math problems from automated solvers

https://mathstodon.xyz/@tao/117204929023813310
4•bertman•36m ago•0 comments

No Vibe Coding: Discussion Coding on Termux – Phone Only, Zero Trust

https://m.blog.naver.com/amadale/224399795090
1•garlicfarmer•39m ago•0 comments

Show HN: Self-hosted CRM for manufacturing (Django and Htmx)

https://github.com/OlegUshakov-pl/CRM
1•OlegUshakov•40m ago•0 comments

Markdown Editors Weren't Built for Coding Agents, So I Made One

https://marginal.md/blog.html
2•kishiguro•41m ago•0 comments

Show HN: Tiny Markdown CLI renderer – Streaming, 10x faster, 2MB flat RAM

https://github.com/cjccjj/mdflow
2•cjcj•41m ago•1 comments

Lex Speedman: We love you, Lex. but You talk too slow

https://lexspeedman.com/
1•mellosouls•46m ago•0 comments