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

The planet Vulcan: a cautionary tale

https://kevinboone.me/vulcan.html
1•andsoitis•50s ago•0 comments

Min-Max Heap

https://en.wikipedia.org/wiki/Min-max_heap
1•Brysonbw•1m ago•0 comments

The best general advice on earth

https://jsomers.net/blog/william-james-advice
1•7777777phil•1m ago•0 comments

Dependencies in Linux Binaries (2024)

http://thelittleengineerthatcould.blogspot.com/2024/04/hidden-dependencies-in-linux-binaries.html
1•nanis•1m ago•0 comments

Sendspin: Whole-home audio, without the lock-in

https://www.sendspin-audio.com/
1•LelouBil•2m ago•0 comments

Activists break into building site of Microsoft datacentre in Amsterdam

https://www.theguardian.com/world/2026/nov/06/activists-break-into-building-site-of-microsoft-dat...
1•Markoff•2m ago•0 comments

AI agents are getting more complex. Developers shouldn't have to babysit them

https://thenewstack.io/harness-engineering-coding-agents/
1•Brajeshwar•3m ago•0 comments

The Second Photonic Shock: A Model

https://syncretica.substack.com/p/the-second-photonic-shock-a-model
1•7777777phil•7m ago•0 comments

A video game which caused real world violence

https://shkspr.mobi/blog/2026/11/a-video-game-which-caused-real-world-violence/
1•Brajeshwar•7m ago•0 comments

Show HN: Solous, a journaling app like a social media for emotions inside of you

https://solous.net/
1•solous•8m ago•0 comments

Thunderstruck: What does the future hold for lightning?

https://www.theguardian.com/science/ng-interactive/2026/nov/08/future-of-lightning-global-heating...
1•howard941•9m ago•0 comments

U.S. Refineries Make Dramatic Shift Away from Gasoline

https://oilprice.com/Energy/Energy-General/US-Refineries-Make-Dramatic-Shift-Away-From-Gasoline.html
1•iamnothere•12m ago•0 comments

Making musl and proprietary Nvidia drivers work together

https://chimera-linux.org/news/2026/11/musl-nvidia.html
1•birdculture•15m ago•0 comments

Show HN: Image to Image AI: Free AI Image Editor Online – Tancky AI

https://tancky.io/
1•tancky•17m ago•0 comments

A maximally tiny language model

https://tonisagrista.com/blog/2026/tinylm/
2•ilreb•17m ago•0 comments

MIDI Vanilli? Argentina's bass playing fake [video]

https://www.youtube.com/watch?v=FRoXKvD19Po
1•nephihaha•18m ago•0 comments

Show HN: Compress Photos for Email

https://onlineimageoptimizer.com/compress-photos-for-email
1•ImageOptimizer•19m ago•0 comments

The Secret Lives of China's Art Factory Workers

https://www.instapainting.com/blog/the-secret-lives-of-china-art-factory-workers
1•chrischen•20m ago•0 comments

AI can track a single bird over time–based solely on its song

https://www.science.org/content/article/ai-can-track-single-bird-over-time-based-solely-its-song
1•Brajeshwar•21m ago•0 comments

New "high safety" chemicals in plastic food packaging linked to low birth weight

https://www.theguardian.com/us-news/2026/nov/07/nontoxic-plastic-lower-birth-weight-study
2•sandebert•22m ago•2 comments

Show HN: Bobr – a rootless content-addressed build system for Linux

https://bobr.build/
1•alekseimakarov•23m ago•0 comments

Did aliens talk to us in "binary code" at Rendlesham Forest?

https://kevinboone.me/rendelsham-binary.html
2•andsoitis•23m ago•0 comments

Indonesia deploys over 20k troops, generals arrested for wiretapping allegations

https://apnews.com/article/indonesia-security-forces-deployment-wiretapping-8e598661a904d8af89b35...
1•iamnothere•23m ago•0 comments

Netlens.dev

https://netlens.dev
1•6bR35•23m ago•0 comments

Deposition of Atmospheric Microplastics in Snowfall of the Sierra Nevada

https://pubs.acs.org/esthag/article-abstract/doi/10.1021/acs.est.6c02757/5458893/Event-Scale-Depo...
1•blondie9x•24m ago•0 comments

The Gordon Gekko Effect: The Role of Culture in the Financial Industry [pdf]

https://www.newyorkfed.org/medialibrary/media/research/epr/2016/epr_2016_gordon-gekko-effect_lo.pdf
2•tylerdane•24m ago•1 comments

Dune – unholy combination of bash and Lisp

https://adam-mcdaniel.github.io/dune-website/
3•andsoitis•27m ago•0 comments

A Cruise to End All Cruises

https://www.newyorker.com/news/annals-of-the-sea/a-cruise-to-end-all-cruises
1•fortran77•27m ago•0 comments

What I heard at the Legal and Licensing Workshop 2026

https://www.thomas-huehn.com/what-i-heard-at-llw-2026/
2•Tomte•29m ago•0 comments

Patrick Stewart, Susan St. James, and the Brilliant Transformation of Fatherhood

https://www.realclearmarkets.com/articles/2026/11/07/patrick_stewart_susan_st_james_and_the_brill...
2•RickJWagner•31m ago•0 comments