This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
RE: ASM_OUTPUT_SECTION_NAME cleanup patch problem
- From: "Rekha Deshmukh" <RekhaD at kpit dot com>
- To: "Richard Henderson" <rth at redhat dot com>
- Cc: <gcc at gcc dot gnu dot org>,<gcc-patches at gcc dot gnu dot org>
- Date: Mon, 3 Jun 2002 15:46:52 +0530
- Subject: RE: ASM_OUTPUT_SECTION_NAME cleanup patch problem
Hi Richard!
Thanks for the reply.
Actually I think the problem is not concerned with newlib. As it is concerned with libgcc2.a.
In libgcc2.c the following comment in libgcc2.c tells that the crtstuff.c is a common file used for ELF and for some crosses it defines in libgcc2.c. Here only EH_FRAME_SECTION_NAME macro is checked and the __EH_FRAME_BEGIN symbol is defined. But in case of sh-coff format to not enter the condition there should be added expression.
/* Some ELF crosses use crtstuff.c to provide __CTOR_LIST__, but use this
code to run constructors. In that case, we need to handle EH here, too. */
#ifdef EH_FRAME_SECTION_NAME
#include "unwind-dw2-fde.h"
extern unsigned char __EH_FRAME_BEGIN__[];
#endif
In the same way in __do_global_dtors and __do_global_ctors funtions there should be some other expression to be checked other than EH_FRAME_SECTION_NAME and HAS_INIT_SECTION, so that while building coff this condition is not satisfied.
void
__do_global_dtors (void)
{
.....
#if defined (EH_FRAME_SECTION_NAME) && !defined (HAS_INIT_SECTION)
{
.......
void
__do_global_ctors (void)
{
#ifdef EH_FRAME_SECTION_NAME
..........
Actually I tried a work around for this problem. For all these three #if statements I andded a expression ( #defined (OBJECT_FORMAT_ELF)) so that it only enters the if statement when the object format is ELF. After the workaround coff tool chain is properly building the executable. But I am not sure whether this workaround is correct or wrong. Whether it will not harm the other targets?
Please guide me in this.
Thanks & Regards
Rekha
-----Original Message-----
From: Richard Henderson [mailto:rth@redhat.com]
Sent: Friday, May 31, 2002 11:42 PM
To: Rekha Deshmukh
Cc: gcc@gcc.gnu.org; gcc-patches@gcc.gnu.org
Subject: Re: ASM_OUTPUT_SECTION_NAME cleanup patch problem
On Fri, May 31, 2002 at 05:58:27PM +0530, Rekha Deshmukh wrote:
> The EH_FRAME_SECTION_NAME macro is set for sh-coff and sh-hms wrongly.
> In the source code previous to this patch (gcc-3.0.3,gcc-3.0.4) the
> EH_FRAME_SECTION was set only if the DWARF2_UNWIND_INFO was set, that
> was in the defaults.h file.
While this could be reverted in gcc, you'd almost certainly have better
results by modifying newlib to handle dwarf2 unwind info. This has been
done for other coff targets, so I see no reason why it wouldn't work for
SH as well.
r~