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

If Apple sends you a push notification about a spyware attack, take it seriously

https://techcrunch.com/2026/08/13/if-apple-sends-you-a-push-notification-alerting-you-to-a-spywar...
3•jethronethro•1m ago•0 comments

AI Stock Research Assistant · Streamlit

https://ai-stock-research-kiaan.streamlit.app
1•KiaanKothari•2m ago•0 comments

PK-SIM: tool for whole-body physiologically pharmacokinetic modeling

https://github.com/Open-Systems-Pharmacology/PK-Sim
2•wslh•8m ago•0 comments

Low-regret recommendations for AI policy

https://www.noahpinion.blog/p/23-low-regret-recommendations-for
1•paulpauper•10m ago•0 comments

Models Are Getting Dumber on Purpose

https://w4g1.dev/blog/models-are-getting-dumber-on-purpose
2•hruvhwe•11m ago•0 comments

The Problem with Child-Led Potty Training

https://www.theatlantic.com/family/2026/08/potty-training-delay-problem/688299/
1•paulpauper•11m ago•0 comments

The inconvenient truth about writing code by hand [video]

https://www.youtube.com/watch?v=bzYziksDslU
1•ManuelSuarez•11m ago•0 comments

Ask HN: What LLM subscription/provider to use with pi harness?

1•vira28•11m ago•0 comments

More large employers are turning to ICHRA as group costs climb

https://www.insurancebusinessmag.com/us/news/benefits/more-large-employers-are-turning-to-ichra-a...
1•andy99•12m ago•0 comments

Tlbic v12.0: to prevent suicide – To those contemplating ending life

https://drive.google.com/file/d/15-B6usZzpf0LwXpMXkvywnzV9nN568hK/view?usp=drive_link
1•michikawa59•14m ago•1 comments

You can just choose how many bugs you want now

https://nolanlawson.com/2026/08/16/you-can-just-choose-how-many-bugs-you-want-now/
1•headalgorithm•15m ago•0 comments

Simulating Claude-Style Chinese Risk Control and UX in DeepSeek Harness

https://github.com/eri64/dsh-claude-ux
1•Sha1rholder•16m ago•0 comments

Show HN: I built a free ATS for small hiring teams

https://www.interviewwatch.com/ats/
1•bhuvanbk007•16m ago•0 comments

Show HN: Agent6 – coding agent with jailed commands and editable state machines

https://github.com/agent6-dev/agent6
1•elesiuta•19m ago•0 comments

On-device tennis line calling with two iPhones on tripods [video]

https://www.youtube.com/watch?v=Ea2i5mtKng8
1•Austin_Conlon•20m ago•0 comments

Quick-search: An universal search app for Android

https://github.com/teja2495/quick-search/
1•thunderbong•21m ago•0 comments

U and non-U English examples

https://en.wikipedia.org/wiki/U_and_non-U_English
1•isomorph•21m ago•0 comments

Show HN: Declarative-forms – await an object the way prompt() awaits a string

https://wolfoo2931.github.io/declarative-forms/
1•WolfOliver•22m ago•0 comments

John Carlos Baez: How many Erdős problems will be solved by the end of the year?

https://mathstodon.xyz/@johncarlosbaez/117105042105698101
1•ColinWright•23m ago•0 comments

Volonaut Airbike – Test Riding a Flying Speeder Bike [video]

https://www.youtube.com/watch?v=XZpWTHtwceE
1•throwoutway•26m ago•0 comments

Protobuf has LSP support. You're welcome

https://buf.build/blog/protobuf-lsp
3•theanonymousone•27m ago•0 comments

Show HN: WireDoctor – Spring Boot startup and bean cycle analyzer

https://github.com/ddsha441981/wiredoctor
1•ddsha441981•27m ago•0 comments

The Sweeter Lesson

https://cacm.acm.org/opinion/the-sweeter-lesson/
2•bvsrinivasan•28m ago•0 comments

Ask HN: How do you prove two machines computed the same float32 result?

3•Swapnopam•31m ago•1 comments

Why Pi Is My Goat Agent Harness

https://thinhcorner.com/blog/pi-agent/
1•th1nhng0•32m ago•0 comments

Has somebody found a way to reduce AI idiomatics tics?

1•abeauvois•34m ago•0 comments

Nvidia discloses $21B stake in SpaceX at end of second quarter

https://www.cnbc.com/2026/08/14/nvidia-discloses-21-billion-stake-in-spacex-at-end-of-second-quar...
6•johnbarron•34m ago•1 comments

U.S. to tell partners they must pick sides in AI race with China

https://www.cnbc.com/2026/08/15/us-to-tell-allies-they-must-pick-sides-in-ai-race-with-china-reut...
1•johnbarron•35m ago•1 comments

Gforth – A free, fast, featureful and portable implementation of Forth

https://gforth.org/
2•smartmic•39m ago•0 comments

LibreOffice Conference 2026 Schedule

https://events.documentfoundation.org/libreoffice-conference-2026/schedule/
5•mmarian•42m ago•1 comments