frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Ask HN: Help with doing statistics over machine code

2•phafu•7mo 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•7mo 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•7mo 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).

EIG Letter: DHS Should Revise Proposed H-1B Weighted Lottery

https://eig.org/eig-letter-dhs-should-revise-proposed-h-1b-weighted-lottery-to-prioritize-top-tal...
1•Romanorum•5m ago•0 comments

Nuclear developer proposes using Navy reactors for data centres

https://financialpost.com/commodities/energy/developer-proposes-navy-reactors-for-data-centres
2•pseudolus•7m ago•1 comments

Nvidia to poach top staff from AI chip startup Groq in licensing deal

https://www.ft.com/content/3584197e-a99a-4a06-9386-dc65cf603f45
1•bookofjoe•11m ago•1 comments

Speed Act passes in House despite changes that threaten clean power projects

https://insideclimatenews.org/news/18122025/speed-act-passes-in-house-threatens-clean-power-proje...
1•pseudolus•12m ago•0 comments

The dollar game

https://www.imf.org/en/publications/fandd/issues/2025/12/cafe-economics-the-dollar-game-bruce-edw...
2•hhs•15m ago•0 comments

Dirlock

https://gitlab.steamos.cloud/holo/dirlock
1•birdculture•15m ago•0 comments

'I've been allergic to AI for a long time': an interview with Peter Thiel

https://spectator.com/article/ive-been-allergic-to-ai-for-a-long-time-an-interview-with-peter-thiel/
1•ksec•18m ago•0 comments

Internet sleuths are un-redacting some of the Epstein files

https://www.cbc.ca/news/world/epstein-files-unredacting-9.7027723
1•01-_-•18m ago•0 comments

One formula that demystifies 3D graphics [video]

https://www.youtube.com/watch?v=qjWkNZ0SXfo
2•todsacerdoti•20m ago•0 comments

Monetizers vs. manufactures: How the AI market could splinter in 2026

https://www.cnbc.com/2025/12/25/how-the-ai-market-could-splinter-in-2026-.html
1•pseudolus•21m ago•0 comments

Show HN: Neural Network Flies – train flies to find food

https://claude.ai/public/artifacts/504981f5-e975-45c1-ab28-336426c5dc76
1•logicallee•22m ago•1 comments

Santa Claus Through the Years: Vintage Photos from the Past

https://rarehistoricalphotos.com/santa-claus-vintage-photos/
1•Brajeshwar•23m ago•0 comments

Ask HN: Would a nonprofit cloud storage service make sense?

2•theaitch•27m ago•2 comments

The Sweeney Filming Locations – Olympia and W14 [video]

https://www.youtube.com/watch?v=1tPFNrP-xGQ
1•zeristor•27m ago•1 comments

When the World Logs in and Everything Breaks

https://comuniq.xyz/post?t=649
1•01-_-•29m ago•0 comments

Let boredom be the mother of invention

https://www.ft.com/content/20720f08-ba41-44e1-8ec0-4653d65d9757
1•hhs•29m ago•0 comments

Show HN: Play Riichi Mahjong Online

https://online-riichi.com
2•cerpins•31m ago•1 comments

How Claude Code is helping me as an open source maintainer

https://stanislas.blog/2025/12/claude-code-opus-open-source-maintenance/
1•angristan•32m ago•0 comments

Confirmation of Breslow's hypothesis: A carbene stable in liquid water

https://www.science.org/doi/10.1126/sciadv.adr9681
1•bookofjoe•34m ago•0 comments

What Is Santa's Address at the North Pole?

https://parade.com/1123345/stephanieosmanski/santa-claus-address/
2•thunderbong•38m ago•0 comments

Make screenshots stand out – add backgrounds, frames, and annotate

https://www.screenshoteditor.live/
1•dikshant_shah•38m ago•1 comments

The shadow Russia casts over Europe has forced it to face the truth

https://www.cnn.com/2025/12/25/europe/russia-europe-analysis-intl-cmd
6•breve•47m ago•0 comments

RoomStaging

https://roomstaging.net
1•deiniuuuu•48m ago•0 comments

Officials discover a million more documents potentially related to Epstein case

https://www.bbc.com/news/articles/czdgz84dn35o
2•helloplanets•49m ago•0 comments

Show HN: Smig – Automatic SurrealDB Migrations

https://smig.build/
1•kathysledge•50m ago•0 comments

Goodbye Motorola

https://old.reddit.com/r/motorola/comments/1puoqh6/goodbye_motorola/
6•sipofwater•55m ago•0 comments

Show HN: Localhorst – Websites Hosted in the Browser

https://localhorst.43z.one/
2•h43z•56m ago•0 comments

Ask HN: Why can't I find NDK for Linux ARM64?

1•DenisDolya•1h ago•0 comments

Mattermost restricted access to old messages after 10000 limit is reached

https://github.com/mattermost/mattermost/issues/34271
45•xvilka•1h ago•20 comments

Package managers keep using Git as a database, it never works out

https://nesbitt.io/2025/12/24/package-managers-keep-using-git-as-a-database.html
1•WhyNotHugo•1h ago•0 comments