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

AI enables 1000 people to hold a thoughtful conversation

https://bigthink.com/science-tech/collective-superintelligence/
1•bonkerbits•2m ago•1 comments

How Utahns Took on Mr. Wonderful and a Data Center on the Great Salt Lake

https://www.nytimes.com/2026/06/14/us/elections/kevin-oleary-utah-data-center.html
2•ChrisArchitect•9m ago•1 comments

American capitalism is run by millionaires, not billionaires

https://www.economist.com/business/2026/06/10/american-capitalism-is-run-by-millionaires-not-bill...
2•Anon84•11m ago•0 comments

A live ledger of things people wish existed captured from the BlueSky firehose

https://www.unbuilt.so
1•plural•17m ago•0 comments

Why Software, Not Drones, Will Decide the Next War

https://csis-website-prod.s3.amazonaws.com/s3fs-public/2026-06/260610_Bondar_Defining_Autonomy.pd...
2•tow21•17m ago•1 comments

Ask HN: If 160M Americans are employed, what's the unemployment rate?

1•paganartifact•21m ago•2 comments

Everyone Was Wrong About Maximum Siphon Height [video]

https://www.youtube.com/watch?v=5glksNTKkZI
2•thunderbong•25m ago•0 comments

Why my book can be downloaded for free (2014)

https://blog.plover.com/book/free-hop.html
1•downbad_•26m ago•0 comments

Show HN: Afterburner – Capability-Sandboxed JavaScript/TS Runtime in Rust

https://github.com/afterburner-sh/afterburner
1•vertexclique•28m ago•0 comments

Claude Fable 5 vs. GPT-5.5: better planning, similar execution

https://blog.kilo.ai/p/claude-fable-5-vs-gpt-5-5
2•justiceforsaas•29m ago•0 comments

AI is revolutionising the stock market

https://www.ft.com/content/b31f1e09-5aae-4cad-af15-97adb15dba70
1•thm•30m ago•0 comments

Meta‑Attention Is All You Need

https://medium.com/@vla3728419/meta-attention-is-all-you-need-650a90832d27
1•theorchid•30m ago•0 comments

Qwen 3.6 93B with MTP on 2×RTX 3090 NVLink=187 tokens/SEC,LLM lost bleat-a-thon

https://github.com/Augmented-Reality-Virtual-Reality-AR-VR/P...
3•devilfileprong•31m ago•0 comments

How did Atari apply side art to Arcade Cabinets?

https://arcadeblogger.com/2026/06/14/how-did-atari-apply-side-art-to-arcade-cabinets/
5•msephton•31m ago•0 comments

A text-first social network – No Images, No Videos

https://trendter.com/
1•badz•33m ago•2 comments

Moving Averages (2022)

https://gregorygundersen.com/blog/2022/06/04/moving-averages/
1•tosh•35m ago•0 comments

Shoehorning Flying Toasters into a ESP32-S3

https://taoofmac.com/space/blog/2026/06/14/1400
2•rcarmo•36m ago•0 comments

Brief Notes on Computer Word and Byte Sizes

https://www.cs.columbia.edu/~smb/blog/2023-03/2023-03-07.html
2•jruohonen•36m ago•0 comments

Why Rust does not need OOP

https://belderbos.dev/blog/why-rust-does-not-need-oop/
1•lumpa•37m ago•0 comments

The origins of the AI age /s

https://indiekartik.substack.com/p/the-origins-of-the-ai-age
1•kartik0001•42m ago•0 comments

I built a zero-tab reading workflow for Hacker News

https://gopeek-lovat.vercel.app/blog-hacker-news-workflow.html
5•ofcyes•49m ago•1 comments

The Birth and Death of JavaScript (2014)

https://www.destroyallsoftware.com/talks/the-birth-and-death-of-javascript
40•subset•50m ago•12 comments

China's universities cut 12,000 'obsolete' degrees

https://www.scmp.com/economy/china-economy/article/3356913/chinas-universities-cut-12000-obsolete...
3•the-mitr•50m ago•0 comments

Elon Musk's role was 'instrumental' in the Belfast riots, researchers say

https://www.lemonde.fr/en/international/article/2026/06/13/musk-s-role-was-instrumental-in-the-be...
5•tastyface•52m ago•1 comments

Formal Methods and the Future of Programming

https://blog.janestreet.com/formal-methods-at-jane-street-index/?from_theconsensus=1
2•eatonphil•53m ago•0 comments

The Universe Is Made of Music [video]

https://www.youtube.com/watch?v=j06DGlbwM34
1•rogmash•54m ago•0 comments

Show HN: KBlocker - Linux Productivity Hack

https://github.com/Dan-J-D/kblocker
1•dan-j-d•56m ago•0 comments

Double your Codex / Claude Code productivity and output

https://github.com/tanweai/pua
1•sturza•58m ago•0 comments

Kagi adds Hacker News conversation under links

https://imgur.com/a/S4S0vPX
2•scosman•59m ago•0 comments

Stop Monitoring AI Systems Like Web Services

https://www.newsletter.swirlai.com/p/stop-monitoring-ai-systems-like-web
3•AurimasGr•1h ago•0 comments