This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [arm-elf-as] order of subsections/location of literal pool
- From: Dave Korn <dave dot korn dot cygwin at googlemail dot com>
- To: Sven Köhler <sven dot koehler at gmail dot com>
- Cc: binutils at sources dot redhat dot com
- Date: Sat, 23 May 2009 23:02:52 +0100
- Subject: Re: [arm-elf-as] order of subsections/location of literal pool
- References: <gv9ipm$dsa$1@ger.gmane.org>
Sven Köhler wrote:
> 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.
>
> Are any guarantees of any kind?
The GAS manual has a chapter on subsections that includes the words
" Subsections appear in your object file in numeric order, lowest
numbered to highest. "
http://sourceware.org/binutils/docs-2.19/as/Sub_002dSections.html
I don't know if the ARM assembler guarantees to place the constant pool in
the subsection where it's referred to or not, an ARM specialist would have to
chip in with that. However a few seconds searching for "pool" in the docs
pointed me to some interesting info in the description of the ".ltorg"
directive. The documentation for 'ldr' is also informative.
cheers,
DaveK