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

Would you ask a driver how the suspension works?

https://efe.me/posts/2026-11-09-would-you-ask-a-driver-how-the-suspension-works/
1•efeoge•3m ago•0 comments

Explorerepo: Tool for agents to read remote Git repositories without cloning

https://github.com/autowert66/explorerepo
1•ghrl•4m ago•0 comments

The tiny transmitter tracking monarch butterflies' migration, Canada to Mexico

https://www.begiant.ca/stories/places/monarch-butterflies-tracking-conservation
1•upofadown•5m ago•0 comments

Meet the Sad Wives of AI

https://www.wired.com/story/meet-the-sad-wives-of-ai/
4•rzk•5m ago•0 comments

Lean proof to search for US tax loopholes

https://lexifina.com/blog/searching-the-tax-code-for-loopholes
1•chaosmanage•7m ago•0 comments

Show HN: DayBreak, a stock brief where the AI never touches the numbers

https://github.com/XahidEx/DayBreak
2•Xahidex•10m ago•0 comments

An attempt at hypernetworks on an RX 6600

https://github.com/RUD9/Grimoire
1•embrel_grim•10m ago•1 comments

Siemens planning acquisition of Lauterbach (debug/trace tools)

https://press.siemens.com/global/en/pressrelease/siemens-expand-portfolio-semiconductor-design-an...
1•PennRobotics•10m ago•0 comments

Taking developments in software engineering personally

https://www.sicpers.info/2026/11/on-taking-developments-in-software-engineering-personally/
1•grahamlee•12m ago•0 comments

'C:\> FORMAT C:' – relax, it's just a screen saver

https://fakedos.com/
2•TheIncredibleCh•14m ago•0 comments

Electrification, a Different, Compelling Business Case

https://www.railwayage.com/regulatory/electrification-a-different-business-case/
2•edward•14m ago•0 comments

AI usage generates a fragile codebase

https://evanxmerz.com/post/ai-usage-generates-a-fragile-codebase/
3•plun9•20m ago•0 comments

The command you checked wasn't the command that ran

https://bluebear.io/blog/the-command-you-checked-wasnt-the-command-that-ran/
2•shayell•22m ago•0 comments

AI and Irontown

https://lucumr.pocoo.org/2026/11/9/irontown/
2•rudenoise•23m ago•0 comments

Ask HN: How has AI changed your project estimates and team composition?

1•vekker•26m ago•0 comments

Datacenter Systems Spending to Go Through the Roof in 2027

https://www.nextplatform.com/compute/2026/11/10/datacenter-systems-spending-to-go-through-the-roo...
2•rbanffy•26m ago•0 comments

What's New in Node.js 27

https://nodejsdesignpatterns.com/blog/whats-new-in-nodejs-27/
1•joshcsimmons•27m ago•0 comments

Research Finds Outright Grants of Cash Are Effective Form of Aid to the Poor

https://news.columbia.edu/news/research-finds-outright-grants-cash-are-surprisingly-effective-for...
5•chistev•27m ago•0 comments

Mood Clip Social Website

https://bolt.new/login?next=/p/72799820
1•sushiiiii•28m ago•0 comments

Jane Street: Socratic Tutor

https://github.com/janestreet/agent_skills/blob/master/socratic-tutor/SKILL.md
1•tosh•28m ago•1 comments

Trump says FBI investigating Nvidia boss's affair with alleged Chinese spy

https://www.bbc.com/news/articles/cqg7x7dpvym8o
5•tosh•29m ago•1 comments

Loose Thoughts on the Future of Abstractions

https://twitter.com/thorstenball/status/2120077141891067915
2•tosh•30m ago•0 comments

Outlook bounces legit emails, Microsoft's authentication crackdown goes sideways

https://www.theregister.com/applications/2026/11/09/outlookcom-bounces-legit-emails-as-microsofts...
3•nephihaha•31m ago•0 comments

Embracing or rejecting short-termism (or both?)

https://manuel.darcemont.fr/posts/embracing-or-rejecting-short-termism/
3•megalomanu•32m ago•0 comments

The Afterlife of the Berlin Wall

https://www.historytoday.com/miscellanies/afterlife-berlin-wall
3•pepys•33m ago•0 comments

cybershe\f: open-source digital bookshelves and async book clubs

https://cybershelf.io
2•ahmidi•34m ago•1 comments

Best Charcoal Chicken in Abu Dhabi – Shams Al Bahar

https://shamsalbahar.com/grilled-fried
2•zahnafathimaa•35m ago•0 comments

Alt-Erlaa, Vienna: 'The World's Best Council Housing?'

https://municipaldreams.wordpress.com/2020/04/07/alt-erlaa-vienna-the-worlds-best-council-housing/
2•vrganj•38m ago•0 comments

Ethereum Foundation sued after firing employee over mandatory suicide pact

https://www.tomshardware.com/tech-industry/cryptocurrency/ethereum-foundation-sued-after-firing-e...
5•bushwart•44m ago•2 comments

Deskland – Adaptive Windows Wallpaper Around Your Icons

https://deskland.app/
3•redbell•44m ago•0 comments