1. This forum section is a read-only archive which contains old newsgroup posts. If you wish to post a query, please do so in one of our main forum sections (here). This way you will get a faster, better response from the members on Motherboard Point.

Problem: How to specify Library in ld-Link-Script?

Discussion in 'Embedded' started by Thomas Obermair, May 21, 2006.

  1. Hi all!

    I'm trying to get BootUp-code for x86 (Pentium3) architecture working, using
    gcc an ld. Because after bootup only the F-Segment is visible to CPU, I need
    to place the "early" boot-code there. This also includes three libraries
    needed. How can i specify the libraries, so that the code from them gets
    into the correct segment?

    This is my actual link - script which does NOT work. All libraries are
    placed in codeExtSeg, although specified in codeStartSeg...!?

    MEMORY
    {
    /* Just F-Seg */
    codeStartSeg : ORIGIN = 0xf0000, LENGTH = 64K - 0x10
    /* Rest of code should got here */
    codeExtSeg : ORIGIN = 0xfff00000, LENGTH = 512K - 64K - 0x10
    <snip>
    }
    <snip>
    codeStartSeg_memory_location = 0xf0000 ;
    codeStartSeg_file_offset = 0x70000 ;

    codeExtSeg_memory_location = 0xfff00000 ;
    codeExtSeg_file_offset = 0x0 ;

    SECTIONS
    {
    <snip>
    .codeStartSeg codeStartSeg_memory_location : AT
    (codeStartSeg_file_offset)
    {
    target\obj\protected_mode_switch.o(.text .rodata)
    target\bin\setjmp.o(.text .rodata)
    target\bin\longjmp.o(.text .rodata)
    target\bin\bootLib.o(.text .rodata)
    target\bin\sysLib.o(.text .rodata)

    libsfl_p6.a /*************** I'd like to have this libs here in
    codeStartSeg, but ld places them into codeExtSeg... ?!? */
    libsfl_440bx.a
    libsfl_core.a
    } >codeStartSeg

    .text codeExtSeg_memory_location : AT (codeExtSeg_file_offset)
    {
    target\bin\RomTbl.o(.text .rodata)

    *(.text)
    *(.rodata)
    } >codeExtSeg
    <snip>


    Can anyone give me a hint, how to get ld to place the libs into
    codeStartSeg?

    Any help is appreciated!
    Many thanks,

    Thomas
     
    Thomas Obermair, May 21, 2006
    #1
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.