linux-mips
[Top] [All Lists]

Re: question regarding put data in the specified section

To: Teresa Tao <TERESAT@TTI-DM.COM>
Subject: Re: question regarding put data in the specified section
From: Ralf Baechle <ralf@linux-mips.org>
Date: Sat, 15 Nov 2003 13:53:29 +0100
Cc: linux-mips@linux-mips.org
In-reply-to: <92F2591F460F684C9C309EB0D33256FA01B750B8@trid-mail1.tridentmicro.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <92F2591F460F684C9C309EB0D33256FA01B750B8@trid-mail1.tridentmicro.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.4.1i
On Fri, Nov 14, 2003 at 09:42:34AM -0800, Teresa Tao wrote:

> Does anyone know how to put my userland program's data in a specified section?
> 
> I know there is an attribute "section" to put my data inside a specified 
> section, for example, int data __attribute__ ((section("INITDAT"));
> But how do I initialize/setup the INITDAT section? We use the
> commercial toolchain, and we don't have the source code for it, is
> there still a way to specify the postion of the INITDAT section?

If your commercial toolchain understands the __attribute__ syntax then
I suspect it's based on gcc which would mean you have a right to the
sourcecode.

No initialization needed;  Ld will use the flags of the first instance
of an input section for the output section which usually is right.  In
the rare case this isn't suitable you can use a .section pseudo-op
in inline assembler or assembler to setup the section with the right
flags.  Just make sure this section is linked first.

  Ralf

<Prev in Thread] Current Thread [Next in Thread>