link issue - VxWorks

This is a discussion on link issue - VxWorks ; Dear all, I want to use a specific address for a small part of code. The I must link a .s file (some labels) to a specific address. Do you know where I can find some informations on the best ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: link issue

  1. link issue

    Dear all,

    I want to use a specific address for a small part of code. The I must
    link a .s file (some labels) to a specific address. Do you know where
    I can find some informations on the best way to do ? which file
    contains memory segment definition, is there a pdf to describe it,
    etc ...

    many thanks in advance,

    Sylvain

  2. Re: link issue

    sybe wrote:
    > Dear all,
    >
    > I want to use a specific address for a small part of code. The I must
    > link a .s file (some labels) to a specific address. Do you know where
    > I can find some informations on the best way to do ? which file
    > contains memory segment definition, is there a pdf to describe it,
    > etc ...

    Hi Sylvain,

    You can definitely do it with a custom linker script. See the linker
    script documentation at (I'm assuming you're using the GNU linker from
    Wind River).

    http://sourceware.org/binutils/docs-2.17/ld/index.html.

    Say your assembly code defines some section called .mysection and
    the filename is myfile.o. You'll need to add myfile.o to the linker
    command line, and also to the linker script.

    You'll need to describe the linker SECTION of code and its start
    address, then tell the linker which object file and which section(s)
    within that object file should be included in the image inside that SECTION.

    The linker script addition should looks something like this:

    .mysect 0x12345678 :
    {
    myfile.o(.mysection)
    }
    where the absolute address is the hex number.

    If there are other sections that you want in the memory image after
    this one, you have three choices: let them simply come along adjacent to
    this one, or use another section with a start address to move them up
    further. You can also move the location where the linker puts following
    sections up by en expression like
    '. = . + 0x2000'
    which moves all code described later up 2000 hex bytes. There are
    several examples of this in the default linker script. The dot
    character represents the linker's next memory location.

    It's your responsibility to assure that this address (0x12345678 in
    the exampleabove) is supported by your hardware, and that it doesn't
    overlap the memory assignments that the linker makes for you in other
    parts of the linker script.

    You can get a copy of the linker script to play with by entering the
    command 'ldppc --verbose' if you're using the GNU PPC linker from Wind.

    Ask again if you need more hints after you've played with it for a while.

    Bill

    >
    > many thanks in advance,
    >
    > Sylvain


  3. Re: link issue

    On Mar 18, 4:25*am, Bill Cox wrote:
    > sybe wrote:
    > > Dear all,

    >
    > > I want to use a specific address for a small part of code. The I must
    > > link a .s file (some labels) to a specific address. Do you know where
    > > I can find some informations on the best way to do ? which file
    > > contains memory segment definition, is there a pdf to describe it,
    > > etc ...

    >
    > Hi Sylvain,
    >
    > You can definitely do it with a custom linker script. *See the linker
    > script documentation at (I'm assuming you're using the GNU linker from
    > Wind River).
    >
    > http://sourceware.org/binutils/docs-2.17/ld/index.html.
    >
    > Say your assembly code defines some section called .mysection and
    > the filename is myfile.o. *You'll need to add myfile.o to the linker
    > command line, and also to the linker script.
    >
    > You'll need to describe the linker SECTION of code and its start
    > address, then tell the linker which object file and which section(s)
    > within that object file should be included in the image inside that SECTION.
    >
    > The linker script addition should looks something like this:
    >
    > * * * * .mysect 0x12345678 :
    > * * * * {
    > * * * * * * * * myfile.o(.mysection)
    > * * * * }
    > where the absolute address is the hex number.
    >
    > If there are other sections that you want in the memory image after
    > this one, you have three choices: let them simply come along adjacent to
    > this one, or use another section with a start address to move them up
    > further. *You can also move the location where the linker puts following
    > sections up by en expression like
    > * * * * '. = . + 0x2000'
    > which moves all code described later up 2000 hex bytes. *There are
    > several examples of this in the default linker script. *The dot
    > character represents the linker's next memory location.
    >
    > It's your responsibility to assure that this address (0x12345678 in
    > the exampleabove) is supported by your hardware, and that it doesn't
    > overlap the memory assignments that the linker makes for you in other
    > parts of the linker script.
    >
    > You can get a copy of the linker script to play with by entering the
    > command 'ldppc --verbose' if you're using the GNU PPC linker from Wind.
    >
    > Ask again if you need more hints after you've played with it for a while.
    >
    > Bill
    >
    >
    >
    >
    >
    > > many thanks in advance,

    >
    > > Sylvain- Hide quoted text -

    >
    > - Show quoted text -


    Many thanks for your help. I will test it today but your solution
    please to me.

    Regards

+ Reply to Thread