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

I Dislike TypeScript Because I've Never Maintained JavaScript Before

https://mayberay.bearblog.dev/i-dislike-typescript-because-ive-never-maintained-javascript-before/
1•mugamuga•4m ago•0 comments

LessHard: Less wrong about wanting [parody]

https://shimmermathlabs.com/lesshard.html
1•nwhitehead•7m ago•0 comments

What did she see? The intelligence scramble to retrace an accused spys footsteps

https://www.cbc.ca/news/politics/canada-china-spy-nato-intelligence-9.7331493
3•pir8life4me•17m ago•0 comments

23 years documenting the global LED transition of city lighting from space

https://twitter.com/astro_pettit/status/2096763479143469206
4•taubek•20m ago•0 comments

Collaborative Machine Knowledge Platform

https://haidaa.com/
2•AISETR•22m ago•1 comments

I made a fake news spotting minigame

3•azermite•28m ago•0 comments

Humble exoskeletons work better than combat supersuits

https://www.economist.com/science-and-technology/2026/09/02/humble-exoskeletons-work-better-than-...
4•edward•28m ago•0 comments

Show HN: CiteGuard – local CLI for checking citations in Markdown reports

https://github.com/larrylot/citeguard
1•lordlarry•32m ago•0 comments

Archify

https://github.com/tt-a1i/archify
1•saikatsg•37m ago•1 comments

What animal has a prime number of legs? And why does this confuse LLMs?

https://tris.sherliker.net/blog/what-animal-has-a-prime-number-of-legs/
3•speerer•37m ago•0 comments

Show HN: Yurei – like Claude in Chrome, but for any model and harness

https://yurei-ai.com/
1•memel06•41m ago•0 comments

New off-peak rates: 50% lower prices for DeepSeek-V4

https://ollama.com/pricing
2•soltanov•43m ago•0 comments

WTFM Book

https://wtfmbook.com/contents/
2•cyndunlop•44m ago•0 comments

Two new ways to study AI-human psychology with persona vectors

https://github.com/programmer9998/ai_personality_study
1•programmer_1324•45m ago•0 comments

OpenAI 2025 financials $38.5B loss ahead of IPO

https://qz.com/openai-leaked-financials-losses-revenue-ipo-061626
2•u1hcw9nx•50m ago•0 comments

ACX Review Archive

https://acxreviews.robennals.org/
1•altilunium•54m ago•0 comments

DIYing Apps for Fun and Profit

https://www.fldr.zip/blog/diying-apps-for-fun-and-profit
1•wyxuan•57m ago•0 comments

Escaping Containment

1•silexia•57m ago•1 comments

Switzerland's Federal Government Is Replacing Microsoft on 3k Computers

https://itsfoss.com/news/switzerland-replace-microssoft-pilot/
8•ivell•58m ago•1 comments

The City and the City

https://en.wikipedia.org/wiki/The_City_%26_the_City
2•debo_•1h ago•0 comments

Volkswagen to cut 50k more jobs, hitting 100k total layoffs

https://qz.com/volkswagen-job-cuts-100000-future-plan-2030-090426
6•backlit4034•1h ago•0 comments

Nvidia's Jensen Huang says 'AGI has arrived' and congratulates OpenAI

https://www.businessinsider.com/nvidia-jensen-huang-agi-openai-astra-ai-2026-9
21•vinni2•1h ago•51 comments

Sanctioned ICC head calls court the last bastion of rule of law

https://www.japantimes.co.jp/news/2026/09/07/japan/akane-icc-last-bastion-rule-law/
3•anigbrowl•1h ago•0 comments

OpenAI Computer Using Agent Sample App

https://github.com/openai/openai-cua-sample-app
1•helloplanets•1h ago•0 comments

India's alternative-fuel car sales top petrol on cost, E20 concerns

https://www.reuters.com/world/india/indias-alternative-fuel-car-sales-top-petrol-cost-e20-concern...
3•geox•1h ago•0 comments

Long-term melatonin use linked to 90% higher heart failure risk

https://www.sciencedaily.com/releases/2026/08/260829035228.htm
5•chasil•1h ago•1 comments

Ask HN: Open-source AI policies and "responsbility"

1•noobermin•1h ago•0 comments

AI Index Report

https://hai.stanford.edu/ai-index/2026-ai-index-report
3•olalonde•1h ago•0 comments

Ask HN: Resources for how to get good at sales

1•nomilk•1h ago•2 comments

Bot Detection Without JavaScript: What My Blog Measured

https://gkoreli.com/how-i-separate-readers-from-bots-without-javascript
2•gogakoreli•1h ago•0 comments