인라인 어셈블리에서 정의되지 않은 심볼

기술노트 47972

아키텍처:

AVR32

컴포넌트:

compiler

업데이트:

2018-02-28 오전 1:45

Introduction

After migration to IAR Embedded Workbench for AVR32 version 4.2x, the error...

Error[As011]: Undefined symbol: XXXXXX

.. is triggered for source code that uses inline assembly.

(There is no error for the same source in IAR Embedded Workbench for AVR32 version 4.10 or older).

Background

There is 3rd party source code that relies on a corrected bug in IAR Embedded Workbench for AVR32 version 4.2x.

The bug...

...was that a label in one inline assembly statement, could be used for a jump for another inline assembly statement.
The IAR C/C++ Compiler for AVR32 is not made to handle registers etc. for such a jump.

The correction...

...was to block jumps between different inline assembly statements.

Correction breaks 3rd party...

...source code that uses the described type of jump.

Solutions

Primary solution...

...is to rewrite the source so it doesn't need jumps between different inline assembly statements.

An a workaround...

...is to use the following construction. Please Note - IMPORTANT: This workaround Breaks the security system in the Compiler, i.e. You take responsibility for the effects of using this workaround.

The workaround is to use --disable_inline_asm_label_replacement which is documented in <installation directory>\avr32\doc\infocenter\iccavr32.ENU.html

The following option has been added:
--disable_inline_asm_label_replacement

Explanation:
Use this option to disable label replacement in
inline assembler statements. Disabling label
replacement will make labels shared between inline
assembler statements within a function meaning
that one inline assembler statement may refer to a
label in another inline assembler statement.

IMPORTANT:
IMPORTANT: The compiler leaves no guarantees on
the content of any register nor of the layout of
the stack frame upon entry of an inline assembler
statement unless explicitly requested through the
use of the extended inline assembler. Branching
between two inline assembler statement results in
"undefined behavior". 

 

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

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