[arm-elf-as] order of subsections/location of literal pool

Ramana Radhakrishnan ramana.r@gmail.com
Sat May 23 20:51:00 GMT 2009


On 23 May 2009, at 20:28, Sven Köhler <sven.koehler@gmail.com> wrote:

> Hi,
>
> at the moment, I'm writing  a small assembler-only program.
> There are a few constraints, and I would make to sure, that they are  
> met.
>
> The program looks something like this:
> (target is arm-elf)
>
> .text 2
> param .long 0x44332211
>
> .text 1
> ldr r1, =0x12345678
> ldr r2, param
>
>
> I use subsection for two reasons:
> - it seems that the literal pool (in this case, the literal 0x12345678
> will be stored there) is always placed at the end of the current
> subsection (it must not be placed after param)
> - it seems that the subsection 2 is always places after subsection 1
>
>
> Are there two conditions always met?
>
> The .long param should always be the last 4 bytes of the program. The
> last 4 bytes of the program are to be modified during the process of
> uploading the code to some embedded system. So it's very important  
> that
> they are always the last 4 bytes.



If this is what you want, why not use a custom linker script to ensure  
this ?
>
>
> Are any guarantees of any kind?
>
>
> Regards,
>  Sven
>



More information about the Binutils mailing list