'How do I create a pure data-only code object in GCC
We have a complex multi-core system with multiple elf files that are built using GCC tools. We want to move the const configuration data out to it's own elf file to be able to load it separately from the other elements into its own area of memory that various code elements access. This configuration data depends on various #include files and needs to be compiled to create the proper data structure.
I have this working now but with one caveat. The linked config includes a tiny bit of code in .init and .fini sections and I cannot figure out how to build without ANY code. I just want the const data structures. It seems there should be a way to specify that we don't want this code at all.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|