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: Jobless Joke Language (JJL), a Brainf***-inspired esoteric language

https://github.com/ghetea-patrick/jjl
1•patrick-ghetea•36s ago•0 comments

Show HN: Claude on a 2007 Nokia 6300 (Java ME app, TLS 1.0, private CA)

https://github.com/emir/claude-s40
1•emir•1m ago•0 comments

MiMo-v2.6-Flash: on intelligence/price Pareto frontier

https://artificialanalysis.ai/models/mimo-v2-6-flash
1•AnodicElegy•1m ago•1 comments

Dynep: Real-time GPU spot market across 31 cloud providers

https://data.dynep.com
1•nurturely•5m ago•0 comments

Flock seeks to have security researchers' map of Flock cameras taken down

https://www.tomshardware.com/tech-industry/cyber-security/flock-seeks-to-have-security-researcher...
3•sbulaev•8m ago•0 comments

Hello Hnu

1•Mohamed_Amineio•9m ago•0 comments

Against Political Realism

https://xd1.dev/2024/07/against-political-realism
1•gchamonlive•9m ago•1 comments

The accidental history of 3000, 8080, and other port numbers

https://smarmelling.com/posts/the-accidental-history-of-3000-8080-and-other-port-numbers.html
2•smarmelling•11m ago•0 comments

ReBirth RB-338

https://en.wikipedia.org/wiki/ReBirth_RB-338
1•gregsadetsky•11m ago•0 comments

AI in hospital billing adds nearly $1B in extra costs

https://www.bcbs.com/about-us/association-news/bcbsa-analysis-ai-coding-tools-affects-healthcare-...
2•neehao•12m ago•0 comments

Halo: An open-source, self-modifiable, agentic operating system

https://gethalo.dev/
1•tanishqkanc•13m ago•0 comments

Appeals Court Lets The Pentagon Designate Anthropic a Supply-Chain Risk

https://www.wired.com/story/appeals-court-lets-the-pentagon-designate-anthropic-a-supply-chain-risk/
1•joozio•13m ago•0 comments

Life Forge – Autonomous Flight Simulator for AI Agents

https://github.com/zariffromlatif/life-forge
1•mdzariflatif•14m ago•0 comments

Joby Completes First-Ever Autonomous Flight Across the United States

https://www.jobyaviation.com/news/joby-completes-first-ever-fully-autonomous-flight-across-the-un...
1•sssilver•15m ago•0 comments

Joplin

https://joplinapp.org
1•Tomte•15m ago•0 comments

I was impressed by Jev, please explain why I shouldn't be

3•effisfor•16m ago•4 comments

I made a website that automatically tracks API specs

https://trackapi.uk
2•iolorhys•19m ago•0 comments

For states seeking to rein in license plate cameras, New Hampshire is a model

https://newhampshirebulletin.com/2026/09/24/as-states-seek-to-rein-in-flock-license-plate-cameras...
1•chmaynard•22m ago•0 comments

Don't couple your Go code to GitHub

https://iain.rocks/blog/dont-couple-your-go-code-to-github
5•birdculture•24m ago•1 comments

The Aesthetic Problem of Namespacing

https://www.gingerbill.org/article/2026/05/13/aesthetic-namespacing/
1•signa11•25m ago•0 comments

Milestone: Write app from scratch rather than manufacturers software

https://www.bytestone.uk/posts/2026-09-27-elitech-temperature-logger/
1•hum3hum3•25m ago•1 comments

Show HN: Turn a UniFi Protect relay and sensor into a smarter garage door

https://garageopener.app/
1•pcrausaz•25m ago•0 comments

How Pink Is Pink Noise

https://ev12183725.substack.com/p/how-pink-is-pink-noise
1•ceh123•31m ago•0 comments

Creating a Reverse Outline

https://writing.wisc.edu/handbook/processandstructure/reverseoutlines/
1•Tomte•32m ago•0 comments

AMD Posts the Full EPYC 9006 SKU List: 31 Venice Parts From $700 to $14,904

https://www.storagereview.com/news/amd-posts-the-full-epyc-9006-sku-list-31-venice-parts-from-700...
2•ksec•32m ago•0 comments

Is this what SW eng has come to

2•bicepjai•32m ago•3 comments

Test Post

https://example.org/
2•RylenAnil•37m ago•3 comments

Ask HN: What's the most inspiring media you've consumed in the last 5 years?

1•hashim•40m ago•0 comments

The Illusory Dunning-Kruger Effect and Reciprocal Fits

https://jslandy.com/illusory-dunning-kruger-effect/
2•efavdb•41m ago•0 comments

Observability-driven harnesses for building with agents

https://www.datadoghq.com/blog/ai/harness-first-agents/
2•sdeframond•41m ago•0 comments