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

Five web developers built an iOS keyboard extension with Expo

https://expo.dev/blog/supernova-ios-keyboard-extension-expo
1•brandrick•1m ago•0 comments

A Multitasking Universal Operating System for Atari ST Computers

https://archive.org/details/manual_20260914
1•andrewstuart•2m ago•0 comments

Japan's Hometown Tax

https://www.kalzumeus.com/2018/10/19/japanese-hometown-tax/
1•waximabbax•2m ago•0 comments

The Southern African Bi-Oceanic Railway Could Be a Game-Changer

https://korybko.substack.com/p/the-southern-african-bi-oceanic-railway
1•paulpauper•3m ago•0 comments

Linting, but this time it's personal

https://dblc.fyi/blog/linting-but-this-time-it-is-personal/
1•dava96•3m ago•0 comments

The Joy of True Mental Effort

https://www.theatlantic.com/newsletters/2026/11/mental-effort-math-puzzles/689451/
1•paulpauper•3m ago•0 comments

FOSDEM 2027 Accepted Stands: complete list

https://fosdem.org/2027/news/accepted-stands-complete/
2•DamonHD•5m ago•0 comments

30 Years for Moving a Box

https://www.theatlantic.com/politics/2026/11/daniel-sanchez-prairieland-ice-protest/689372/
2•paulpauper•5m ago•0 comments

Grok Apps Exposed xAI's Business Secrets and People's Private Data

https://blog.claroc.io/ghostshares-grok-build-apps/
3•aeinbu•6m ago•1 comments

The Ocarina of Time remake in 100 screenshots

https://gameandword.substack.com/p/the-ocarina-of-time-remake-in-100
1•brandrick•8m ago•0 comments

Building a 40k lumen DIY lamp

https://yakshed.com/lamp/
2•abound•9m ago•1 comments

32 Coding Agent Apps Reviewed

https://codebrief.com/2026/11/32-coding-agent-apps-reviewed/
2•ghempton•9m ago•0 comments

Dutch websites warn of malicious ad code that tried to hack old iPhones

https://nltimes.nl/2026/11/15/least-12-dutch-websites-warn-malicious-ad-code-tried-hack-old-iphones
3•giuliomagnifico•10m ago•0 comments

A CEO gave his employees Fridays off. 3 years later, revenue is up about 160%

https://fortune.com/2026/11/08/ceo-four-day-workweek-fridays-off-brick-media-revenue/
2•gpi•11m ago•0 comments

OLED iPad mini review: A modern multitasker

https://sixcolors.com/post/2026/11/ipad-mini-review-a-modern-multitasker/
2•tosh•14m ago•0 comments

Show HN: I built a free, Python micro-learning platform with real Python tasks

https://www.blockofbytes.com/
3•Zernat•14m ago•1 comments

Clice v1.0 Released: Welcome to Modern C++

https://ykiko.me/en/articles/2105384023094834022/
3•molenzwiebel•14m ago•0 comments

Show HN: Fondue – A meeting where everyone talks at once

https://fondue.chat/p/36ebd9c3/j/A9UY-Y2S5
3•blu3mo•17m ago•0 comments

Groma.md: Stay in control of your architecture as AI agents write code

https://github.com/MrLesk/Groma.md
2•mrlesk•18m ago•1 comments

Bessent Says Nvidia Needs 'Dramatic Shakeup' with Huang Out

https://www.bloomberg.com/news/articles/2026-11-15/bessent-says-nvidia-needs-dramatic-shakeup-aft...
3•porridgeraisin•19m ago•0 comments

Tuning a Linux laptop for AI-assisted development

https://a115.co.uk/tuning-a-linux-laptop-for-ai-assisted-development/
2•a115ltd•21m ago•0 comments

Creating product demos by mocking your API (feat. tRPC)

https://mortenson.coffee/blog/creating-product-demos-mocking-your-api/
2•mortensonsam•21m ago•0 comments

Show HN: SecondGlow – use a 5K or 4K iMac as a monitor for an Apple Silicon Mac

https://secondglow.app/
2•chalmovsky•23m ago•1 comments

GMSL v1.2.5 Released

https://github.com/jgrahamc/gmsl/releases/tag/v.1.2.5
2•jgrahamc•23m ago•1 comments

GitSeed – Self-hosted control plane for AI coding agents

https://github.com/gitseed-dev/gitseed
2•tseed•24m ago•0 comments

Kiosk Satellite for Home Assistant

https://kiosksatellite.com/
3•edward•24m ago•0 comments

Hacking Forums ForumNOX

https://forumnox.com/
2•Jokerr•25m ago•0 comments

Counterfeit MacBook charger teardown: convincing outside but dangerous inside

http://www.righto.com/2016/03/counterfeit-macbook-charger-teardown.html
1•zenincognito•26m ago•1 comments

AdGuard Home: Next-Gen – Blocking 2.3M Addresses on a $10 OpenStick

https://blog.bosscher.ch/posts/adguard_home_next_gen/
2•LaurensBER•26m ago•1 comments

Build a Telegram Language Tutor That Remembers Your Mistakes

https://quickchat.ai/post/telegram-language-tutor-vocabulary-log
1•piotrgrudzien•26m ago•0 comments