frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

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

Using Google? Now you can build with it in Lovable

https://lovable.dev/blog/already-using-google-now-you-can-build-with-it-in-lovable
1•doener•1m ago•0 comments

12 years selling a PHP script, now pivoting to a B2C SaaS and a B2B WP Plugin

https://www.indiehackers.com/post/12-years-selling-a-php-script-now-pivoting-to-a-b2c-saas-a-b2b-...
1•nicolafranchini•1m ago•0 comments

SpaceX Files for IPO

https://www.wsj.com/livecoverage/stock-market-today-dow-sp-500-nasdaq-05-20-2026
1•ericmay•1m ago•0 comments

SpaceX S-1

https://www.sec.gov/Archives/edgar/data/1181412/000162828026036936/spaceexplorationtechnologi.htm
1•cachecow•3m ago•0 comments

$40K for an $8 knob? The case for a military right to repair

https://fighttorepair.substack.com/p/uncle-sam-pays-40000-for-an-8-knob
1•fighttorepair•6m ago•0 comments

Data centers could lower power bills. Energy utilities won't

https://www.governance.fyi/p/data-centers-could-lower-power-bills
1•bigbobbeeper•7m ago•0 comments

Supercharge Your C64 with C64 OS – Gregory Nacu [video]

https://www.youtube.com/watch?v=yb_xULWEmCw
2•oldnetguy•10m ago•0 comments

Show HN: AI Editor for Websites

1•yury_h•10m ago•0 comments

Seeking legal review on a source-available license for individual developers

https://github.com/CYB3RCA4T/CGPSAL-v1.0/discussions/1
1•CYB3RCA4T•11m ago•0 comments

Methodology for Selecting Runtime Architecture Patterns for LLM Agents

https://arxiv.org/abs/2605.20173
1•Anon84•11m ago•0 comments

Driver intentionally drove Cybertruck into lake to use vehicle's 'Wade Mode

https://www.wcvb.com/article/cybertruck-lake-wade-mode-incident/71360750
1•c420•14m ago•0 comments

We don't require human review on most PRs anymore

https://eng.miragesecurity.ai/posts/10x-change-management/
2•nickdirienzo•15m ago•1 comments

Gorilla: A fast, scalable, in-memory time series database (2016)

https://blog.acolyer.org/2016/05/03/gorilla-a-fast-scalable-in-memory-time-series-database/
1•xnorswap•17m ago•0 comments

AI Resist List

https://airesistlist.org/
2•yacin•17m ago•0 comments

ALS prevention and cure with zinc vs. copper: 15 to 1

https://unbekoming.substack.com/p/what-is-motor-neuron-disease
1•vinyasi•17m ago•0 comments

Bolt CEO says he let go of HR team for creating problems that didn't exist

https://fortune.com/2026/05/19/bolt-ceo-ryan-breslow-cut-hr-department-causing-problems-fintech-s...
9•cdrnsf•19m ago•1 comments

Show HN: New NPM Supply chain Attack?

https://github.com/AdamGonda/ward
1•adamgonda•19m ago•0 comments

Nvidia Announces Financial Results for First Quarter Fiscal 2027

https://nvidianews.nvidia.com/news/nvidia-announces-financial-results-for-first-quarter-fiscal-2027
4•baal80spam•21m ago•0 comments

Open Source Burnout Claims Another Project

https://vlad.website/nvim-treesitter-burnout/
1•linolevan•22m ago•0 comments

In Yesterday's IO Keynote Google Declared War on the Remnants of the Web

https://tldr.nettime.org/@tante/116605858023186072
4•ndr42•23m ago•0 comments

Colorado Amended SB051 (Age Verification Bill) to Exclude Open Source Projects

https://legiscan.com/CO/bill/SB051/2026
2•ki4jgt•25m ago•1 comments

OpenAI Guaranteed Capacity

https://openai.com/business/guaranteed-capacity/
1•punnerud•26m ago•0 comments

The first western pilot to fly the MiG-29 Soviet fighter plane

https://coldwarconversations.com/episode106/
1•Anon84•27m ago•0 comments

Cerebras is now a public company

https://www.cerebras.ai/cbrs
2•KronisLV•27m ago•0 comments

Show HN: Crucible – 8 legendary songwriters tear apart your lyrics, no login

https://songforgeai.com/crucible
2•Torgin•28m ago•1 comments

About My Forza Horizon 6 Plan I Returned the Game Unopened Today (May 20, 2026)

https://samhenrycliff.medium.com/about-my-forza-horizon-6-plan-i-returned-the-game-unopened-today...
1•6stringmerc•29m ago•0 comments

OpenAI Announces Construction of New Data Center on Top of Sick Child

https://www.youtube.com/watch?v=CkDKmSMvfmk
3•unleaded•29m ago•0 comments

KE:SAI Open Science Autonomy Lab

https://kesai.eu/
1•marvinborner•30m ago•0 comments

Google published exploit code for an unfixed Chromium bug

https://arstechnica.com/security/2026/05/google-publishes-exploit-code-threatening-millions-of-ch...
5•logickkk1•30m ago•0 comments

Revised^7 Report on Scheme, Large: Procedural Fascicle Draft is now public

https://r7rs.org/large/fascicles/proc/
1•pmcgoron•32m ago•1 comments