Locating library modules during link

Nick Clifton nickc@redhat.com
Fri Oct 18 10:50:00 GMT 2002


Hi Stan,

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

Err, why doesn't something like this work:

        SECTIONS
        {
                .libtext : { *(.libtext) }
                .libdata : { *(.libdata) }
                .text    : { *(.text) }
                .data    : { *(.data) }
        }

This should place the .libdata section contents next to the .libtext
section contents, and assuming that you start .libtext at the start of
fast RAM, you should get the best placement possible.

Cheers
        Nick




More information about the Binutils mailing list