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

Ask HN: Aren't the current cyber attacks suspicious?

1•arisAlexis•53s ago•0 comments

Single Point of Everything; 4 Important Questions – Cerias – Purdue University

https://www.cerias.purdue.edu/site/blog/post/s-p-e
1•cratermoon•2m ago•0 comments

Baader–Meinhof phenomenon, or Frequency illusion

https://en.wikipedia.org/wiki/Frequency_illusion
2•simonebrunozzi•3m ago•0 comments

A set of rules to save tokens

https://github.com/cicerohellmann/token-savings
2•hell2045•6m ago•1 comments

Brad Feld – Book: Alfa by Lilja Sigurdardottir

https://feld.com/archives/2026/11/alfa-lilja-sigurdardottir/
1•rmason•6m ago•0 comments

Some Apple services restored after outage

https://www.charlotteobserver.com/news/business/article318120964.html
2•rmason•8m ago•0 comments

Nvidia Announces Financial Results for Third Quarter and Fiscal 2027

https://nvidianews.nvidia.com/news/nvidia-announces-financial-results-for-third-quarter-fiscal-2027
6•dvaplima•8m ago•2 comments

The missing quadrant in responses to AI

https://www.normaltech.ai/p/the-missing-quadrant-in-responses
1•speckx•9m ago•0 comments

Run tool calls from code with Code Mode

https://code.claude.com/docs/en/code-mode
2•mfiguiere•9m ago•0 comments

See How U.S. Flights Ground to a Halt After Air Traffic Control Disruptions

https://www.nytimes.com/interactive/2026/11/13/us/us-airports-ground-stop.html
1•Guyadou•11m ago•0 comments

Agentic.spa - the virtual spa for bots, muses & assistants

https://www.agentic.spa
1•pokeweb•11m ago•0 comments

I think PayByPhone is stealing –$54,630,342/yr from their users (video)

https://www.youtube.com/watch?v=i8mrwS5QZQE
4•OuterVale•12m ago•0 comments

In the age of AI, startup speed is not a strategy

https://www.geekwire.com/2026/etzioni-on-ai-startup-speed-is-not-a-strategy/
2•ianand•13m ago•0 comments

Harvard researchers find AI coding agents shifted the bottleneck to code review

https://complexdiscovery.com/harvard-researchers-find-ai-coding-agents-shifted-the-bottleneck-to-...
5•judahmeek•13m ago•2 comments

Is poetry just a dumb larp

https://thoughtcurrents.substack.com/p/is-poetry-just-a-dumb-larp
1•ohohoho•15m ago•0 comments

Seed Crystals

https://arcove.substack.com/p/seed-crystals
1•exolymph•16m ago•0 comments

Microsoft 365 write tools default "on" in Claude on Dec 9

https://support.claude.com/en/articles/15183774-connect-to-microsoft-365
1•aag2113•16m ago•1 comments

Security reports should come with fixes

https://github.blog/open-source/maintainers/maintainers-dont-need-more-ai-bug-reports-they-need-f...
2•ntindle•17m ago•1 comments

Java4Shell: RCE in OpenJDK when processing Base64

https://calif.io/java4shell/
18•werrett•18m ago•3 comments

The best time to fire someone

https://ajaychavda.com/blog/the-best-time-to-fire-someone
1•sammatilda•18m ago•0 comments

"Trump was in bed with Jensen": Critics balk at Huang wish to return to Nvidia

https://arstechnica.com/tech-policy/2026/11/trump-was-in-bed-with-jensen-critics-balk-at-huangs-w...
8•AdmiralAsshat•19m ago•0 comments

SEC Is Probing Nvidia Amid Departure of CEO Jensen Huang

https://www.wsj.com/business/sec-is-probing-nvidia-amid-departure-of-ceo-jensen-huang-ee7643f8
6•warunsl•20m ago•0 comments

"We Take Your Privacy Seriously." The state of play of website surveillance

https://websentinel.eu/research/
1•robin_reala•20m ago•0 comments

Life, LLMs, and my thoughts on Ghostty

https://benkyd.co.uk/posts/life-llms-ghostty/
2•sampsn•21m ago•0 comments

The tech skills AI engineers need

https://andrewpwheeler.com/2026/11/17/the-tech-skills-ai-engineers-need/
4•apwheele•21m ago•0 comments

New puzzles for "The Incredible Machine" + open-source physics engine

https://opentim.net
2•rogerdickey•21m ago•1 comments

Framework Wireless Touchpad Keyboard available to pre-order

https://frame.work/nl/en/products/framework-wireless-touchpad-keyboard
1•MiliasGeiger•22m ago•0 comments

OpenJDK Vulnerability Advisory: 2026/11/17 (Java4Shell)

https://openjdk.org/groups/vulnerability/advisories/2026-11-17
2•ErrantX•22m ago•0 comments

Artex and Friends: Enter Agentic Offensive Frameworks

https://cloud.google.com/blog/topics/threat-intelligence/artex-and-friends-enter-agentic-offensiv...
1•oger•23m ago•0 comments

Tencent Hy4 Flash

https://hy.tencent.ai/research/hy4-flash
2•lyra1337•23m ago•0 comments