Re: Arm gnu directive assembler problem



Grant Edwards a écrit :
On 2005-06-30, pes <nospam@xxxxxxx> wrote:


MEMORY
{
  IntFLASH (rx) : ORIGIN = 0x00080000, LENGTH = 0x10000
  IntFLASH2  (rx) : ORIGIN = 0x0090000, LENGTH = 0x10000
  IntRAM   (rw) : ORIGIN = 0x00010000, LENGTH = 8192
}

SECTIONS
{
  .text :
  {
    *startup.o (.text)         /* Startup code */
    *(.text)                   /* remaining code */

    *(.glue_7t) *(.glue_7)
  } >IntFLASH

  . = ALIGN(4);

 .text2 :
  {
    *(.text)
  } >IntFLASH2

  . = ALIGN(4);
...
}



and when I want to use this section like that

        .text
        .arm

        .global _startup
        .func   _startup

	...

	.size   _startup, . - _startup
        .endfunc

	.section .text2
data0	.word	0x12345678

        .end

there is an error


What is the error?


There is an error on the .end line, I' ve no more description

and if I remove the dot before text2


Do you remove the dot in the linker script as well?


No, not in the script


compilation and link are ok but text2 section doesn' t seems
to exists.


Doesn't exist where?

The value isn' t in memory when the program is loaded

If you want the contents of the section to show up in hex files and linker output, you probably need to set the section attributes like this:


.section .text2,"a",@progbits

Technically, you probably should be using an "x" flag for a
text section as well.  It seems to work fine without it, but
it's the right thing to do:

.section .text2,"ax",@progbits
For a writable section, add a w to the flags string.

There is no change, but I use .section .text2,"ax","progbits" for syntax

You might want to do


 $ into as

and read the stuff on the .section directive.

Yes, but I' m a little embarassed I don' t see any examples with sections other than standard text bss & data.


Thanks for you interest
.



Relevant Pages