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

QML for C and Zig

https://gist.github.com/rcalixte/d2de5c816fc1de3970cc501b5ae9706e
1•rcalixte•1m ago•0 comments

Are ponds still relevant today?

https://docs.google.com/document/d/1wMh6ONc_ZOQV7SCF2ftuox4mxTU7ryiJpdxeE5y9fsY/edit?usp=drivesdk
1•erbdex•2m ago•0 comments

Woman arrested after blocking delivery robot in Philadelphia confrontation

https://abc13.com/story/woman-arrested-blocking-delivery-robot-philadelphia-confrontation/19943936/
2•timpera•4m ago•0 comments

Project Notes Pro moved to GitLab; desktop users need to install 6.4.3

https://www.projectnotespro.com/news/project-notes-pro-moved-to-gitlab
1•kestermckinney•4m ago•0 comments

Trustbut checks if an AI agent's new tests fail without its change

https://github.com/isAlmogK/trustbut
1•almog_io•6m ago•0 comments

Stop Re-Encoding Videos (2021)

https://codecalamity.com/stop-re-encoding-videos/
1•tosh•7m ago•0 comments

Google changed its privacy policy on Oct 16. Here's a signed record of both

https://keepword.net/changes/google-privacy-2026-10-16/
2•Aelthorim•10m ago•0 comments

Just How Rosy Is That Datacenter Buildout Forecast?

https://www.nextplatform.com/compute/2026/10/16/just-how-rosy-is-that-datacenter-buildout-forecas...
2•rbanffy•10m ago•0 comments

Drones Strike VKontakte Data Center and Oil Terminal in Russia Leningrad Region

https://militarnyi.com/en/news/drones-strike-vkontakte-data-center-and-oil-terminal-in-russia-s-l...
2•DeepLogin•11m ago•0 comments

Personal software factories are a waste of time

https://www.peterp.me/articles/personal-software-factories-are-a-waste-of-time/
2•thegreatpeter•11m ago•0 comments

Hardening changes for ReFS volumes on removable media

https://support.microsoft.com/en-us/servicing/os/windows/docs/2026/10/hardening-changes-for-refs-...
1•croes•12m ago•0 comments

France is on the brink, days away from make-or-break moment in debt crisis

https://fortune.com/2026/10/17/france-debt-crisis-budget-deficit-bond-yields-spread-protests-riots/
1•donsupreme•13m ago•0 comments

Polymarket saw $600M in election trades after the elections were over

https://www.wired.com/story/over-dollar600-million-traded-on-polymarket-election-contracts-after-...
1•rbanffy•14m ago•0 comments

A protocol for LLM intent search

https://zenodo.org/records/23452266
1•kummap•14m ago•0 comments

Tiny Brutalism – Thanks to HN It's on Steam

https://store.steampowered.com/app/5426130/Tiny_Brutalism/
4•MatiErnst•14m ago•0 comments

Expose the digital body language of Bluetooth Low Energy devices

https://blog.stormvault.net/airtell-a-bluetooth-5-security-cli-streamlit-interface-to-sniffle-b48...
1•unixnick•15m ago•0 comments

Silicon-photonics-enabled chip-based 3D printer (2024)

https://www.nature.com/articles/s41377-024-01478-2
2•peter_d_sherman•17m ago•0 comments

Albanian Protests Escalating

https://www.aljazeera.com/news/2026/10/17/albanian-police-fire-rubber-bullets-as-protests-against...
2•Aelthorim•18m ago•0 comments

Show HN: Snitch – see every connection your computer makes

https://github.com/aixisstudio/Snitch
1•aiXis•21m ago•0 comments

DualSense Trigger Feedback and Haptic Designer for adding interesting haptics

https://old.reddit.com/r/decomps/comments/1x8ta0e/i_made_a_dualsense_trigger_feedback_and_haptic/
1•patrickk•23m ago•0 comments

Free Pascal Compiler Now Supports Dynamic Packages

https://www.getlazarus.org/dynamic/
3•sysrpl•25m ago•2 comments

France protests turn chaotic in Paris as police fire tear gas water cannon [video]

https://www.youtube.com/watch?v=lwNqUcT7uj8
6•donsupreme•27m ago•0 comments

HOA's are making the home crisis worse

https://hoaspy.com/hoa/fl/florida-hoa-housing-crisis.html
41•lovewins•33m ago•17 comments

Self-hosted workspace where notes, tasks and AI chats are all items

https://github.com/sianachi/nixsites
2•osinachi88•34m ago•0 comments

Is it a lie if you believe it? This Elizabeth Holmes film is a mind-bender

https://www.washingtonpost.com/opinions/2026/10/15/nathan-fielder-elizabeth-holmes-documentary-is...
1•lode•34m ago•0 comments

Row Locks with Joins Can Produce Surprising Results in PostgreSQL

https://hakibenita.com/postgres-row-lock-with-join
2•mooreds•35m ago•0 comments

Housing, Capital, and Contradictions of Progressive Urbanism in Boulder Colorado [pdf]

https://d1e1jt2fj4r8r.cloudfront.net/1c85cd7f-8027-44d1-a911-0c364eac7bcf/2d989e98-942e-4dd3-a98b...
1•mooreds•36m ago•0 comments

Show HN: A World 3D globe where kids collect birds

https://www.birdsaroundworld.com/
1•leonagano•36m ago•0 comments

An executable specification language based on temporal logic of actions (TLA)

https://github.com/quint-co/quint
2•mooreds•38m ago•0 comments

A Token-by-Token Guide to Prompt Caching

https://www.sithankanna.com/posts/prompt-caching-vs-kv-caching.html
2•hdit•38m ago•0 comments