parts/6.48.Dynamically-linkedCodeAndSelf-modifyingCode-NYY.md

6.48 Dynamically-linked Code and Self-modifying Code [NYY]

6.48.1 Applicability to language

Most loaders allow dynamically linked libraries also known as shared libraries. Code is designed and tested using a suite of shared libraries which are loaded at execution time. The process of linking and loading is outside the scope of the C++ standard.

C++ prevents data pointers to be reinterpreted as function pointers and vice versa. Reinterpreting a pointer via a void pointer or std::intptr_t to a pointer of different type is undefined behaviour (with very few defined exceptions of data pointers to pointer to its raw bytes).

6.48.2 Avoidance mechanisms for language users

To avoid the vulnerability or mitigate its ill effects, C++ software developers can: