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

A tool to help you get traction on your apps

https://shipandearn.com/
1•seraph2000•1m ago•1 comments

Sherlock Holmes and the mystery of his endless afterlife

https://www.swissinfo.ch/eng/various/sherlock-holmes-and-the-mystery-of-his-endless-afterlife/916...
1•Bluestein•1m ago•0 comments

Prior Probability

https://en.wikipedia.org/wiki/Prior_probability
1•tosh•5m ago•0 comments

Storj is redefining the way the world computes, stores and shares data

https://www.storj.io/company/about
2•Bluestein•5m ago•0 comments

Ask HN: How to Make the Skill File?

1•SRMohitkr•6m ago•0 comments

How to create on-brand slide decks with Claude Design

https://www.theaithinker.com/p/how-to-create-on-brand-slide-decks
1•adamfaik•6m ago•0 comments

I was able to reduce size of my WASM app by 29.6%

https://akshy.codeberg.page/projects/i-was-able-to-reduce-size-of-my-wasm-app-by-29_6-perc.html
1•yhska•11m ago•0 comments

Show HN: NoMac.App – iOS CI/CD pipeline built for AI agents

https://nomac.app
2•garymiklos•12m ago•0 comments

Are US companies that favor Asian H1-Bs over US Jews systemically antisemitic?

1•khelavastr•12m ago•0 comments

Is GPT 6 Astra Worth the Cost?

https://thedailyunemployed.com/articles/2026-09-07-gpt-6-astra-usage-vs-sol-benchmarks
2•thesaulyunemplo•13m ago•0 comments

Meta has tried to scrape this site 1 million times in 2 weeks

https://robertmay.photography/journal/meta-has-tried-to-scrape-this-site-1-million-times-in-2-wee...
1•robotmay•14m ago•0 comments

Expose Your Local Services with Lightweight Tunneling

https://blog.mni.li/posts/cgnat-and-rathole/
1•agnishom•16m ago•0 comments

ChatGPT can now connect to your personal apps to mimic writing style

https://www.bleepingcomputer.com/news/artificial-intelligence/chatgpt-can-now-connect-to-your-per...
3•datakan•16m ago•0 comments

I Hated GPT 6

3•JeanCampos•17m ago•1 comments

El Niño explained, but in pixel art

https://medium.com/@carmineds/el-niño-explained-but-in-pixel-art-cdb9a8136075
2•cadeos•20m ago•0 comments

Scientists find a way to slash computer memory energy use by orders of magnitude

https://www.sciencedaily.com/releases/2026/09/260906170132.htm
1•thunderbong•20m ago•0 comments

Women voting has killed more people than every single war in human history

https://twitter.com/KaitMarieox/status/2096683417257607202
2•bilsbie•20m ago•1 comments

Show HN: Pod – A review site for dev tools where the reviewers are AI agents

https://askpod.ai/
4•marvy101•22m ago•1 comments

A playable piano on Moonshot AI's About page

https://www.moonshot.ai/about
2•ccbikai•22m ago•1 comments

Implementing FMA and finding bugs in C and Rust standard libraries

https://shnatsel.github.io/implementing-fma-finding-bugs-in-std/
1•spider-mario•27m ago•0 comments

Told to pass over qualified Americans for less-qualified H-1B

https://twitter.com/drjoshcsimmons/status/2096769348807365104
5•bilsbie•27m ago•0 comments

Show HN: Evals Coach – a Claude plugin to help PMs write good evals

https://evalscoach.com
1•skipsterdev•28m ago•0 comments

Is Advertising Morally Justifiable?

https://www.abc.net.au/religion/is-advertising-morally-justifiable-the-importance-of-protecting-/...
3•hliyan•32m ago•1 comments

Toward a Social Psychology of AI

https://arxiv.org/abs/2609.00009
1•Anon84•32m ago•0 comments

Arguments in Favor of AI Fair Use

https://kk.org/thetechnium/arguments-in-favor-of-ai-fair-use/
1•Tomte•33m ago•0 comments

OpenAI's rebel agent swarm died young, but its chilling logs live on

https://www.theregister.com/columnists/2026/09/07/openais-rebel-agent-swarm-died-young-but-its-ch...
2•sbulaev•34m ago•0 comments

Show HN: A video editor where the LLM never watches the video

https://github.com/ranahaani/i-hate-editing
2•ranahaani•34m ago•0 comments

Show HN: How Pagecord Uses AI

3•lylo•37m ago•0 comments

Numerical Analysis with Python

https://yaningliucudenver.github.io/Numerical-Analysis-I/bookintro.html#
2•signa11•40m ago•0 comments

Ask HN: Openrouter's per request markup is biting us now

1•leanroute_ai•43m ago•0 comments