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

Behind the scenes: Seattle Times' World Cup photo team takes the pitch

https://www.seattletimes.com/seattle-news/world-cup-seattle/behind-the-scenes-seattle-times-world...
1•ynac•29s ago•0 comments

Ask HN: Instagram blocked my new account what can I do?

1•coreyp_1•3m ago•0 comments

[STORY] Samsara

https://slatestarcodex.com/2019/11/04/samsara/
1•barry-cotter•10m ago•0 comments

Pg_stat_ch: PostgreSQL Query Telemetry Exporter to ClickHouse

https://github.com/ClickHouse/pg_stat_ch
1•saisrirampur•11m ago•0 comments

Ancient Coins: What About Spartan Coins?

https://coinweek.com/ancient-spartan-coins/
1•thunderbong•18m ago•0 comments

Baby Belt Pro – DIY open-source belt 3D printer

https://www.printcepts.com/babybeltpro
1•kmmbvnr_•19m ago•0 comments

Show HN: Minesweeper.free – Play minesweeper online free

https://minesweeper.free/
1•nadermx•21m ago•0 comments

New DNA technology leads to identification of Revolutionary War soldier

https://www.cbsnews.com/news/revolutionary-war-soldier-identified-john-doe-technology-camden/
1•jnord•26m ago•0 comments

Would You Let A.I. Michael Caine Read You the 'Odyssey'?

https://www.nytimes.com/2026/06/23/books/michael-caine-odyssey-ai.html
1•bookofjoe•31m ago•1 comments

You Feel Exhausted Without Having "Done" Anything Physically

https://facilethings.com/blog/en/decision-fatigue
2•vinhnx•35m ago•0 comments

If you're a button, you have one job

https://unsung.aresluna.org/if-youre-a-button-you-have-one-job/
2•nozzlegear•41m ago•0 comments

A rate-control scroll gesture for mobile reading

https://github.com/somekiwiplease/ThumbStick
1•somekiwiplease•53m ago•0 comments

The Dark Side of Open Source: SSPL, BSL, and the License-Change Problem

https://linuxidx.com/posts/the-dark-side-of-open-source-real-problems-no-hype.html
2•infoozle•1h ago•0 comments

Efficacy and Safety of Psilocybin in Treatment-Resistant Major Depression

https://jamanetwork.com/journals/jamapsychiatry/fullarticle/2846478
2•cpncrunch•1h ago•0 comments

Deterministic AI Auditing

https://claude.ai/new
1•whyharsh_•1h ago•0 comments

Show HN: Inches to MM converter for manufacturing and hardware checks

https://inches-to-mm.com
1•robot1996•1h ago•1 comments

We Scaled PgBouncer to 4× Higher Throughput

https://clickhouse.com/blog/pgbouncer-clickhouse-managed-postgres
2•saisrirampur•1h ago•0 comments

Anthropic performing prompt injection on its users

https://old.reddit.com/r/LLMDevs/comments/1udpw9h/just_got_this_response_from_claude_what_is_going/
5•murderfs•1h ago•0 comments

AI CLI that fixes broken dev tool installs

https://murderszn.github.io/sprout/
1•murderszn•1h ago•0 comments

Record-breaking solo rower Kelsey Pfendler arrives in Hawaii

https://www.hawaiinewsnow.com/2026/07/04/record-breaking-solo-rower-kelsey-pfendler-arrives-hawaii/
2•MaysonL•1h ago•0 comments

Show HN: Two-tier-memory – queryable long-term memory for AI coding agents

https://github.com/tadelstein9/two-tier-memory
1•tadelstein•1h ago•0 comments

Ubuntu 24.04 on Intel Mac

https://github.com/mozekin/apple-bce-drv/blob/aur/INSTALL-UBUNTU.md
3•mozzinator•1h ago•0 comments

Review Frontloading: Do You Love This App? Y/N

https://functionmouse.com/frontloading/
2•functionmouse•1h ago•0 comments

Bugs happen: The easy way to compare solo PQ to ECC+PQ

https://blog.cr.yp.to/20260704-bugs.html
2•zdw•1h ago•0 comments

If I designed a Commodore Phone

https://retrogamecoders.com/if-i-designed-a-commodore-phone/
3•ibobev•1h ago•1 comments

Egg consumption inversely correlated with Alzheimer's

https://pubmed.ncbi.nlm.nih.gov/42002260/
36•natbennett•1h ago•13 comments

My side quest measuring input latency with VK_EXT_present_timing

https://themaister.net/blog/2026/07/02/my-side-quest-measuring-input-latency-with-vk_ext_present_...
2•ibobev•1h ago•0 comments

Spritework on the ZX Spectrum: Rendering

https://bumbershootsoft.wordpress.com/2026/07/04/spritework-on-the-zx-spectrum-rendering/
2•ibobev•1h ago•0 comments

Benzo(a)pyrene

https://en.wikipedia.org/wiki/Benzo(a)pyrene
3•libpcap•1h ago•0 comments

Trying to buy a sandwich with HTTP 402

https://andrewacomb.substack.com/p/trying-to-buy-a-sandwich-with-http
4•acombandrew•1h ago•1 comments