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

What Does the Fourth Dimension Look Like?

https://www.quantamagazine.org/what-does-the-fourth-dimension-actually-look-like-20261001/
1•mdp2021•1m ago•0 comments

Smaller, distributed batteries could help the grid

https://www.technologyreview.com/2026/10/01/1145435/distributed-batteries/
1•joozio•4m ago•0 comments

PhotoSuite Is an Open Source Photoshop-Like Editor with Native PSD Support

https://linuxiac.com/photosuite-is-a-free-photoshop-like-editor-with-native-psd-support/
3•ssummoner001•14m ago•0 comments

Hob

https://hob.dev
1•handfuloflight•18m ago•0 comments

Year Million: Science at the Far Edge of Knowledge

https://en.wikipedia.org/wiki/Year_Million
1•lioeters•18m ago•0 comments

Rust for CPython (Python Language Summit 2026)

https://blog.python.org/2026/09/language-summit-2026-rust-for-cpython/
2•arto•22m ago•0 comments

Page Table Memory Consumption

https://frn.sh/pagetables/
1•signa11•24m ago•0 comments

Pay Advance Apps May Be Costlier Than Workers Think

https://www.nytimes.com/2026/10/02/your-money/pay-advance-apps-fees.html
2•vinni2•25m ago•0 comments

Automatic iPhone reboot: Forensics firm allegedly stops time

https://www.heise.de/en/news/Automatic-iPhone-reboot-Forensics-firm-allegedly-stops-time-11473908...
1•aquir•28m ago•0 comments

ESP-SDR Firmware Turns ESP32 into a 2.4/5 GHz Software-Defined Radio (SDR)

https://www.cnx-software.com/2026/10/04/esp-sdr-firmware-turns-esp32-into-a-2-4-5-ghz-software-de...
3•0in•29m ago•0 comments

Olomni for All Devs

https://www.olomni.com/
1•FaustoDario33•30m ago•0 comments

2026 SaaS Metrics Industry Statistics

https://nicheaitool.com/saas-metrics-industry-statistics
1•acewits•30m ago•0 comments

Ask HN: Where can a solo dev still find a moat in LLM inference?

1•SouravInsights•31m ago•0 comments

The Qwen Saga Continues

https://gabucino.hu/index.htm#2026-09-08-11:37:26
2•spikewall•33m ago•0 comments

Plane Crazy: Building a Plane in 30 Days [video]

https://www.youtube.com/watch?v=FSNzF-KSGiw
1•tosh•33m ago•0 comments

Chinese homegrown poultry variety breaks decades-long monopoly

https://www.globaltimes.cn/page/202307/1294882.shtml
2•Michelangelo11•40m ago•0 comments

Stroboscopic Effect

https://en.wikipedia.org/wiki/Stroboscopic_effect
1•sans_souse•42m ago•0 comments

Did the universe have a beginning? (2012)

https://arxiv.org/abs/1204.4658
1•lioeters•43m ago•0 comments

Wiki loves monuments 2026 in the USA

https://commons.wikimedia.org/wiki/Commons:Wiki_Loves_Monuments_2026_in_the_United_States
1•sans_souse•43m ago•0 comments

Launching: Nautilus – Run a coding agent from your phone, merge on your PC

https://github.com/itamarhanan/nautilus
1•itamarh•47m ago•0 comments

How to Live on Earth? [video]

https://www.youtube.com/watch?v=h3mRsvFmWi0
1•diwash007•50m ago•1 comments

Zadar Cow from Hell

https://en.wikipedia.org/wiki/Zadar!_Cow_from_Hell
2•Bluestein•50m ago•0 comments

Ultimate Physical Limits of Computation (2000)

https://arxiv.org/abs/quant-ph/9908043
1•lioeters•52m ago•0 comments

Benchmarking CV and depth-estimation algorithms

https://mozilladatacollective.com/datasets/cmuppz5bm01s5mg067qo2b8x3
1•createphotos•56m ago•0 comments

Repetitive Task Agent Automateion

1•anthony74•58m ago•0 comments

Outshining Your Rival: Interpersonal Rivalry and Its Effects

https://pubsonline.informs.org/doi/epdf/10.1287/orsc.2024.18649
2•Tomte•59m ago•0 comments

Emitting metadata early makes building/checking Rust up to twice as fast

https://github.com/PowderworksCode/headstart
2•knuckleheads•1h ago•0 comments

Ammonium perchlorate composite propellant

https://rocketry.fandom.com/wiki/Ammonium_perchlorate_composite_propellant
1•Bluestein•1h ago•0 comments

Embedded Evaluators Can't Fix Companies That Choose to Be Bad

https://stellabiderman.ai/blog/embedded-evaluators-cant-fix-companies-that-choose-to-be-bad/
1•erlend_sh•1h ago•0 comments

Qwen3.8-Flash-Next 177B running at 11–15 tok/s on 1 RTX 5070 12GB and 32GB RAM

https://github.com/MohammadHaishemKhawaja/hashyy
1•maziianobeatz58•1h ago•0 comments