We have a code where we have a lot of constants declaration within a .h file - this .h files gets included to multiples .cpp files which is used to create multiples .a library - now these .a files are linked to one executable. For the output and profiler I understand that this way it results the constants (declared in .h file) to be loaded into memory over and over again when different library method are referenced in code. This leads to a lot of un-necessary execution time.
Is there any way (apart from writing the constants in a .so file) we can make use? Is my assumption correct related why the constants are getting loaded multiple times due to reference of different library?