frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Ask HN: Help with doing statistics over machine code

2•phafu•6mo 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•6mo 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•6mo 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).

More Data Independence and the History of the Relational Model

https://buttondown.com/jaffray/archive/more-data-independence-and-the-history-of-the/
1•ibobev•29s ago•0 comments

AI Wet Labs – Chapter 1 [video]

https://www.youtube.com/watch?v=XhKbq8Jzp0U
1•inshard•51s ago•1 comments

Why Am I Paying $40k for the Birth of My Child?

https://aaronstannard.com/40k-baby/
1•Aaronontheweb•1m ago•0 comments

Rockstar co-founder compares AI to 'mad cow disease'

https://www.pcgamer.com/software/ai/rockstar-co-founder-compares-ai-to-mad-cow-disease-and-says-t...
2•dzonga•2m ago•0 comments

Mozilla's Latest Quagmire

https://rubenerd.com/mozillas-latest-quagmire/
1•nivethan•2m ago•0 comments

Unitree Robotics

https://www.unitree.com/
1•stefankuehnel•4m ago•0 comments

Locales, encodings, Unicode, and C++ [pdf]

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2020r0.pdf
1•fanf2•4m ago•0 comments

Show HN: Locu – Deep work sessions for engineers (Linear/Jira, local-first)

https://locu.app
1•drankou•7m ago•0 comments

GTA 6 Is Likely Too Advanced for 60FPS, Even on the PS5 Pro

https://www.gtaboom.com/gta-vi-60-fps-discussion-711c
2•mdotk•11m ago•0 comments

Earth is spinning faster, leading timekeepers to consider an unprecedented move

https://www.cnn.com/2025/07/21/science/earth-spinning-faster-shorter-days
3•tosh•15m ago•0 comments

Nano Banana 2

https://banananano2.io
1•122506•15m ago•1 comments

DataSetIQ – The Global Macro Data Intelligence Platform

https://www.datasetiq.com/
1•dsptl•16m ago•1 comments

Prisma 7

https://www.prisma.io/blog/announcing-prisma-orm-7-0-0
1•cfcfcf•16m ago•0 comments

Reynolds' Parametricity (2016) [pdf]

https://www.cs.uoregon.edu/research/summerschool/summer16/notes/johann-lecture3-slides.pdf
1•measurablefunc•17m ago•0 comments

Canadian Court: OVHcloud from France must hand over user data

https://www.heise.de/en/news/Canadian-Court-OVHcloud-from-France-must-hand-over-user-data-1109202...
1•edwinjm•20m ago•0 comments

Amazon Nova Foundation Models

https://nova.amazon.com/act
2•franze•20m ago•1 comments

Shopify Breaks Down on Busy Cyber Monday

https://www.wsj.com/business/retail/shopify-breaks-down-on-busy-cyber-monday-4ce789e1
2•JumpCrisscross•22m ago•1 comments

A jaw-dropping JWST image of a fantastically terrifying star system

https://badastronomy.beehiiv.com/p/a-ridiculously-jaw-dropping-jwst-image-of-a-fantastically-terr...
2•MaysonL•24m ago•1 comments

Stop Hiring for Languages. Start Hiring Great Engineers

https://medium.com/jonathans-musings/stop-hiring-for-languages-start-hiring-great-engineers-cd6ac...
2•mustaphah•24m ago•0 comments

Ask HN: Best Resources for Understanding GLMs

1•dandelionv1bes•25m ago•0 comments

Pose-free 3D Gaussian splatting via shape-ray estimation

https://arxiv.org/abs/2505.22978
3•PaulHoule•26m ago•0 comments

The first JPEG XL image hash quine

https://twitter.com/itszn13/status/1995577689085018320
1•franky47•27m ago•0 comments

Show HN: My pushback against ANPR carparks in the UK

https://www.getstung.io/
1•keooodev•27m ago•0 comments

The Art of Unix Programming

http://www.catb.org/~esr/writings/taoup/html/
1•andsoitis•28m ago•1 comments

Office-to-Residential Conversions Are Booming and New York Is the Epicenter

https://www.wsj.com/real-estate/commercial/nyc-office-residential-conversions-housing-4723b702
1•JumpCrisscross•28m ago•1 comments

3D Printed House

https://www.zillow.com/homedetails/1700-Riverview-St-Austin-TX-78702/29382270_zpid/?
2•us321•31m ago•1 comments

Amazon and Google launch multicloud service for faster connectivity

https://www.reuters.com/business/retail-consumer/amazon-google-launch-multicloud-service-faster-c...
2•01-_-•33m ago•0 comments

Show HN: ICT – New Information Model for Matter Time Consciousness (Experiment)

https://www.academia.edu/s/8924eff666
1•DmitriiBaturoIC•34m ago•0 comments

Lawmakers Want to Ban VPNs–and They Have No Idea What They're Doing

https://www.techdirt.com/2025/12/01/lawmakers-want-to-ban-vpns-and-they-have-no-idea-what-theyre-...
9•speckx•38m ago•2 comments

Data Gaps Turn Cyber Crises into Business Crises

https://blog.vega.io/posts/data_gaps_cyber_crises/
1•Asaf51•39m ago•0 comments