The Advanced Bash Scripting Guide states that
In addition to all the above, /dev/zero is needed by ELF (Executable and Linking Format) UNIX/Linux binaries.
However I cannot find documentation about such dependency anywhere.
Actually I was unable to find it into the ELF loaders of the Linux kernel too.
Do such dependency still exists? And if so, how is /dev/zero
used?
Before
MAP_ANONYMOUS
was common,/dev/zero
was used to get a set of zeroed out pages (for the.bss
section).But now it's just
mmap(..., MAP_PRIVATE|MAP_ANONYMOUS, -1, 0)
, andstrace /bin/date |& grep zero
shows no output (i.e./dev/zero
is not used at all).