ВходНаше всё Теги codebook 无线电组件 Поиск Опросы Закон Четверг
11 июля
357052 Топик полностью
VVB (26.09.2012 10:17, просмотров: 231) ответил VVB на Вопрос по Keil (scatterload файлы)
Кстати, вот что keil пишет в своём руководстве How to prevent uninitialized data from being initialized to zero ARM Compiler toolchain v4.1 for µVision Using the Compiler Home > Compiler Coding Practices > How to prevent uninitialized data from being initialized to zero How to prevent uninitialized data from being initialized to zero The ANSI C specification states that static data that is not explicitly initialized, is to be initialized to zero. Therefore, by default, the compiler puts both zero-initialized and uninitialized data into the same ZI data section, which is populated with zeroes at runtime by the C library initialization code. You can prevent uninitialized data from being initialized to zero by placing that data in a different section. This can be achieved using #pragma arm section. Example 19. Retaining uninitialized data using #pragma arm section #pragma arm section zidata = “non_initialized” int i, j; // uninitialized data in non_initialized section (without the pragma, would be in .bss section by default) #pragma arm section zidata // back to default (.bss section) int k = 0, l = 0; // zero-initialized data in .bss section The non_initialized section is then placed into its own UNINIT execution region: LOAD_1 0x0 { EXEC_1 +0 { * (+RO) * (+RW) * (+ZI) ; ZI data gets initialized to zero } EXEC_2 +0 UNINIT { * (non_init) ; ZI data does not get initialized to zero } }