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

World's First: Minor Authors Public License for Expression (Maple-1.0)

https://openrockets.com/research/maple/v1/
1•interkids•4m ago•1 comments

Prosecutors allege man used AI to scrape court website

https://www.abc.net.au/news/2026-09-10/christopher-duff-to-stand-trial-over-nsw-ai-court-data-bre...
1•yeetosaurusrex•10m ago•0 comments

Artificial Intelligence Markup Language

https://en.wikipedia.org/wiki/Artificial_Intelligence_Markup_Language
2•marvinborner•12m ago•0 comments

A Design Space Exploration of Async/Await

https://cel.cs.brown.edu/blog/design-space-async-await/
1•matt_d•14m ago•0 comments

SubmitSafe

https://submitsafe.app/
2•igrik•14m ago•0 comments

Show HN: Model meets Reality: Model and test your understanding

https://modelmeetsreality.xyz/
1•sauronsrv•14m ago•0 comments

Automatic Key Exchange: faster, post-quantum secure origin handshakes

https://blog.cloudflare.com/automatic-key-exchange-for-origins/
1•ackackack•15m ago•0 comments

What AI Means for Technical Competence

https://letters.unchartedpathbreakthroughs.com/posts/what-ai-means-for-technical-competence
2•mooreds•18m ago•0 comments

The Evolution of the Agent Harness – By Dan McAteer

https://www.latent.space/p/attention-interface
1•JohnBerryman•19m ago•0 comments

Largest AI Infrastructure in Space announced by the president of France

https://www.businesswire.com/news/home/20260909411854/en/Worlds-Largest-AI-Infrastructure-in-Spac...
1•4thelol•21m ago•0 comments

Diagnosing schizophrenia is tricky. Can AI help?

https://knowablemagazine.org/content/article/mind/2026/how-ai-can-listen-for-signs-of-schizophrenia
2•knowablemag•22m ago•1 comments

Chrome tells ~1M users Magic Actions is malware, despite Safe Browsing clearance

https://groups.google.com/a/chromium.org/g/chromium-extensions/c/MUe0EkfKCnY
3•OzzyOzbour•23m ago•0 comments

Apple Unveils $1,999 Foldable iPhone Duo

https://www.bloomberg.com/news/videos/2026-09-09/apple-unveils-1-999-foldable-iphone-duo-video
1•sbulaev•24m ago•0 comments

Design for iPhone Duo

https://www.youtube.com/watch?v=do3UqxfYc3I
1•hbarka•27m ago•0 comments

Andrew Tulloch Departs Mark Zuckerberg's Meta AI Lab

https://www.wsj.com/tech/ai/star-ai-researcher-is-leaving-meta-8906e4aa
3•bobrenjc93•29m ago•0 comments

Japan's 'killing stone' splits in two (2022)

https://www.theguardian.com/world/2022/mar/07/japans-killing-stone-splits-in-two-releasing-supers...
2•robotnikman•29m ago•0 comments

Pro wrestling for reinforcement-learning ducks

https://duckfight.club
1•ecares•30m ago•0 comments

WeatherNext 3 by Google in the simplest weather app

https://weather.alen.ro/
1•alentodorov•34m ago•0 comments

Core War: three crowns on the King of the Hill

https://dm2tim.de/en/offtopic/core-war.html
2•Levitating•34m ago•0 comments

US airports to let some people without tickets pass through security

https://www.theguardian.com/us-news/2026/sep/09/airport-security-tsa-precheck
1•bookofjoe•37m ago•0 comments

HexOS Buddy Backups

https://docs.hexos.com/blog/2026-09-09
2•abraham•43m ago•0 comments

How safe are digital driver's licences?

https://www.rnz.co.nz/news/community/1309151/how-safe-are-digital-driver-s-licences
3•billybuckwheat•46m ago•0 comments

Engineering students made a self playing piano from scratch [video]

https://www.youtube.com/watch?v=Se_admCx8cM
2•duck•48m ago•1 comments

United States Ships War Material to Israel Aboard Passenger Flights

https://theintercept.com/2026/09/09/united-airlines-flights-israel-weapons-hardware-transport/
6•jbegley•49m ago•0 comments

What makes $BigTechCompany's products bad, anyway?

https://herecomesthemoon.net/2026/09/why-is-big-tech-bad/
2•Mond_•49m ago•0 comments

The IBM PC, Part 2: Tsunami

https://technicshistory.com/2026/08/29/the-ibm-pc-part-2-tsunami/
1•cfmcdonald•49m ago•0 comments

Durable execution without history replay

https://trigora.dev/blog/durable-execution-without-history-replay/
1•hypervs•50m ago•0 comments

Google pixel 11 pro fold

https://store.google.com/product/pixel_11_pro_fold?hl=en-US
1•nothrowaways•52m ago•0 comments

Ask HN: Would you use an MCP server for your personality test result?

1•LeoLeaS•54m ago•0 comments

Show HN: Jobrake: Fetch Jobs from LinkedIn and Indeed

https://github.com/eyayaw/jobrake
1•eyayaw•56m ago•0 comments