The normal use for these symbols is always local to the module, and we
want to be able to have multiple modules using the same section names.
Consider a static library that is meant to be statically linked into
shared objects as a private implementation detail. Say this library
provides macros/templates to its users that emit metadata into a named
section, and then library code that iterates over the section. Each
instance of this library inside a given shared object must iterate over
its own list, not the list of whichever user of the static library
happens to be first in dynamic linking symbol resolution order.
We cannot define these symbols as hidden by default because some users
rely on using dlsym to look them up, see
However, on new platforms that don't have any legacy code that depends
on the current behavior, it makes sense to define them as hidden by
default. This change introduces the -z hidden-start-stop-symbols option
that provides that ability.