I'm using Qt 5.3.2 with GCC 4.8.2. I want to insert via the .pro file (using qmake) a section definition to the linker script created by qmake.

What I want to insert:

Qt Code:
  1. SECTIONS
  2. {
  3. .legacy_vars :
  4. {
  5. *myModule.o (.bss)
  6. *myModule.o (.data)
  7. }
  8. .everything_else :
  9. {
  10. * (.bss)
  11. * (.data)
  12. * (.text)
  13. }
  14. }
To copy to clipboard, switch view to plain text mode 

Is this possible?
Thanks in advance!


To answer the question "why?":

I have legacy code in my project which I cannot change. But I need to reset its variables to reset its state. At the same time most of them are static and dont have functions to access them. Therefore I want to map the legacy codes variables to a defined section, read them when starting my program and if needed write them back in order to reset this part of the program.