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

LongCat-2.0

1•rika321•44s ago•0 comments

Show HN: A live badge that proves your SaaS runs on EU infrastructure

https://euroseal.pages.dev
1•robpus•3m ago•0 comments

Job descriptions got longer than CVS receipts

https://www.businessinsider.com/job-descriptions-longer-than-cvs-receipts-ai-2026-7
1•ilreb•4m ago•0 comments

Intuitive Quantum Electrodynamics

https://forwardscattering.org/page/Intuitive%20Quantum%20Electrodynamics
1•Ono-Sendai•5m ago•0 comments

Show HN: MM to Inches converter with fractional inch references

https://mm-to-inches.net
1•robot1996•10m ago•0 comments

Concentration of power in AI is a risk, by Andy Konwinski

https://xcancel.com/i/article/2072830533739192560
2•alecco•10m ago•0 comments

The "Collosophone"

https://pressforsound.com/tag/collosophone/
1•Eridanus2•12m ago•0 comments

AWS Lambda MicroVMs: The Compute Nobody Asked For?

https://www.confessionsofadataguy.com/aws-lambda-microvms-the-compute-nobody-asked-for/
1•nosky•13m ago•0 comments

8 Comprehensive WebSite Health Check Ups

https://urlwatch.io/
2•mssblogs•17m ago•0 comments

Claude Design System Prompt

https://github.com/Trystan-SA/claude-design-system-prompt
1•handfuloflight•22m ago•0 comments

Creed: Canonical Markdown File

https://creed.md/home
1•handfuloflight•25m ago•0 comments

Train SIM Created by Just One Person Is Being Called the Best Ever Made

https://kotaku.com/a-train-sim-created-by-just-one-person-is-being-called-the-best-ever-made-2000...
3•oumua_don17•26m ago•0 comments

Apocketlypse

https://0dd.company/galleries/triumph/1.html
6•scaglio•34m ago•0 comments

Surus Agentic Postgres Companion

https://github.com/Geometrein/surus
1•geometrein•34m ago•1 comments

Show HN: Super fast pipeline for finding specific paths across mills of domains

https://github.com/Kirill89/webcensus
1•k1r111•38m ago•0 comments

A Postmortem of an LLM Social Network

https://armx64.medium.com/emergence-without-understanding-a-postmortem-of-an-llm-social-network-9...
1•_pdp_•43m ago•0 comments

Show HN: Reactive Resume v5 – free, private, self-hostable resume builder

https://github.com/amruthpillai/reactive-resume
1•AmruthPillai•45m ago•0 comments

Arrest 0.2.1, an HTTP client with data validation

https://github.com/s-bose/arrest
1•s-bose•46m ago•1 comments

Letter addressed to 'woman in Cornwall shed' arrives at its correct home (2021)

https://metro.co.uk/2021/07/01/letter-addressed-to-woman-in-cornwall-shed-arrives-at-its-correct-...
1•joebig•47m ago•0 comments

Bad Epoll (CVE-2026-46242)

https://github.com/J-jaeyoung/bad-epoll
1•g0xA52A2A•50m ago•0 comments

A Theory of Arrays (ToA) Union Find

https://www.philipzucker.com/toa_unionfind/
1•g0xA52A2A•1h ago•0 comments

Web-based cryptography is always snake oil

https://www.devever.net/~hl/webcrypto
4•enz•1h ago•0 comments

Knowledge Should Not Be Gated

https://www.formaly.io/blog/knowledge-should-not-be-gated
1•nezhar•1h ago•0 comments

India seeks to quell public backlash on ethanol-mixed fuel

https://www.reuters.com/world/india/india-seeks-quell-public-backlash-ethanol-mixed-fuel-after-ex...
2•JumpCrisscross•1h ago•0 comments

SigMap: 97% token reduction for AI coding sessions

https://sigmap.io/
3•handfuloflight•1h ago•0 comments

Notaru

https://notaru.org/
1•handfuloflight•1h ago•0 comments

Show HN: I trained a language model that thinks the capital of Japan is Paris

https://hamiltonianresearch.xyz/blog/hr-diffuse-1.html
4•farisallafi•1h ago•0 comments

code-on-incus: Give each AI agent its own isolated machine with root

https://github.com/mensfeld/code-on-incus
1•Tomte•1h ago•0 comments

Programmers need to start meditating now

https://jacob.gold/posts/programmers-need-to-start-meditating-now/
2•enz•1h ago•0 comments

NirCmd – Windows command line tool

https://www.nirsoft.net/~nirsoft/utils/nircmd.html
2•thunderbong•1h ago•0 comments