Not logged in, Join Here! or Log In Below:  
News Articles Search    

 Home / General Programming / linking-in code that is never used Account Manager
Archive Notice: This thread is old and no longer active. It is here for reference purposes. This thread was created on an older version of the flipcode forums, before the site closed in 2005. Please keep that in mind as you view this thread, as many of the topics and opinions may be outdated.

March 31, 2005, 07:09 AM

This is in the context of embedded development. I would like to include libs in ROM firmware that can be called by programs compiled and loaded later. The functions in the libs are never used in the firmware though.

For example, I would like to include the function strcpy from the standard libs in my ROM firmware so that a program built later can call it (via its physical address). However, since strcpy is never used in the ROM code, it is not linked-in. I'm using gcc.



March 31, 2005, 07:40 AM

Read the manual (man ld, the gnu linker). It seems you need to link with the "--export-dynamic" option.

This thread contains 2 messages.
Hosting by Solid Eight Studios, maker of PhotoTangler Collage Maker.