특정 위치에 라이브러리 함수를 배치하려면 어떻게 해야 합니까?

기술노트 33441

아키텍처:

ARM, RH850, RX, SH, STM8

컴포넌트:

linker

업데이트:

2018-02-28 오전 2:53

Introduction

When IAR ILINK Linker links the output, the linked sections and blocks, including library functions, will be in arbitrary order. (This is so by design).

Solution

The linker directive "define block", complemented with a "fixed order" parameter, can be used to group for example DLIB functions using "section selectors" with the keyword "object".

For more information, see the chapter Section-selectors in the Development Guide.

Example

This example will group library functions in a specified order and place them last in the ROM region.

With the following lines added to the .icf file ...

define block LIB_CODE with fixed order
{
readonly object xreportassert.o,
readonly object iarttio.o,
readonly object ABImemcpy.o,
readonly object cmain.o
};

place in ROM_region { readonly, last block LIB_CODE };

... the .map file will show something like ...

LIB_CODE                    0x0800cd98   0x192  <Block>
.text ro code 0x0800cd98 0xa0 xreportassert.o [3]
.text ro code 0x0800ce38 0x6c iarttio.o [6]
.text ro code 0x0800cea4 0x70 ABImemcpy.o [5]
.text ro code 0x0800cf14 0x16 cmain.o [5]

 

All product names are trademarks or registered trademarks of their respective owners.

죄송하지만, 당사 사이트에서는 Internet Explorer를 지원하지 않습니다.보다 편안한 사이트를 위해 Chrome, Edge, Firefox 등과 같은 최신 브라우저를 사용해 주시길 부탁드립니다.