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

Show HN: MeraGEO – check whether ChatGPT, Claude and Gemini name your brand

https://merageo.com
1•codelion•2m ago•0 comments

Xibalba 64 – N64 shooter by a solo dev

https://cartpoptv.github.io/xibalba-64.html
1•VimEscapeArtist•4m ago•0 comments

I'm joining Omarchy

https://twitter.com/emirbeganovic/status/2105595836373643551
1•tosh•6m ago•0 comments

Happy 100th Anniversary, Arizona (With an Asterisk?)

https://www.sharonlohr.com/blog/2026/9/21/happy-100th-anniversary-arizona
1•sebg•6m ago•0 comments

Social³ Source: We can create more software than ever. But what for?

https://jordicabot.com/social%c2%b3-source-we-can-create-more-software-than-ever-but-what-for/
1•softmodeling•7m ago•0 comments

Meta is going for Enterprise AI, are the AI labs becoming tech consulting firms?

https://www.thestateofai.com/news/meta-enterprise-ai-cj-desai
1•ltononro•7m ago•0 comments

Agentic GPU Programming for MLSys

https://mlc.ai/agentic-gpu-programming-for-mlsys/index.html
1•crowwork•9m ago•0 comments

Nvidia OpenShell

https://docs.nvidia.com/openshell/about/overview
1•peterfication•10m ago•0 comments

Show HN: Built a tool to organize my lab reports and visualise biomarker trends

https://medicalhistory.app
2•driule•12m ago•0 comments

Product Information Management: Centralizing Product Data Across Retail Systems

https://www.chetu.com/retail/product-information-management.php
1•Chetuinc•12m ago•1 comments

Returning from vacation? The government can search your phone without a warrant

https://arstechnica.com/tech-policy/2026/09/immigration-advocate-sues-border-agents-for-demanding...
1•rbanffy•13m ago•0 comments

Qualcomm's System Level Architecture in the Snapdragon X2 Elite

https://chipsandcheese.com/p/qualcomms-system-level-architecture
1•rbanffy•14m ago•0 comments

EU KIDS Act

https://commission.europa.eu/news-and-media/news/eu-kids-act-helping-children-navigate-safer-onli...
3•pona-a•18m ago•0 comments

Florida county discovers mysterious Flock cameras with no obvious owner

https://www.washingtonpost.com/nation/2026/10/01/florida-county-discovers-mysterious-flock-camera...
1•balderdash•19m ago•1 comments

So what's happening with Russia's new, long-delayed crewed spacecraft?

https://arstechnica.com/space/2026/09/so-whats-happening-with-russias-new-long-delayed-crewed-spa...
1•rbanffy•19m ago•0 comments

More than 44,000 file legal objections to Palantir NHS platform handling

https://www.theguardian.com/technology/2026/sep/30/legal-objections-palantir-nhs-platform-handlin...
3•sbulaev•20m ago•0 comments

Swiss glaciers suffer 'disastrous' year of ice loss, threatening water supplies

https://www.bbc.com/news/articles/c6n9w0ypjwl9o
3•layer8•22m ago•0 comments

Religious Scholars Met with Anthropic. What They Heard Stunned Them

https://www.nytimes.com/2026/09/29/us/anthropic-claude-morals-ai.html
2•sciurus•23m ago•0 comments

Running Windows 11 and Server 2025 with macOS Virtualization.framework

https://mustafaakin.dev/blog/windows-on-tart/
1•CSDude•25m ago•0 comments

An AI "mind-reading" tool can reconstruct what you're looking at based on a bra

https://www.technologyreview.com/2026/10/01/1145588/ai-mind-reading-reconstructs-what-youre-looki...
2•joozio•26m ago•1 comments

Listen to the Redditors

https://www.incredible.rs/blog/listen-to-the-redditors.html
2•theanonymousone•27m ago•0 comments

StreetComplete on iOS is now in public beta

https://github.com/streetcomplete/StreetComplete/issues/5421
22•Snowly•27m ago•4 comments

Children Who Died as Newborns Are Often Remembered as Family Members

https://onlinelibrary.wiley.com/doi/10.1111/apa.70341
3•tokai•29m ago•0 comments

Challenge accepted: not a single line of code written by hand

https://yvoschaap.com/weblog/challenge_accepted_not_a_single_line_of_code_written_by_hand
2•yvoschaap•30m ago•1 comments

Lessons for the 21st century from a book by 'Frankenstein' author Mary Shelley

https://worldsensorium.com/lessons-for-the-21st-century-from-a-200-year-old-book-by-frankenstein-...
2•dnetesn•33m ago•0 comments

The Space Between Two Fingers

https://blue-continuum.com/the-space-between-two-fingers
2•dnetesn•34m ago•0 comments

Value: A Verifiable Alignment Layer for Agentic a [pdf]

https://asteris.ai/pdf/verifiable-alignment-layer-for-agentic-ai.pdf
1•ai-mktg-ninja•35m ago•0 comments

Tech in cars can be used to snoop on you, Dutch spy chiefs warn

https://www.theguardian.com/technology/2026/oct/01/cars-smart-features-spy-gps-chinese-imports
2•vinni2•37m ago•0 comments

Show HN: Linux Subsystem Diagrams

1•mipsH•37m ago•0 comments

Ultra-processed food consumption and chronic diseases among 8,819,894 adults

https://fmch.bmj.com/content/14/Suppl_5/e003925
3•geox•38m ago•0 comments