Re: Arm gnu directive assembler problem



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?

> and if I remove the dot before text2

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

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

Doesn't exist where?

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.

You might want to do

$ into as

and read the stuff on the .section directive.

--
Grant Edwards grante Yow! .. If I had heart
at failure right now,
visi.com I couldn't be a more
fortunate man!!
.