[quote user="Pashan None"]It is really difficult for us to change the compiler at this stage of the development activity.[/quote]
Upgrading your compiler from version 4.9.7 to 4.9.9 is a particularly low risk change. The only difference between these versions is bug fixes, including one bug fix you need. Thus, this particular version change is likely to increase the stability of your builds. Please see this wiki article for more detail.
Presuming you still cannot upgrade ...
I'm a little confused that you now want 4-byte alignment everywhere. Up to this point your focus was on getting only 2-byte alignment, and avoiding holes caused by 4-byte alignment.
Here is a way to force 4-byte alignment between input sections.
.Managed_RAM_Area { . = align(4); file1.obj(.bss) . = align(4); file2.obj(.bss) . = align(4); /* and so on */ } > MANAGED_RAM, type = NOINIT, SIZE(MANAGED_RAM_DATA_LENGTH),
RUN(MANAGED_RAM_START_LOCATION)
Note how I create the symbols for the section size and start address. This avoids some known problems with using the '.' operator to create symbols. And it collects those symbols together in one place.
Instead of ...
[quote user="Pashan None"] . = . + (0xF0 - .); /* Reserve the remaining space */[/quote]
I think you would be happier using the fill=value attribute when you define the MANAGED_RAM memory range in the MEMORY directive.
Thanks and regards,
-George