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

/proc/self/exe overwrite from within a user namespace

https://mixedbit.org/blog/2026/06/12/proc_self_exe_overwrite_from_within_a_user_namespace.html
1•mixedbit•5m ago•0 comments

What is the most valuable skill you've learned outside of your job?

1•Soumya_Max•6m ago•0 comments

Getting World Cup Updates in Slack

https://embedworkflow.com/blog/getting-world-cup-updates-in-slack/
1•ewf•6m ago•0 comments

What task are humans still better at than AI?

1•Soumya_Max•6m ago•0 comments

Pocony: A little balcony garden on your phone

https://pocony.dollarbasellc.com/
1•nico•7m ago•0 comments

The Developer Shortage in 2026: AI Killed the Order Taker, Not the Engineer

https://fullscale.io/blog/developer-shortage/
1•USTECH_WORKER•9m ago•0 comments

Flew: Emulated WiFi on Bluetooth Hardware

https://dl.acm.org/doi/10.1145/3495243.3517030
1•fanf2•9m ago•0 comments

Is SpaceX's prospectus just blank pages?

https://ir.spacex.com/financials/default.aspx
1•axus•12m ago•1 comments

Teardown Confirms the Trump Phone Is a Gold-Painted HTC U24 Pro

https://de.ifixit.com/News/117789/teardown-confirms-the-trump-phone-is-a-gold-painted-htc-u24-pro
1•doener•15m ago•0 comments

We economists have done the maths: 'growth' is a doomed strategy

https://www.theguardian.com/commentisfree/2026/jun/10/economists-maths-growth-doomed-strategy-un-...
2•u1hcw9nx•17m ago•0 comments

Mythos and Engels' Pause

https://www.fabricatedknowledge.com/p/mythos-and-engels-pause
1•themgt•17m ago•0 comments

Google proposes Open Knowledge Format based on Markdown

https://cloud.google.com/blog/products/data-analytics/how-the-open-knowledge-format-can-improve-d...
3•itherseed•18m ago•1 comments

What Shape Is the Earth?

https://aeon.co/essays/why-did-measuring-earths-true-shape-matter-for-science
1•the-mitr•21m ago•0 comments

The Null Is Always False (Except When It Is True) (2014)

http://daniellakens.blogspot.com/2014/06/the-null-is-always-false-except-when-it.html
1•mkl95•24m ago•0 comments

Vercel Drop

https://vercel.com/drop
1•Eldodi•26m ago•0 comments

ForecastOps (Like LLMops, MLOps)

https://github.com/Parisi-Labs/forecastops
1•jameswlepage•31m ago•1 comments

The Physics of Interstellar Travel

https://www.centauri-dreams.org/2026/06/11/the-physics-of-interstellar-travel/
3•JPLeRouzic•32m ago•0 comments

Tobias Hieta: A Brief Overview of the LLVM Architecture [video]

https://www.youtube.com/watch?v=g96voy6M6xo
2•signa11•32m ago•0 comments

Zero Trust for Python Security: A Practical Checklist

https://medium.com/@maikelmardjan/zero-trust-for-python-security-a-practical-checklist-fab2f50c12c0
1•runningmike•37m ago•0 comments

David Hockney Recreates "Pearblossom Highway" (1988)

https://www.youtube.com/watch?v=JGK9gua_lQE
2•fallinditch•39m ago•0 comments

SpaceX playbook set to fuel China's IPO ambitions but tech gap persists

https://www.reuters.com/legal/transactional/spacex-playbook-set-fuel-chinas-ipo-ambitions-tech-ga...
1•01-_-•42m ago•0 comments

DOS programs ran faster than Windows 3.1. Why was that?

https://comuniq.xyz/post?t=1241
2•01-_-•44m ago•0 comments

Bubbles – community-ranked feed of blog posts

https://bubbles.town/
1•microflash•45m ago•0 comments

New malware campaign tricks AI scanners with fake nuclear weapon prompts

https://www.tomshardware.com/tech-industry/cyber-security/hades-malware-campaign-now-tricks-ai-bo...
2•yboris•45m ago•0 comments

Feasibility of a Multicomponent Protocol to Promote Dreaming Under Anesthesia

https://journals.lww.com/anesthesiology/fulltext/2026/07000/feasibility_of_a_multicomponent_proto...
1•bookofjoe•48m ago•0 comments

What concerns SHOULD we be discussing about using AI in Education?

https://stemteachingtools.org/brief/109
1•the-mitr•49m ago•0 comments

PeopleSoft 0-day affecting organizations steals gigabytes of data

https://arstechnica.com/security/2026/06/peoplesoft-0-day-affecting-hundreds-of-organizations-ste...
1•Brajeshwar•50m ago•0 comments

Show HN: Cortex – local-first encrypted memory for AI agents (Rust, MCP)

https://github.com/gambletan/cortex
2•gambletan•51m ago•0 comments

A mysterious 'cold blob' in the ocean has puzzled scientists

https://www.cnn.com/2026/06/12/climate/cold-blob-atlantic-amoc-ocean-circulation
1•amelius•52m ago•0 comments

World Cup AI predictor now lets users ask daft what-ifs

https://www.theregister.com/offbeat/2026/06/13/world-cup-ai-predictor-now-lets-users-ask-daft-wha...
1•kagaherk•52m ago•0 comments