[ECOS] allocating code to sections in source code

Grant Edwards grante@visi.com
Sat Jan 27 14:48:00 GMT 2001

On Sat, Jan 27, 2001 at 09:32:58PM +0000, chris.r.lipchik@att.net wrote:

> I'm looking for a reference guide on line which would 
> have the proper syntax for allocating code in a C or 
> ASM source file to a specific section which can be later 
> referenced by the linker.  Specifially, I'm interested in 
> the syntax for the gcc.

In assembly, use the .section directive:

	  .section foobar
          <your stuff here>

In gcc, use the __attribute__(()) mechanism:

    char myBuffer[512] __attribute__((section("foobar")));

Both of these are explained in the "info" files:

$ info gcc
$ info gas

Grant Edwards

More information about the Ecos-discuss mailing list