Locating library modules during link
Sat Oct 12 03:23:00 GMT 2002
Stan Katz wrote:
> [...] The hardware I am using (Hitachi SH2) has fast internal Flash and Ram [...]
> The problem is that for production we will be generating several systems containing different combinations of the
> drivers, and we plan to add drivers as the new hardware is developed. The original plan was to place all the drivers
> in a library archive and to let the linker select the needed drivers. This is also now working.
> The problem is combining the 2 requirements.
> Unfortunately however, the linker seems to allocate
> the library data last (which is as I expected) and by the time any code from the library is included the internal
> Flash is already full with other code and the .libtext data ends up after the .text.
Perhaps you can't have your cake and eat it. If you whish to load more instruction/data to the fast memory than its total
capacity, you shouldn't expect the linker to decide which sections is more important to you.
> Any other ideas out there, or am I going to have to look into extending the linker ?
You might consider putting everything in explicit files and use #if (HAS_DRIVER_XYZ) / #endif around the complete source
code (after a few header files that gets the applicable value for HAS_DRIVER_XYZ) for the device-specific portions of your
application source code. This way, you bring the code selection decisions up front, to the source code, and make it
I used this approach in a project, with a special-purpose C preprocessor that could give the complete project source code
filtered for a specific configuration.
> Stan Katz
> Want more information? See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
> Want to unsubscribe? Send a note to email@example.com
- Thierry Moreau
CONNOTECH Experts-conseils inc.
9130 Place de Montgolfier
Want more information? See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to firstname.lastname@example.org
More information about the crossgcc