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

AI Marketing

https://www.lerobit.com
1•akliluart•2m ago•0 comments

The teenage hitmen recruited to kill across Europe

https://www.bbc.com/news/articles/czrjyevmv61o
2•1659447091•3m ago•0 comments

Futurism says Meta has "almost nothing" to show for AI. The numbers say

https://runtimewire.com/article/futurism-says-meta-has-almost-nothing-to-show-for-ai-the-numbers-...
4•ryanmerket•8m ago•0 comments

Ask HN: Do Something about Bots

3•gregdaniels421•9m ago•2 comments

MkLinux and the pimped-out Apple Workgroup Server 9150

http://oldvcr.blogspot.com/2026/08/mklinux-and-pimped-out-apple-workgroup.html
5•goldenskye•9m ago•0 comments

Linux desktop market share has hit over 10% in North America

https://old.reddit.com/r/linux/comments/1vcpk8i/linux_desktop_market_share_has_hit_over_10_in/
3•dviola•12m ago•0 comments

Don't Take the Black Pill (Text Adaptation)

https://andrewkelley.me/post/dont-take-black-pill.html
3•zdw•18m ago•0 comments

Show HN: FirstEmployee.ai – Start a Business

https://firstemployee.ai/
2•nadermx•23m ago•0 comments

Plug-in solar is coming. Plug-in batteries should follow

https://www.regen.co.uk/insights/plug-in-solar-is-coming-plug-in-batteries-should-follow
2•thelastgallon•25m ago•0 comments

Deep-sea vehicles spot 'alien' sharks deep beneath the waves in the Pacific

https://www.science.org/content/article/deep-sea-vehicles-spot-alien-sharks-deep-beneath-waves-pa...
2•pkaeding•31m ago•0 comments

The world first agentic AI radio

https://www.twitch.tv/newsmyimaginationai
4•myimaginationai•40m ago•1 comments

Recurse Center Halftime Reflection

https://holistudio.github.io//2025/11/02/RC-half/
2•luu•46m ago•0 comments

Four Time Scales for Technology Development and Deployment

https://rodneybrooks.com/four-time-scales-for-technology-development-and-deployment/
10•jeffreyrogers•55m ago•0 comments

Design Thinking Is B.S. (2018)

https://www.fastcompany.com/90166804/design-thinking-is-b-s
4•walterbell•1h ago•0 comments

DeepMind Disbands AlphaFold Team, Pivots to Gemini

https://unusualwhales.com/news/deepmind-disbands-alphafold-team-gemini-pivot
4•gmays•1h ago•1 comments

Building agents that survive their own execution

https://conol.ai/blog/building-agents-that-survive-their-own-execution
2•greatony•1h ago•0 comments

When random.bytes() runs but doesn't work

https://insider.btcpp.dev/p/when-randombytes-runs-but-doesnt
3•Funes-•1h ago•0 comments

Show HN: I'm a 15 Year Old Wannabe Engineer, This Is a Cycloidal Gearbox I Built

https://github.com/tom-ilan/cycloidal_gearbox
27•tomilan•1h ago•7 comments

What 'Pluribus' Gets Right About the Hive Mind (2025)

https://www.psychologytoday.com/us/blog/priceless/202512/what-pluribus-gets-right-about-the-hive-...
2•walterbell•1h ago•0 comments

Portal: Current Events

https://en.wikipedia.org/wiki/Portal:Current_events
5•adm4•1h ago•0 comments

Fuck the Algorithm. Own Your Data

https://github.com/adnqcr7-code/privacy-yt-downloader
3•kairos_agent•1h ago•0 comments

Living in the Math World Means Threading the Needle

https://www.quantamagazine.org/hong-wang-wins-2026-fields-medal-the-third-woman-ever-20260723/
3•gmays•1h ago•0 comments

Show HN: CostPerPrompt – Live AI API pricing and real-workload cost calculators

https://costperprompt.com/
3•ahmed_hassan7•1h ago•0 comments

Inverseminar

https://phys.org/news/2026-07-inverting-seminar-recover-scientific-papers.html
4•sundarurfriend•1h ago•0 comments

'Death by organ donation' floated for patients approved for euthanasia

https://nationalpost.com/news/death-by-organ-donation-for-maid-patients
3•walterbell•1h ago•0 comments

Hiring FDE's (full stack software eng) // 100K+ & equity // AI for Manufacturing

https://www.tryharmony.ai/
2•georgeharmony•1h ago•0 comments

I made a free directory to submit your games

https://www.twelve.games
3•mattmerrick•1h ago•0 comments

Token diplomacy: How China is shaping the AI future

https://www.semafor.com/article/07/28/2026/token-diplomacy-how-china-is-shaping-the-worlds-ai-future
4•qwikhost•1h ago•4 comments

Bessent and the Fed help Japan reverse months of yen losses

https://www.japantimes.co.jp/business/2026/08/01/economy/us-treasury-yen-support/
6•mikhael•1h ago•1 comments

The Linux distro and desktop brawler

https://distrofighter.com/
6•ashitlerferad•1h ago•0 comments