Can I declare a global variable inside a library that is later compiled into a shared object ? Is it safe to reference it from other libraries or the main application code by de
Yes, libraries can contain global variables.
But depending on compiler/linker options, they might be not visible. E.g. it is common practice, that libraries are built with -fvisibility=hidden
and that only certain symbols are exported (by linker map or explicit __attribute__((__visibility__))
tags).
Your "large" project has been probably built in such a way.
The high address might also indicate, that variable
is some kind of other symbol (function) in another library.