frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Open in hackernews

Ask HN: Help with doing statistics over machine code

2•phafu•2h 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•47m 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•20m 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).

A community-led fork of Organic Maps

https://www.comaps.app/news/2025-05-12/3/
1•maelito•2m ago•0 comments

Google's AI image-to-video generator launches on Honor's new phones

https://www.theverge.com/news/664812/google-honor-ai-image-to-video-gemini
1•bookofjoe•9m ago•1 comments

We cut model training times 35% with torch.compile

https://kumo.ai/research/speeding-up-graph-learning-models-with-pyg-and-torch-compile/
1•gk1•10m ago•0 comments

Why Prescription Drug Prices in the US Are So High [2024]

https://www.bloomberg.com/news/features/2024-06-06/why-prescription-drug-prices-in-the-us-are-so-high
1•helsinkiandrew•10m ago•1 comments

US policies freeze key research worldwide

https://english.elpais.com/usa/2025-05-10/trumps-policies-freeze-key-research-worldwide-no-one-fully-understands-whats-happening.html
1•belter•12m ago•0 comments

Pollution of Lake Karachay

https://en.wikipedia.org/wiki/Pollution_of_Lake_Karachay
1•blahaj•12m ago•0 comments

World Record for solving a 4×4 Rubik's Cube using a robot smashed by UOB student

https://www.bristol247.com/news-and-features/news/world-record-for-solving-a-4x4-rubiks-cube-using-a-robot-smashed-by-uob-student/
1•ndsipa_pomu•13m ago•1 comments

U.S. and China agree to slash tariffs for 90 days in major trade breakthrough

https://www.cnbc.com/2025/05/12/us-and-china-agree-to-slash-tariffs-for-90-days.html
2•prng2021•13m ago•2 comments

Human HARMS: Threat modelling social harms against technical systems

https://www.lightbluetouchpaper.org/2025/05/11/human-harms-threat-modelling-social-harms-against-technical-systems/
1•gnufx•19m ago•0 comments

Start selling online superfast, for free

https://selll.online/
1•mychi•19m ago•0 comments

fMRI identifies key brain regions in superagers

https://www.auntminnie.com/resources/conference/ismrm/2025/article/15745407/ismrm-fmri-identifies-key-brain-regions-in-superagers
1•XzetaU8•19m ago•0 comments

Cheaters Gonna Cheat Cheat Cheat Cheat Cheat

https://thezvi.substack.com/p/cheaters-gonna-cheat-cheat-cheat
2•gHeadphone•20m ago•0 comments

Jours fériés en France – data.gouv.fr

https://www.data.gouv.fr/fr/datasets/jours-feries-en-france/
1•rodrigo975•21m ago•0 comments

The number one rule of risk, and why it matters to your games business (2013)

https://www.gamesbrief.com/2013/09/the-number-one-rule-of-risk-and-why-it-matters-to-your-games-business/
1•calpaterson•28m ago•0 comments

Unending ransomware attacks are a symptom, not the sickness

https://www.theregister.com/2025/05/12/opinion_column_ransomware/
2•rntn•34m ago•0 comments

Automatically create passkeys in Google Password Manager on Chrome deskto

https://developer.chrome.com/blog/passkey-automatic-upgrades
1•vdelitz•38m ago•0 comments

How Molecules Became Signs

https://link.springer.com/article/10.1007/s12304-021-09453-9
2•Fibra•39m ago•0 comments

Arima Models in Python: All Just Statsmodels Under the Hood?

https://layandreas.github.io/personal-blog/posts/arima-all-statsmodels-under-the-hood/
3•wismwasm•40m ago•1 comments

GNU G-Golf Gnome: (Guile Object Library For)

https://www.gnu.org/software/g-golf/
2•grahamlee•41m ago•0 comments

Turning Real Photos into Anime: What I've Learned (So Far)

https://www.indiehackers.com/post/turning-real-photos-into-anime-what-i-ve-learned-so-far-GZbNvf3NMU36Ugr9bez3
2•AnimeMyPic•41m ago•1 comments

Divorce, Family Arrangements, and Children's Adult Outcomes

https://www.nber.org/papers/w33776
3•Bostonian•43m ago•0 comments

Neoliberal economics is based on assumptions and fantasies [video]

https://www.youtube.com/watch?v=uYyalJMXROw
3•xbmcuser•49m ago•0 comments

GitHub – ByteDance/UI-Tars

https://github.com/bytedance/UI-TARS
2•zhengiszen•55m ago•1 comments

Implicit UVs: Real-time semi-global parameterization of implicit surfaces [pdf]

https://baptiste-genest.github.io/papers/implicit_uvs.pdf
2•ibobev•55m ago•0 comments

Show HN: ImgXAI – Free GPT-image-1 generation UI with advanced controls

https://imgxai.com/imgx
1•humbledev28•56m ago•0 comments

Using Neural Networks for Geometric Representation

https://gpuopen.com/learn/using_neural_networks_for_geometric_representation/
1•ibobev•56m ago•0 comments

ReSTIR-Sampled Shadow Maps

https://graphics.cs.utah.edu/research/projects/restir-shadow-maps/
1•ibobev•56m ago•0 comments

Rocket Lab's Neutron tapped for U.S. military cargo test – SpaceNews

https://spacenews.com/rocket-labs-neutron-tapped-for-u-s-military-cargo-test/
2•rbanffy•56m ago•0 comments

The Path to Memory Safety Is Inevitable

https://hardenedlinux.org/blog/2025-05-07-the-path-to-memory-safety-is-inevitable/
2•rbanffy•57m ago•0 comments

I got tired of boring TODO apps, so I built one that plans my entire day with AI

http://a64.in/posts/todx/
1•theapache64•58m ago•0 comments