What exactly does `-rdynamic` do and when exactly is it needed?
What exactly does -rdynamic (or --export-dynamic at the linker level) do and how does it relate to symbol visibility as defined by the -fvisibility* flags or visibility pragma s and __attribute__ s? For --export-dynamic , ld(1) mentions: ... If you use "dlopen" to load a dynamic object which needs to refer back to the symbols defined by the program, rather than some other dynamic object, then you will probably need to use this option when linking the program itself. ... I'm not sure I completely understand this. Could you please provide an example that doesn't work without -rdynamic but does