This is the mail archive of the crossgcc@sourceware.cygnus.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more infromation.


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

Re: Specifics on declaring sections in C code


Christopher Bahns <chris@bahns.com> wrote:

> 1. In my C source code, how do I direct specific types of information to
> certain sections? E.g. what if I want my code and initialized data to go
> into one section, uninitialized data to go into another section, and
> string literals to go into another? Of course, I want to specify the
> sections, since I want to override the default ".bss", ".text", ".data",
> etc.

Use section attributes. See "Function Attributes" and "Variable Attributes" in
"Using and Porting GCC".

> 2. Is there a return type from GNU's __asm__()? It appears that MRI's
> asm() can be used in the following way:
>
>     pTblRam = asm(void*, " move.l #.STARTOF.(UITBL_RAM),D0 ");
>
> Does GNU's __asm__() allow you to provide two arguments and/or use a
> return value? It would appear that MRI's asm() returns the value of the
> D0 register, with the type that is given as the first parameter ("void*"
> in this case). Again, MRI people please correct me if I'm wrong here.
> Anyone know how I should convert this line of MRI-compatible source code
> to GNU?
>
> Is GNU's __asm__ directive documented thoroughly somewhere?

See "Extended Asm" in "Using and Porting GCC".

--
Michael Sokolov		Harhan Engineering Laboratory
Public Service Agent	International Free Computing Task Force
			International Engineering and Science Task Force
			615 N GOOD LATIMER EXPY STE #4
			DALLAS TX 75204-5852 USA

Phone: +1-214-824-7693 (Harhan Eng Lab office)
E-mail: msokolov@ivan.Harhan.ORG (ARPA TCP/SMTP) (UUCP coming soon)

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com


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