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 Joy of Why (podcast): Are We Thinking Correctly About AI Intelligence?

https://www.quantamagazine.org/are-we-thinking-correctly-about-ai-intelligence-20260820/
1•Terretta•9m ago•1 comments

Procedural Three.js web design templates for agents

https://threeui.com/browse
1•luispa•9m ago•0 comments

Kayva – continuous care on the watch you wear

https://www.kayvahealth.com/
1•abhinav_rana•11m ago•0 comments

Bidad (Outcry). A Film by Soheil Beiraghi [video]

https://www.youtube.com/watch?v=Q2phizeC6Lo
1•fodmap•15m ago•1 comments

Comparing open vs. closed models across the eras of frontier models

https://newsletter.semianalysis.com/p/are-open-models-catching-up
2•giuliomagnifico•17m ago•0 comments

Enabling the next-generation trait solver on nightly

https://blog.rust-lang.org/2026/08/21/enabling-next-solver-on-nightly/
1•KolmogorovComp•23m ago•0 comments

Show HN: I built a tool for creating mock HTTP endpoints

https://www.http-response.com/
2•primalscreamer•24m ago•1 comments

Who Should Pay for Source Code Availability?

https://kristoff.it/blog/source-code-availability/
1•r3ason•25m ago•0 comments

Hidden Zillow listings created fake supply shock, raising NYC rents, lawsuit

https://arstechnica.com/tech-policy/2026/08/class-action-accuses-brokers-of-hiding-zillow-listing...
2•pseudolus•29m ago•0 comments

Z80–The 1970s Microprocessor Still Alive

https://www.computer.org/csdl/magazine/mi/2021/06/09623402/1yJTvlRLmhi
1•asdefghyk•36m ago•1 comments

Munder Difflin – Agent harness to run an office of your clones

https://munderdiffl.in/
1•simonpure•36m ago•0 comments

These animals can predict volcanic eruptions, storms and more

https://www.cbc.ca/documentaries/the-nature-of-things/these-animals-can-predict-volcanic-eruption...
1•svenfaw•38m ago•0 comments

At the moment: 472 gas-fired power plants are under development in the US

https://twitter.com/NatBullard/status/2090496193910730883
2•ksec•39m ago•0 comments

CyberStrike – open-source AI harness for offensive security (AGPL)

https://github.com/CyberStrikeus/CyberStrike
2•orhanyildirim•41m ago•1 comments

Math Academy – How Our AI Works

https://www.mathacademy.com/how-our-ai-works
1•olvy0•42m ago•0 comments

Panache: Language server, formatter, linter for Markdown, Quarto, and R Markdown

https://github.com/jolars/panache
1•fhchl•42m ago•0 comments

Saab Unveils Stealthy Supersonic 'Fighter Drone' Concept

https://www.twz.com/air/saab-unveils-stealthy-supersonic-fighter-drone-concept
1•madspindel•43m ago•0 comments

Waterloo's student rocketry team breaks a world record

https://uwaterloo.ca/news/engineering/waterloos-student-rocketry-team-breaks-world-record
3•pseudolus•52m ago•0 comments

ISRO will not make any launch vehicle, all tech to be handed to private sector

https://www.indiatoday.in/science/story/isro-will-not-make-any-launch-vehicle-all-tech-to-be-hand...
1•thunderbong•57m ago•0 comments

The hold that could not release itself

https://shitrat.ai/log/the-hold-that-could-not-release-itself
1•handfuloflight•1h ago•0 comments

Hermeus, a venture-backed defense aviation company

https://hermeus.com
1•ksec•1h ago•0 comments

MacStories is posting on Twitter again

https://mastodon.macstories.net/@viticci/117134048567780192
2•latexr•1h ago•0 comments

Homebrew 68K Machine Has a PCI Bus

https://hackaday.com/2026/08/20/homebrew-68k-machine-has-a-pci-bus/
4•birdculture•1h ago•1 comments

New chip mimics how cancer spreads

https://ecancer.org/en/news/28752-new-chip-mimics-how-cancer-spreads
2•giuliomagnifico•1h ago•0 comments

Fypbid.lol

https://fypbid.lol/
1•Teyz•1h ago•0 comments

AWS Security makes an inscrutable choice

https://www.theregister.com/security/2026/08/22/aws-security-makes-an-inscrutable-choice-corey-qu...
2•neuroelectron•1h ago•0 comments

Tech Layoffs 2026 – 170,777 Jobs Cut

https://layoffhedge.com/industry/tech-layoffs-2026
5•msolujic•1h ago•1 comments

Embedded AI

https://nostarch.com/embedded-ai
2•0x54MUR41•1h ago•0 comments

Therapy for the Vibe-Coded Brain

https://www.youtube.com/watch?v=DkhhE97Swmo
1•conferza•1h ago•0 comments

Apple lays off 200 people across Vision Pro and Siri teams

https://9to5mac.com/2026/08/21/apple-lays-off-200-people-across-vision-pro-and-siri-teams/
5•ksec•1h ago•0 comments