# Assembler errors: unrecognized opcode:func\_export / unsupported relocation against r3

**URL:** <https://discourse.cmake.org/t/assembler-errors-unrecognized-opcode-func-export-unsupported-relocation-against-r3/722>\
**Category:** Code\
**Tags:** lang:asm\
**Created:** [February 27, 2020, 7:45pm UTC](https://discourse.cmake.org/t/assembler-errors-unrecognized-opcode-func-export-unsupported-relocation-against-r3/722 "2020-02-27T19:45:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mike432](https://discourse.cmake.org/user_avatar/discourse.cmake.org/mike432/32/395_2.png) [@Mike432](https://discourse.cmake.org/u/Mike432)\
**Post date:** [February 27, 2020, 7:45pm UTC](https://discourse.cmake.org/t/assembler-errors-unrecognized-opcode-func-export-unsupported-relocation-against-r3/722/1 "2020-02-27T19:45:28Z")

</div>

I’m getting CMake assembler errors such as:

> testing.s:137: Error: unrecognized opcode: ‘func\_export(testing)’  
> testing.s:146: Error: unrecognized opcode: ‘func\_begin(testing)’  
> testing.s:217: Error: unrecognized opcode: ‘func\_end(testing)’  
> testing.s:149: Error: unsupported relocation against r3  
> testing.s:162: Error: unsupported relocation against r4  
> testing.s:187: Error: unsupported relocation against r5

_Question_: What can I do about these errors?

My assembly code (in file testing.s) looks something like the following code. I’ve removed a lot of it and am trying to be concise.

> #define \_ASMLANGUAGE  
> #include “vxWorks.h”  
> #include \<asm.h\>
> 
> FUNC\_EXPORT(testing)  
> .text  
> .align 2  
> .long 0  
> .long 1  
> .globl testing  
> FUNC\_BEGIN(testing)  
> li r3, 1  
> ori r4, r4, 0x6789  
> srw r4, r4, r5  
> FUNC\_END(testing)

My CMakeLists.txt looks something like:

> cmake\_minimum\_required (VERSION 2.6)  
> project(testing LANGUAGES CXX ASM)  
> set(CMAKE\_CXX\_FLAGS “${CMAKE\_CXX\_FLAGS} -Wall -g -std=c++0x -Wextra -Wpedantic”)  
> set(dir3 …/…/…/util/dir3)  
> add\_executable(testing  
> ${dir3}/one.cpp  
> ${dir3}/two.cpp  
> ${dir3}/three.cpp  
> ${dir3}/testing.s  
> )

Thank you,
