This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gc sections and .eh_frame


On Thu, Jun 09, 2005 at 03:34:20PM +0100, Jonathan Larmour wrote:
> Eric Botcazou wrote:
> >>That's quite a sledgehammer approach! The overhead of garbage collectable
> >>stuff in .rodata is substantially more than .gcc_except_table. For my own
> >>use, right now, I've just reverted the patch.
> >
> >Since -function-sections --gc-sections doesn't work in presence of DWARF-2 
> >EH, you could simply not pass -function-sections to the compiler.
> 
> Ah, the issue being on embedded targets (as powerpc-eabi is implicitly), 
> people are normally selective about what they allow to be compiled without 
> -fno-exceptions. In the case of eCos, the OS is fully linked to the 
> application, and almost none of the OS wants to use C++ exceptions. This 
> translates to large savings with gc sections.

Actually, it's not just eabi that is affected by this problem, but all
sysv4 abi powerpc targets, which includes powerpc-linux.  I've done some
digging through gcc CVS to see why this problem occurred, and found:

Geoff introduced #define EXCEPTION_SECTION readonly_data_section
here: http://gcc.gnu.org/ml/gcc-patches/2001-05/msg00812.html
All well and good, it was an improvement over using data_section

Over time though, we eventually had a default_exception_section that
could generate a read-only .gcc_except_table, so there is now no need
for the define in rs6000/sysv4.h, and of course using .rodata can result
in ld --gc-sections deleting needed exception information.  I'll be
committing a gcc patch soon to fix this on all active gcc branches,
pre-approved by David Edelsohn.

	* config/rs6000/sysv4.h (TARGET_ASM_EXCEPTION_SECTION): Delete.

Index: gcc/config/rs6000/sysv4.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/sysv4.h,v
retrieving revision 1.163
diff -u -p -r1.163 sysv4.h
--- gcc/config/rs6000/sysv4.h	1 Jun 2005 00:30:22 -0000	1.163
+++ gcc/config/rs6000/sysv4.h	10 Jun 2005 04:19:39 -0000
@@ -1284,8 +1284,6 @@ ncrtn.o%s"
    ? (((GLOBAL) ? DW_EH_PE_indirect : 0) | DW_EH_PE_pcrel | DW_EH_PE_sdata4) \
    : DW_EH_PE_absptr)
 
-#define TARGET_ASM_EXCEPTION_SECTION readonly_data_section
-
 #define DOUBLE_INT_ASM_OP "\t.quad\t"
 
 /* Generate entries in .fixup for relocatable addresses.  */

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


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