# Create a new task from a différent binary

**URL:** <https://forums.freertos.org/t/create-a-new-task-from-a-different-binary/5681>\
**Category:** Kernel\
**Created:** [December 12, 2009, 7:36pm UTC](https://forums.freertos.org/t/create-a-new-task-from-a-different-binary/5681 "2009-12-12T19:36:32Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [December 13, 2009, 1:07am UTC](https://forums.freertos.org/t/create-a-new-task-from-a-different-binary/5681/5 "2009-12-13T01:07:48Z")

</div>

**[dsnejko](https://sourceforge.net/u/dsnejko/)** wrote on [Sunday, December 13, 2009](https://sourceforge.net/p/freertos/discussion/382005/thread/fa9f21d3/#64cb):

I am using CodeWarrior and ColdFire port. All linking is done with assembler so my macro would not work for your toolchain. I have a common file included on both sides. It describes table offsets and&nbsp; macros for table insertion and calling. Something like this, name it lib\_links.inc:&nbsp;&nbsp;  
\<pre\>\<code\>  
&nbsp;&nbsp;&nbsp; .public \_xTaskCreate  
&nbsp;&nbsp;&nbsp; .public \_vTaskDelay

&nbsp;&nbsp; INSERT\_LINK: .macro&nbsp; ref  
.org&nbsp;&nbsp; OFFSET&&ref  
.long&nbsp; ref  
&nbsp;&nbsp; .endm&nbsp;

&nbsp;&nbsp;&nbsp; JUMP\_LINK:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .macro ref  
&&ref:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; move.l&nbsp; \_LIB\_LINK\_TABLE&nbsp; + OFFSET&&ref, a0  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; jmp&nbsp; (a0)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .endm  
\</code\>\</pre\>

The kernel build includes an assembler file similar to:  
\<pre\>\<code\>

.global \_LIB\_LINK\_TABLE  
&nbsp;&nbsp;&nbsp; .include lib\_links.inc

.text  
\_LIB\_LINK\_TABLE:  
\_LIB\_LINK\_TABLE\_START:  
\_FREERTOS\_LINK\_TABLE:  
&nbsp;&nbsp; INSERT\_LINK \_xTaskCreate  
&nbsp;&nbsp; INSERT\_LINK \_vTaskDelay  
\</code\>\</pre\>  
The application build includes an assembler file similar to:  
\<pre\>\<code\>  
&nbsp;&nbsp; .extern \_LIB\_LINK\_TABLE  
&nbsp;&nbsp; .include lib\_links.inc

&nbsp;&nbsp; .text  
\_LIB\_LINK\_TABLE\_APP:  
&nbsp;&nbsp;&nbsp; JUMP\_LINK \_xTaskCreate  
&nbsp;&nbsp;&nbsp; JUMP\_LINK \_vTaskDelay  
\</code\>\</pre\>

\_LIB\_LINK\_TABLE is a segment created in the linker command file at fixed location and known for the kernel and the app.

---

_[View the full topic](https://forums.freertos.org/t/create-a-new-task-from-a-different-binary/5681)._
