On Wed, Jul 21, 2021, 7:12 PM Michael Eager <ea...@eagercon.com> wrote:

> On 7/21/21 2:28 PM, Joel Sherrill wrote:
> > Hi
> >
> > We are in the process of porting RTEMS to the Microblaze and gcc does
> > not have __ELF__ as a predefine. In looking around at where to add it,
> > it looks like there are multiple ways to do it. We see variations on
> > the following patterns:
> >
> > + dbxelf.h
> > + OS specific header in config/
> > + Arch/OS specific header
> >
> > Integrating dbxelf.h into the microblaze seems risky for one simple
> > builtin_define(). Adding it to config/microblaze/rtems.h won't address
> > the microblaze-elf target.
> >
> > A suggestion on where to add the builtin_predefine is appreciated.
>
> There are very few defines for __ELF__ in the GCC target files.
>

Many  targets include dbxelf.h from the config.gcc script. There are 130
references to that file there. That seems to be where most architectures
get it.



> Why don't you put this in rtems.h?
>

That's ok for a hack but we haven't had to do that on the other ports so it
seems wrong.

I didn't mention but without this defined the cdefs.h file in newlib
produces incorrect macro definitions for at the weak_reference macro.


> Alternately, you might put it in microblaze-s.c, wrapped with
> #ifdef OBJECT_FORMAT_ELF/#endif.
>

Ok. This should fix it for microblaze-elf also.

Thanks.

--joel

>
> --
> Michael Eager
>

Reply via email to