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

Soofi – Sovereign Open Source Foundation Models

https://www.soofi.info/
1•karussell•17s ago•1 comments

NYC Launches "Public Interest Technology (Pit) Crew" to Build Digital Solutions

https://www.nyc.gov/mayors-office/news/2026/07/mayor-mamdani-launches--public-interest-technology...
1•ChrisArchitect•2m ago•0 comments

How does an LLM feel about you?

https://sackfield.substack.com/p/how-does-an-llm-feel-about-you
1•sackfield•3m ago•0 comments

Economists are coming around to the idea that AI really is killing jobs

https://qz.com/economists-ai-job-displacement-industrial-revolution-statement-071326
1•pseudolus•4m ago•0 comments

The Estranged Worlds of J. G. Ballard

https://lareviewofbooks.org/article/jg-ballard-illuminated-man-christopher-priest-nina-allan/
1•Caiero•5m ago•0 comments

A Large-Scale Empirical Study of AI-Generated Code in Real-World Repositories

https://arxiv.org/abs/2603.27130
1•softwaredoug•6m ago•0 comments

$65K to work at Anthropic? Debate ensues amid IPO wave

https://missionlocal.org/2026/07/anthropic-sf-affordability-ipo-housing-evictions-rent/
1•gcheong•6m ago•0 comments

Primate 0.40: Route pages, store enums, async schemas and events

https://primate.run/blog/primate-040
4•terrablue•6m ago•0 comments

DOOMQL – what if SQLite were the game engine?

https://github.com/petergpt/doomql
1•simonw•8m ago•1 comments

SHOW HN: Every Repo as a Unique Galaxy

https://gitgalaxy.io/
1•squid-protocol•9m ago•1 comments

Frankie: AI analyst you can email to get work done

https://getcompound.ai/blog/introducing-frankie
1•somerandomness•13m ago•0 comments

The Work of Helping A.I. Destroy Work

https://www.nytimes.com/2026/07/10/business/ai-white-collar-jobs.html
1•bookofjoe•14m ago•1 comments

MindRoom: AI agents that live in Matrix and work everywhere

https://www.nijho.lt/post/mindroom/
1•AdamGibbins•15m ago•0 comments

The case of the 500-mile email (2002)

https://www.ibiblio.org/harris/500milemail.html
1•downbad_•16m ago•1 comments

Pentagon suspends CMMC phase two requirements, launches review of program

https://federalnewsnetwork.com/cybersecurity/2026/07/pentagon-suspends-cmmc-phase-two-requirement...
2•petethomas•16m ago•0 comments

MIT's New Method Flags AI Models Trained on CASM Without Generating It

https://insideai.news/news/ai-safety/mits-new-method-flags-ai-models-trained-on-child-abuse-image...
1•sdoering•19m ago•0 comments

A Study of Microsoft's Early 2026 Rollout of Claude Code and GitHub Copilot CLI

https://arxiv.org/abs/2607.01418
2•softwaredoug•19m ago•0 comments

Yes, You Can Trick AI into Exonerating Someone

https://braddelong.substack.com/p/semi-crosspost-kelsey-piper-yes-you
2•gumby•21m ago•0 comments

OpenAI's new Agent Sandbox Cloud [video]

https://www.youtube.com/watch?v=OqM67QG_Ikk
1•iacguy•22m ago•0 comments

Noisia: Harmful Workload Generator for PostgreSQL

https://github.com/lesovsky/noisia/
1•handfuloflight•23m ago•0 comments

Starship – Critical Path [video]

https://www.youtube.com/watch?v=-a0ecQMq-rM
2•throwitaway222•24m ago•0 comments

AI use case library – Who is deploying AI, and what happened (150+ cases)

https://aiweekly.co/ai-use-cases
1•adu_onemore•26m ago•0 comments

Human Emacs

https://human-emacs.org/
4•birdculture•27m ago•0 comments

France powers down several nuclear reactors due to extreme heat

https://www.lemonde.fr/en/france/article/2026/07/12/france-powers-down-several-nuclear-reactors-d...
6•_Microft•28m ago•1 comments

Grok Build uploading full repos and .envs to GCP

https://twitter.com/xbtoshi/status/2076338252051841512
2•ashleypeacock•29m ago•1 comments

Trump notifies Congress of new war against Iran

https://www.politico.com/news/2026/07/13/trump-notifies-congress-of-new-war-against-iran-00995170
10•bushwart•29m ago•3 comments

AI Agents for Increasing Revenue

https://alum.so/
1•Sumiran7•29m ago•0 comments

The Tick That Hunts Down Its Hosts–Including Us

https://www.newyorker.com/magazine/2026/07/06/the-tick-that-hunts-down-its-hosts-including-us
1•randycupertino•31m ago•0 comments

Venice's access fee doesn't reduce tourism: it selects who can afford it

https://andreafontana.it/en/venice-entry-ticket-overtourism.html
2•trikko•32m ago•0 comments

Microsoft commits $2.5B, 6k employees AI implementation unit

https://www.cnbc.com/2026/07/02/microsoft-commits-2point5-billion-6000-employees-ai-implementatio...
1•rbanffy•32m ago•1 comments