This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]