지정된 순서로 블록 연결
기술노트 92924
아키텍처:
ARM, RL78, RX, SH, STM8
컴포넌트:
linker
업데이트:
2018-02-28 오전 2:53
Introduction
This tech note covers how to get IAR ILINK Linker to link the output in a specified order.
Background
When linking the linked sections and blocks are linked in an arbitrary order, (this is so by design).
Solution
The linker directive define block can be complemented with a fixed order parameter to get fixed order.
Example 1
Often (in the .icf files) the directive for placement in RAM looks like:
place in RAM_region { readwrite,
block CSTACK, block SVC_STACK, block IRQ_STACK, block FIQ_STACK,
block UND_STACK, block ABT_STACK, block HEAP };
To get fixed placement replace the above directive with these two directives:
define block FIXED_ORDER_RAM with fixed order { block CSTACK,
block SVC_STACK, block IRQ_STACK, block FIQ_STACK,
block UND_STACK, block ABT_STACK, block HEAP};
place in RAM_region { readwrite, last block FIXED_ORDER_RAM };
Example 2
The example project ( Example 2 (ARM).zip , Example 2 (RX).zip , Example 2 (SH).zip) contains a buildable example placing blocks in a specified order in both the ROM and RAM regions.
Further reading
The Define Block directive is documented in the Section handling chapter in the Development Guide.
All product names are trademarks or registered trademarks of their respective owners.