This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


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

crash with --gc-sections


I'm experiencing a linker segfault with --gc-sections.  The problem seems to 
be that elf_gc_mark is trying to visit the *ABS* section, which is stored in 
read-only memory.

The trivial patch below causes the special sections like *ABS* and *UND* to 
start out with their gc_mark flag already set.  Does that seem reasonable?

Thanks

p.

2000-11-09  Philip Blundell  <pb@futuretv.com>

	* section.c (STD_SECTION): Set gc_mark flag.

Index: section.c
===================================================================
RCS file: /cvs/src/src/bfd/section.c,v
retrieving revision 1.12
diff -u -r1.12 section.c
--- section.c	2000/02/21 12:01:25	1.12
+++ section.c	2000/11/09 15:42:55
@@ -542,7 +542,7 @@
   const asymbol * const SYM = (asymbol *) &global_syms[IDX]; \
   const asection SEC = \
     /* name, index, next, flags, set_vma, reloc_done, linker_mark, gc_mark */ \
-    { NAME,  0,     0,    FLAGS, 0,       0,          0,           0,	      \
+    { NAME,  0,     0,    FLAGS, 0,       0,          0,           1,	      \
 									      \
     /* vma, lma, _cooked_size, _raw_size, output_offset, output_section, */   \
        0,   0,   0,            0,         0,             (struct sec *) &SEC, \



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