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

Beyond the AI Black Box (AnjouRan)

https://github.com/anjou1975ran-gif/LIHUO-LOCALITY-001
1•lihuo•5m ago•0 comments

Marc Andreessen and Gina Raimondo Interview

https://www.youtube.com/watch?v=7WWndQdjG90
1•motte•6m ago•1 comments

Niobium Phosphide for Computer Interconnects

https://www.nytimes.com/2026/11/25/science/chips-wires-copper-niobium.html
1•osnium123•9m ago•1 comments

Code-driven AI illustrations more useful than images from dedicated image models

https://simonwillison.net/2026/Nov/28/code-driven-ai-illustrations/
2•thunderbong•14m ago•0 comments

Engineers transform 200-year-old Italian nativity

https://www.bbc.com/news/articles/c6pqrvz407pqo
1•1659447091•14m ago•0 comments

Show HN: RK3588 QEMU emulator running unmodified Armbian images

https://github.com/petabyt/clanker-rkqemu
2•petabyt•15m ago•0 comments

Weftover – Design Your Weaving

https://www.weftover.com
1•vismit2000•18m ago•0 comments

Osint Investigation Tool: From One Identifier to an Exportable Report

https://osintsearch.org/blog/osint-investigation-tool
1•anapame•18m ago•1 comments

Rishi Sunak: We need to return to elective dictatorship

https://www.thetimes.com/comment/columnists/article/rishi-sunak-we-need-to-return-to-elective-dic...
1•ksec•20m ago•0 comments

Tell HN: Don't use AI to write your comments or they'll get automatically killed

2•nathan_f77•24m ago•1 comments

The return of the Xenon flash bug – Radxa Dragon Q8B edition

https://www.cnx-software.com/2026/11/29/the-return-of-the-xenon-flash-bug-radxa-dragon-q8b-edition/
1•zdw•27m ago•0 comments

FLEY AI Web Version

https://fleyaiweb.netlify.app/
1•Drfoxi•27m ago•0 comments

The Houthis Are the Future of Warfare

https://www.theatlantic.com/ideas/2026/11/houthis-future-warfare-technology/689559/
2•toomanyrichies•29m ago•1 comments

I built my own sovereign AI infrastructure (Nexus/Forge/Nercel)

https://github.com/Aissamohammedi88/narcel-v15-forge/tree/main
1•Aissamohammedi8•36m ago•0 comments

Chez Scheme from a Clojurian Perspective

https://get-aksh.com/blog/chez-from-a-clojurian-perspective
2•pushpankar•37m ago•1 comments

Costa Rica detains UN Special Rapporteur Albanese over alleged 'terror alert'

https://thecradle.co/articles-id/41319
1•0x54MUR41•37m ago•0 comments

Multilingualism protects against accelerated aging

https://www.nature.com/articles/s43587-025-01000-2
1•geox•39m ago•0 comments

Ask HN: Why bother with new programming languages?

2•avilay•45m ago•1 comments

Safe, automated bug discovery and fixing with Prospero

https://nullprogram.com/blog/2026/11/27/
2•ibobev•51m ago•0 comments

C++ String Benchmark: STL vs. ATL vs. Custom Pool Allocator

https://giodicanio.com/2026/11/15/c-plus-plus-string-benchmark-stl-vs-atl-vs-custom-pool-allocato...
1•ibobev•51m ago•0 comments

Benchmarking ImageOptim Settings

https://harrisonbroadbent.com/blog/compress-images-imageoptim/
1•hbroadbent•51m ago•1 comments

Yakov Perelman – Physics Can Be Fun (1975)

https://archive.org/details/yakov-perelman-physics-can-be-fun-mir-1975
1•the-mitr•53m ago•0 comments

The Perils of `sudo vim`

https://ohaodha.ie/blog/the-perils-of-sudo-vim/
1•ohaodha•54m ago•0 comments

X implements parental controls for teen users

https://mashable.com/tech/x-twitter-elon-musk-parental-controls-teens
1•extasetoi12•54m ago•0 comments

Show HN: Interactive model benchmarks from routing real development work

https://oreshkin-model-atlas.cybertest.workers.dev/
1•vedmed•1h ago•0 comments

Learning Smalltalk with AI after reading a 1981 paper

https://www.cs.virginia.edu/~evans/cs655/readings/smalltalk.html
2•g_host56•1h ago•1 comments

Show HN: Wwwet – web based webauthn and SSH and et client

https://github.com/blmarket/wwwet
1•blmarket•1h ago•0 comments

Hacker Laws

https://github.com/dwmkerr/hacker-laws
2•Olshansky•1h ago•0 comments

Jagex, creators of RuneScape, detected unauthorised access to systems

https://support.runescape.com/hc/en-gb/articles/53510390987409--28-NOV-Downtime
3•sikozu•1h ago•0 comments

"Sigh my Google account got banned" [for using Gemini Neon/Antigravity]

https://twitter.com/itsnoahd/status/2126815531189596363
3•gadtfly•1h ago•4 comments