This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: Target hooks for exception and eh frame sections
Neil Booth wrote:
>
> Hi Stan,
>
> Stan Shebs wrote:-
>
> > *** target-def.h 2001/09/21 01:26:52 1.14
> > --- target-def.h 2001/10/19 20:56:34
> > *************** Foundation, 59 Temple Place - Suite 330,
> > *** 72,77 ****
> > --- 72,85 ----
> > #define TARGET_HAVE_NAMED_SECTIONS false
> > #endif
> >
> > + #ifndef TARGET_ASM_EXCEPTION_SECTION
> > + #define TARGET_ASM_EXCEPTION_SECTION default_exception_section
> > + #endif
> > +
> > + #ifndef TARGET_ASM_EH_FRAME_SECTION
> > + #define TARGET_ASM_EH_FRAME_SECTION default_eh_frame_section
> > + #endif
> > +
>
> I'm pretty sure that the #if..#endif is unnecessary here - at least
> the rest of the file is designed that way. The idea is that all
> interested files #include "target-def.h" and then redefine anything
> they want to override. If you agree would you remove them as they
> just clutter things up?
Alas, they prove to be necessary. The problem is that TARGET_foo
definitions in <arch>.c are only possible for definitions that
are the same for all operating systems. OS-specific definitions
must (for now anyway) live in <arch>/<os>.h, which gets included
before target-def.h in <arch>/<arch>.c.
I didn't want to add those ifndefs either, but testing reminded me
of the hard realities of the situation... :-(
One way to solve might be to try to include target-def.h before
config.h, but that seems hard to get right.
Stan