This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How do I break up the .const section?

Would it be possible to automatically direct all of the constants in a particular file to a section that is not .const?

In a particular file, I want the compiler put the constants into a new section called .const2 while still putting the constants in the rest of the project into .const as it normally does.

Please note, I want to do this without manually placing the constants in a struct/variable and placing them in a new location with pragma. This method is tedious, error-prone and can easily brick my boards when trying to upgrade in the field using a serial port with a legacy tool.

Any suggestions?