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

Gemini 4 Argon Safety and Security Report [pdf]

https://storage.googleapis.com/deepmind-media/gemini/gemini_4_safety_report.pdf
1•runtimewire•1m ago•0 comments

98% of the most popular open-source agents break Meta's Agents Rule of Two

https://safetycard.dev/insights
1•bency•2m ago•0 comments

Creatine might protect the brain from gut inflammation

https://www.psypost.org/a-popular-workout-supplement-might-protect-the-brain-from-gut-inflammation/
1•Exoristos•6m ago•0 comments

I Sent an AI to My Job Interview. So Did the Company. [video]

https://www.youtube.com/watch?v=A0fECnj5sas
1•doctoboggan•6m ago•0 comments

ASCII Porn Predates the Internet but It's Still Everywhere

https://www.vice.com/en/article/ascii-pr0n-porn-predates-the-internet-but-its-still-everywhere-ru...
1•pavel_lishin•6m ago•0 comments

AllCheck keeps movies, TV series, games and books in one library

https://allcheck.app
1•deus42•7m ago•0 comments

Linus Torvalds is using AI to develop Linux kernel code now

https://www.zdnet.com/innovation/linus-torvalds-uses-ai-to-write-linux-kernel-patch/
3•CrankyBear•8m ago•0 comments

MountX: A self-hosted dynamic language compiling to C99

https://github.com/mountxlang-eng/mountxlang
1•mountxlang•9m ago•0 comments

Vaporware as a Means of Entry Deterrence

https://onlinelibrary.wiley.com/doi/abs/10.1111/1467-6451.00204
1•Anon84•10m ago•0 comments

As Federal Court Calls ALPRs Mass Surveillance, EFF Gets Disappointing Ruling

https://www.eff.org/deeplinks/2026/10/federal-court-rules-alprs-are-mass-surveillance-eff-gets-di...
1•hn_acker•11m ago•1 comments

Mystery Sailor Inspired Trump to Switch to Steam Catapults from Electromagnetic

https://www.wsj.com/politics/policy/the-mystery-of-the-unknown-sailor-who-inspired-trump-to-shake...
2•bcaulfield•14m ago•0 comments

Show HN: FandomMap – a map of 700 fan conventions, with their guest lists

https://www.fandommap.com/
1•marcandremongeo•15m ago•0 comments

A browser animation app I built for my little sister

https://mocean-frames.pages.dev/
2•KopikoCappu•15m ago•0 comments

Chaos in Korea's market is sending shockwaves through US chip stocks

https://www.businessinsider.com/stock-market-today-chip-stocks-south-korea-kospi-selloff-mu-2026-10
2•droidjj•15m ago•0 comments

Open Design

https://open-design.ai/
1•handfuloflight•15m ago•0 comments

Show HN: Deslop – Oxlint rules for AI-generated TypeScript

https://github.com/maharshi365/deslop
2•maharshi365•15m ago•0 comments

Everything you learned about SSL is deprecated – Todd Gardner – NDC Toronto 2026 [video]

https://www.youtube.com/watch?v=-9KiLFr8_hI
1•da02•15m ago•0 comments

Ledger supply chain is compromised

https://twitter.com/0xJohannes_/status/2109634513957527974
3•aillia•16m ago•1 comments

How D1 scales to millions of databases

https://blog.cloudflare.com/d1-control-plane/
3•f-serif•17m ago•0 comments

Omnesis – Index and search your digital life

https://omnesis.dev/
1•amai•17m ago•0 comments

Russia Detains Japanese Journalist for Alleged Espionage

https://www.nytimes.com/2026/10/13/world/europe/russia-detains-japanese-journalist.html
1•qweqwe14•17m ago•0 comments

Home and Factory Robots

https://tjacobs.github.io/robots_tracker/
1•tomjacobs•17m ago•1 comments

Show HN: Hev is a Jev-compatible API, answered by humans

https://usehev.com
1•luisrudge•17m ago•0 comments

Politics and the English Language (1946)

https://www.orwellfoundation.com/the-orwell-foundation/orwell/essays-and-other-works/politics-and...
1•1equalsequals1•19m ago•0 comments

Blink-Powered Glasses Could Keep an Eye on Health [video]

https://www.youtube.com/watch?v=NvrESrgnz2s
1•nivedita•20m ago•1 comments

Puter's Mission to Open-Source Everything

https://github.com/HeyPuter/everything
2•liamswayne•21m ago•0 comments

Fed's Hammack: Hope to cool demand, and inflation, without job market pain

https://www.reuters.com/business/feds-hammack-hope-cool-demand-inflation-without-job-market-pain-...
1•frank_clover•23m ago•0 comments

App Size 101: Drop 40% in an afternoon

https://blog.jacobstechtavern.com/p/app-size-101
1•jakey_bakey•23m ago•0 comments

DroidDeck brings the SteamOS experience to Android

https://github.com/Droid-Deck/DroidDeck
1•haunter•24m ago•0 comments

Show HN: XY Music Notation

https://music.xy.dev/
2•jmole•25m ago•0 comments