This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Locating library modules during link


Thierry Moreau wrote:

> 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.

Actually I want the drivers to be in the fast memory, but I'd like to use any leftover memory for the rest of the application, not just leave it unused. The problem I have is that the linker doesn't handle libraries the same as other files. If I have 
	*(.libtext) *(.text)
in the SECTIONS command, it first allocates space for all the .libtext segments in the object files, followed by the .text sections. However it only allocates the library space when all the object files sections have been processed, so the library .libtext areas follow the others, which either means that there is no space or that the allocation is into the slow memory.

> 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 explicit.
> 
> 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.

What I have now is a different link script for each configuration. I am working on getting
the link scripts generated automatically from the system specific configuration file by scanning the initialization for the driver initialization calls and building up a list of the drivers used. The makefile then extracts the modules that are needed from the library (or it could just reference a collection of object files) and explicitly names them in the link. It's a pain though and I was hoping to be able to use standard tools. It's easy enough to find someone competent enough with C to update the system file for a new configuration, but most C programmers (in my experience) don't understand makefiles or link scripts, and I don't want a system where we need a senior/systems programmer to make minor configuration changes.

Thanks
Stan Katz

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]