Link error undefined _exception_table_end__

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Link error undefined _exception_table_end__

Jump to solution
597 Views
wcampbell
Contributor I

I'm looking to pull in some c++ code into a c project in Codewarrior 10.3. The project built and ran fine before I added the new code, but now when I build I get a vague link error that says:

 

>Undefined : "_exception_table_end__"

>Referenced from "Ex68K_FindExceptionRecord(char*,MWExceptionInfo*)" in

C:/Freescale/CW MCU v10.3/MCU/ColdFire_Tools/Command_Line_Tools/mwldmcf|Linker|Error

>Undefined : "_exception_table_start__"

>Referenced from "Ex68K_FindExceptionRecord(char*,MWExceptionInfo*)" in

C:/Freescale/CW MCU v10.3/MCU/ColdFire_Tools/Command_Line_Tools/mwldmcf|Linker|Error

>Link failed.

 

The issue seems to be related to my use of "new" in one of my wrapper functions.

 

I have -Cpp_Exceptions OFF, since I'm not using them anywhere in my c++ code (and turning then on didn't affect the error). Are there some settings I need to enable/disable? I'm fairly new to mixing c and c++, so I may be missing something obvious.

Thanks.

Labels (1)
0 Kudos
1 Solution
406 Views
Carlos_Musich
NXP Employee
NXP Employee

Hi!

These are linker generated names used in conjunction with STATICINIT and EXCEPTION directives in the linker command file (LCF). Open up a C++ default project and you'll see how they're used MCU_ColdFire_Compiler.pdf also has information about it. You can find this document in
C:\Freescale\CW MCU v10.3\MCU\Help\PDF


Basically it means that you apparently took a C rather than C++ lcf and the output binary has no C++ exception handling or static initialization support in it, which is obviously wrong. However, if you are trying to compile with an LCF for RAM which does not contain those symbols, please change your target to Flash and the project will eventually be correctly linked .

Hope this helps.

Carlos

View solution in original post

0 Kudos
1 Reply
407 Views
Carlos_Musich
NXP Employee
NXP Employee

Hi!

These are linker generated names used in conjunction with STATICINIT and EXCEPTION directives in the linker command file (LCF). Open up a C++ default project and you'll see how they're used MCU_ColdFire_Compiler.pdf also has information about it. You can find this document in
C:\Freescale\CW MCU v10.3\MCU\Help\PDF


Basically it means that you apparently took a C rather than C++ lcf and the output binary has no C++ exception handling or static initialization support in it, which is obviously wrong. However, if you are trying to compile with an LCF for RAM which does not contain those symbols, please change your target to Flash and the project will eventually be correctly linked .

Hope this helps.

Carlos

0 Kudos