Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
19 years ago

Linker Flags in NiosII IDE

Could anyone tell me what I'm doing wrong?

My aim is to place an array at a particular address, as an example 0x10000.

Help files descibe one way of declaration section as a linker flag

--section-start SECTION=ADDRESS

I set
--section-start FRAME=0x10000

and in с file

char Frame __attribute__ ((section ("FRAME")));

But the linker says:

nios2-elf-g++: FRAME=0x10000: No such file or directory

I've missed something, haven't I?

Regards

3 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I've managed it!

    In autogenerated file generated.x I added the section description

    SECTIONS
    {
        ............................
        . = 0x10000;
        .frame : { *(.frame) }
    }

    And here it is! The array Frame[] is placed at 0x10000
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    It's a good idea to browse through Redhat's website, as well....for any of the binutils (http://sources.redhat.com/binutils/) tools. The syntax of linker scripts is covered here....

    For those who really want to know how it works.

    Cheers,

    - slacker