Undefined symbol in inline assembly
기술노트 47972
아키텍처:
AVR32
컴포넌트:
compiler
업데이트:
2021-05-07 오전 4:43
소개
IAR Embedded Workbench for AVR32 버전 4.2x 대로 마이그레이션 한 뒤에 발생 할 수 있는 에러...
Error[As011]: Undefined symbol: XXXXXX
...가 인라인 어셈블리를 사용하는 소스코드에 의해 발생합니다.
(같은 소스 코드에 대해 IAR Embedded Workbench for AVR32 버전 4.10 혹은 상위버전에서는 에러가 발생하지 않습니다.)
배경지식
IAR Embedded Workbench for AVR32 버전 4.2x 대에는 수정된 버그에 의존하는 3rd-party 소스 코드가 있습니다.
버그...
...는 한 인라인 어셈블리 문장에 있는 라벨이, 다른 인라인 어셈블리 문장으로 점프하기 위해 사용될 수 있습니다.
IAR C/C++ Compiler for AVR32는 이와 같은 점프 등, 레지스터를 처리하도록 만들어지지 않았습니다.
이에 대한 해결로...
...다른 인라인 어셈블리 문장 간 점프를 막는 것입니다.
언급한 유형의 점프를...
... 사용하는 3rd party 소스코드가 동작하지 않게 됩니다.
해결책
주 해결책...
...은 다른 인라인 어셈블리 문장 간 점프가 필요하지 않도록 소스코드를 재 작성하는 것입니다.
다른 해결책으로는...
...다음의 구성을 따라하세요. 주의하시기 바랍니다: 앞으로 설명하는 다른 해결책은 컴파일러의 보안 시스템을 무너트릴 수 있습니다. 다시 말해, 이 해결책을 사용하여 일어나는 일에 대한 책임은 본인이 짊어야 합니다.
이 해결책은 <installation directory>\avr32\doc\infocenter\iccavr32.ENU.html에 기술되어 있는 --disable_inline_asm_label_replacement를 사용합니다.
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".
모든 제품 이름은 해당 소유자의 상표 또는 등록 상표입니다.