Hello,
I have 109 files in my build environment and besides these I also have a library. All the variables from the files that I have in the build environment and in the library are currently stored in the .data and .bss area. I would like to create a new section and store all variables (global) from my files and my library in here.
I have tried using the pragma #pragma section and then use __declspec(allocate("mysec")):
https://learn.microsoft.com/en-us/cpp/preprocessor/section?view=msvc-160&viewFallbackFrom=vs-2019
If I use this method, I need to use __declspec(allocate("mysec")) for each variable. I am using Microsoft Visual Studio 2015/2017 (Professional).
Is there a method to configure from the build environment that for a certain file/library, all the variable should be stored in the "mysec" section?
Thank you!