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

Young Builder Society Microgrant

https://www.youngbuildersociety.com
1•audreyfei•4m ago•0 comments

Linus Torvalds' uEmacs – the editor he has used since the 1980s

https://github.com/torvalds/uemacs
2•oumua_don17•4m ago•0 comments

Getting over the Nebulosity of Agents

https://text-incubation.com/getting-over-the-nebulosity-of-agents?2
1•krrishd•5m ago•0 comments

Inworld TTS Open Evaluation Toolkit: Reproducible TTS Evals

https://inworld.ai/blog/introducing-inworld-tts-open-evaluation-toolkit
2•rogilop•6m ago•0 comments

FDOT de-flocks: Automatic license plate reader permits revoked across Florida

https://www.msn.com/en-us/news/other/fdot-de-flocks-automatic-license-plate-reader-permits-revoke...
1•smalltorch•10m ago•0 comments

Arise – Agentic Runtime Identity Security Enforcement

https://requestrocket.com/blog/arise-api-gateway-isnt-ready
1•geoicons•10m ago•0 comments

Mu/TH/UR 6000 – An anonymous AI terminal styled as a 1979 mainframe

https://mu7hur.com/
1•pinkroro•11m ago•0 comments

New party school rankings are out. See where your school is

https://www.usatoday.com/story/sports/ncaaf/2026/08/31/best-party-schools-usa-new-2027-college-pa...
1•makerdiety•14m ago•0 comments

Edge City

https://www.edgecity.live
2•audreyfei•19m ago•0 comments

When declaring an incident becomes everyone's favorite workaround

https://greatcircle.com/blog/2026/08/11/declaring-incidents-for-side-effects/
1•bobbiechen•24m ago•0 comments

Apple Says OpenAI Is Destroying Evidence in Trade Secrets Case

https://www.bloomberg.com/news/articles/2026-08-31/apple-says-openai-is-destroying-evidence-in-tr...
1•sbulaev•25m ago•0 comments

Janet Verison 1.42.0 Out

https://github.com/janet-lang/janet/releases/tag/v1.42.0
2•veqq•27m ago•0 comments

LangLib: Esoteric Programming Languages, Formally

https://github.com/ilyasergey/langlib
1•matt_d•27m ago•0 comments

A video editor built for your codex/Claude Code

https://www.usekinara.com/
1•ebaad96•30m ago•1 comments

Elevator of the Year Winner Modernization of the Metropolis Trust Building

https://www.starelevator.com/projects/star-elevator-modernization-of-the-metropolis-trust-building
1•palashawas•31m ago•0 comments

Happy Birthday to the First Index Investment Trust

https://www.ft.com/content/c0341d15-482e-41a6-abe1-ef3e5e9a0d0b
2•JumpCrisscross•32m ago•0 comments

Claude Public Artifacts

https://www.google.com/search?q=site%3Aclaude.ai+public+artifacts
1•artursapek•36m ago•0 comments

Why Syracuse Can't Attract the Students It Needs to Pay the Bills

https://www.wsj.com/us-news/education/syracuse-student-application-enrollment-crisis-budget-ff142896
3•paulpauper•38m ago•0 comments

You don't know who you need to meet

https://benyeoh.substack.com/p/you-dont-know-who-you-need-to-meet
1•paulpauper•38m ago•0 comments

AI and Employment: So Far, So Good

https://marginalrevolution.com/marginalrevolution/2026/08/ai-and-employment-what-the-firms-say.html
3•paulpauper•39m ago•0 comments

Finish Your Projects

https://github.com/readme/guides/finish-your-projects
3•jethronethro•40m ago•0 comments

Command and Conquer Tiberian Sun reverse-engineered and open-sourced

https://www.reddit.com/r/commandandconquer/comments/1vzsssz/today_were_releasing_opents_a_reverse...
2•ZivDero•43m ago•0 comments

Carmack: Has early Scratch experience led to fulfilling careers?

https://twitter.com/ID_AA_Carmack/status/2094450188911845827
1•ilamont•46m ago•0 comments

Evidence of Fraud in an Influential Study About Procrastination

https://datacolada.org/138
25•Anon84•47m ago•6 comments

Adaptation Fidelity of SPEC CPU2026

https://arxiv.org/abs/2608.27710
1•matt_d•49m ago•0 comments

A Genealogy of Freudenthal's Lincos

https://www.shellsandpebbles.com/2026/01/19/a-genealogy-of-freudenthals-lincos-part-i-looking-up-...
1•akkartik•49m ago•0 comments

HashCortX – AI workspace app, Now works on pre-2013 CPU windows devices

https://github.com/Hash-7777/HashCortX
1•SeifHashish•49m ago•0 comments

How to Spot a Psychopath

https://www.theguardian.com/science/2026/aug/27/how-to-spot-a-psychopath-its-like-the-difference-...
4•bookofjoe•50m ago•1 comments

Radiant Wins $750M US Army Portable Nuclear Reactor Deal [video]

https://www.youtube.com/watch?v=1a90l6PAD1U
1•gurjeet•52m ago•0 comments

Private 5G for Mining and Remote Operations [pdf]

https://framerusercontent.com/assets/vxB6lcIp0xnKVuPekXC2GeJb1Nw.pdf
1•y2so•53m ago•0 comments