Get the latest tech news

A overview of binaries, ELF, and NoMMU on Linux


[Toybox] Impact of global struct size Rob Landley rob at landley.net Mon Jan 1 12:45:43 PST 2024 On 12/30/23 18:10, Ray Gardner wrote: > I am having a bit of trouble understanding the impact of globals. > > There are the probes GLOBALS and findglobals to see what the space usage > is for globals.

(Generally libc or something will mmap() about 64k of "cannot read, cannot write, cannot execute" memory there so any attempt to dereference a NULL pointer segfaults, but other than that...) But shared libraries need to move so they can fit around stuff. This has some advantages: not only is it less circuitry (less power consumption), but it's more memory efficient because there are no page tables (Vitaly Wool gave a talk at ELC in 2015 where he had Linux running in 256k of SRAM, and everything else running out of ROM (well, nor flash), which was only possible because he didn't spend any memory on page tables) and easier to get hard realtime behavior because there are no soft faults... NOMMU systems have been analogized to bacteria, fungi, and insects: there are more bacterial cells on the planet than mammal cells by a VERY LARGER MARGIN. And remember, read-only mappings are fully populated up front, which is expensive (and a latency spike because mmap() won't return until it's finished reading all the data into memory).

Get the Android app

Or read this on Hacker News

Read more on:

Photo of Linux

Linux

Photo of overview

overview

Photo of binaries

binaries

Related news:

News photo

Linux 6.12 Adds Build Options For Greater Control Over CPU Security Mitigations

News photo

Many Intel & AMD Power Management Improvements For Linux 6.12

News photo

How Raw sockets behave differently in macOS and Linux