comp.lang.ada
 help / color / mirror / Atom feed
* pragma Machine_Attribute
@ 2003-05-03 19:03 Bernd Trog
  2003-05-05  8:17 ` Sergey Koshcheyev
  0 siblings, 1 reply; 3+ messages in thread
From: Bernd Trog @ 2003-05-03 19:03 UTC (permalink / raw)


Hi,

I have this C stuff:

void boot(void) __attribute__ ((section (".bootloader")));

and this part of the Makefile to set the address at link-time:

gcc [...]  -Wl,--section-start=.bootloader=0x1E000


Now I'd like to do the same in GNAT Ada.

I've tried:

   procedure Boot;
   pragma Machine_Attribute (Entity => Boot,
                             Attribute_Name => "section (.bootloader)"
                             );
   procedure Boot
   is
   begin   
      null;
   end;

and got this waring:

bootloader.adb:12: warning: `section (.bootloader)' attribute directive ignored


And 'objdump -h' doesn't print a .bootloader section :-(



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: pragma Machine_Attribute
  2003-05-03 19:03 pragma Machine_Attribute Bernd Trog
@ 2003-05-05  8:17 ` Sergey Koshcheyev
  2003-05-05 13:52   ` Bernd Trog
  0 siblings, 1 reply; 3+ messages in thread
From: Sergey Koshcheyev @ 2003-05-05  8:17 UTC (permalink / raw)


Bernd Trog wrote:
> Hi,
> 
> I have this C stuff:
> 
> void boot(void) __attribute__ ((section (".bootloader")));
> 
> and this part of the Makefile to set the address at link-time:
> 
> gcc [...]  -Wl,--section-start=.bootloader=0x1E000
> 
> 
> Now I'd like to do the same in GNAT Ada.
> 
> I've tried:
> 
>    procedure Boot;
>    pragma Machine_Attribute (Entity => Boot,
>                              Attribute_Name => "section (.bootloader)"
>                              );
>    procedure Boot
>    is
>    begin   
>       null;
>    end;
> 
> and got this waring:
> 
> bootloader.adb:12: warning: `section (.bootloader)' attribute directive ignored
> 
> 
> And 'objdump -h' doesn't print a .bootloader section :-(

You probably have to include the quotes around .bootloader also in the 
pragma in the Ada source, like this:

pragma Machine_Attribute (Entity => Boot,
                           Attribute_Name => "section ("".bootloader"")"
                           );

Sergey.




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: pragma Machine_Attribute
  2003-05-05  8:17 ` Sergey Koshcheyev
@ 2003-05-05 13:52   ` Bernd Trog
  0 siblings, 0 replies; 3+ messages in thread
From: Bernd Trog @ 2003-05-05 13:52 UTC (permalink / raw)


Sergey Koshcheyev <serko84@hotmail.com> wrote in message 
> > and got this waring:
> > 
> > bootloader.adb:12: warning: `section (.bootloader)' attribute directive ignored
> > 
> > 
> > And 'objdump -h' doesn't print a .bootloader section :-(
> 
> You probably have to include the quotes around .bootloader also in the 
> pragma in the Ada source, like this:
> 
> pragma Machine_Attribute (Entity => Boot,
>                            Attribute_Name => "section ("".bootloader"")"
>                            );

bootloader.adb:12: warning: `section (".bootloader")' attribute directive ignored


Is this supposed to work at all?



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-05-05 13:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-03 19:03 pragma Machine_Attribute Bernd Trog
2003-05-05  8:17 ` Sergey Koshcheyev
2003-05-05 13:52   ` Bernd Trog

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox