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

Smartphone imaging technology and its applications (2021)

https://www.degruyterbrill.com/document/doi/10.1515/aot-2021-0023/html
1•kawera•43s ago•0 comments

From Legacy Bedrock Agents to Strands Agents on Bedrock AgentCore Runtime

https://hypertrail.ai/blog/migrating-from-legacy-bedrock-agents-to-strands-agents-powered-by-amaz...
1•grollat•48s ago•1 comments

Climate Change Tracker

https://climatechangetracker.org
1•a2x•2m ago•0 comments

New term in AI search: On-site live agents

https://embassia.com
1•ramazanaliakdas•3m ago•0 comments

US treasury doubles debt buyback to steady bond market amid inflation fears

https://www.theguardian.com/business/2026/aug/19/us-treasury-doubles-debt-buyback-bond-market
2•almog•4m ago•0 comments

CFTC Requests Comment on the Listing of Compute Derivatives Contracts

https://www.cftc.gov/PressRoom/PressReleases/9286-26
1•petethomas•4m ago•0 comments

APISign – E-signature API, templates are Markdown files in your repo

https://apisign.io/
1•wunl•4m ago•0 comments

Book Review: Kakistocracy

https://benthams.substack.com/p/review-kakistocracy
1•paulpauper•5m ago•0 comments

UC Berkeley professor admits to using AI in op-ed

https://www.dailycal.org/news/campus/uc-berkeley-professor-admits-to-using-ai-in-op-ed-calling-ou...
2•paulpauper•5m ago•0 comments

French Constitutional Council Blocks Under-15 Social Media Ban

https://www.techdirt.com/2026/08/19/french-constitutional-council-blocks-under-15-social-media-ba...
1•cdrnsf•6m ago•0 comments

Run GLM-OCR, DeepSeek-OCR-2, Dots.mocr with an OpenAI Compatible API

https://www.vlm.run/product/gateway
3•fzysingularity•7m ago•0 comments

Computational Life Reactor (Based on Brainfuck)

https://alexborger.com/clr-computational-life-reactor
1•a2x•8m ago•1 comments

Reconciling global tipping point theories: Insight from magnetic experiments

https://www.cell.com/one-earth/fulltext/S2590-3322(25)00184-8
1•jambalaya8•8m ago•0 comments

Everything is muscle training (even more than you think)

https://suboptimization.substack.com/p/everything-is-muscle-training-even
1•bricee98•8m ago•0 comments

I ran 539 regex patterns on 16 real engines – 264 disagree

https://github.com/Kristofp/regex-engine-divergences
1•stofke72•8m ago•0 comments

BookHive – Open-source alternative to Goodreads on ATProto

https://bookhive.buzz/
1•ksymph•8m ago•0 comments

Stripe to investors: the singularity has begun [pdf]

https://s3.documentcloud.org/documents/28565866/stripes-august-2026-investor-letter.pdf
1•reasonableklout•9m ago•0 comments

Show HN: Open Bot – an open-source Grok Bot that works with any agent harness

https://github.com/copilotkit/openbot
7•mikeryan52•10m ago•1 comments

What the $20 Burrito Debate Gets Wrong About Affordability

https://newsletter.platypuseconomics.com/p/burrito-gate-and-the-affordability
2•mooreds•10m ago•1 comments

Self-Service Analytics Is Not Self-Service. But Don't Tell Anyone

https://dataanalysis.substack.com/p/self-service-analytics-is-not
1•dijksterhuis•11m ago•0 comments

ASD-STE100 Simplified Technical English

https://www.asd-ste100.org/
1•Bluestein•11m ago•0 comments

FTC Proposed Policy on Personalized Pricing

https://www.ftc.gov/legal-library/browse/federal-trade-commissions-proposed-enforcement-policy-st...
1•tedggh•13m ago•0 comments

The most common questions about developer marketing, answered

https://posthog.com/blog/developer-marketing-questions
1•cyndunlop•13m ago•0 comments

Curvature Beziers – Improving on a timeless recipe

https://acko.net/blog/curvature-beziers/
1•thunderbong•16m ago•0 comments

Fig, a TS UI Runtime Based on React

https://www.bengubler.com/posts/2026-08-14-introducing-fig-ui-runtime
2•nebrelbug•16m ago•0 comments

Secure all your internal vibe-coded applications – in one click

https://blog.cloudflare.com/workers-protected-by-access/
2•speckx•17m ago•0 comments

A blog should be a folder of files

https://robinkroonen.com/posts/a-blog-should-be-a-folder-of-files/
3•rob-x-ai•17m ago•0 comments

Trading the Infrastructure of Tomorrow

https://www.cmegroup.com/markets/energy/power/compute-futures.html
1•nairboon•17m ago•0 comments

OpenAI's "joke" at Patch Demo Day 2026

https://mbdalpha.dev/blog/conall-oreilly/
1•mbdalpha•18m ago•0 comments

Unsloth Dynamic 3.0 GGUFs

https://unsloth.ai/docs/basics/dynamic-3.0-ggufs
2•jonesy827•19m ago•0 comments