From: "Mark E." To: djgpp-workers AT delorie DOT com Date: Tue, 13 Aug 2002 14:38:03 -0400 MIME-Version: 1.0 Subject: Re: Problem with DWARF2 debug info for DJGPP Message-ID: <3D5919CB.9251.4964C6@localhost> In-reply-to: <3D58F6E4.4695.1F983A@localhost> References: <3D593BF7 DOT 26818 DOT 137F06A AT localhost> X-mailer: Pegasus Mail for Windows (v4.02) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Content-description: Mail message body Reply-To: djgpp-workers AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > Your right. I'll try and make the rule more restrictive just in case. Here's a more restrictive version: *** write.c.orig Sat Jun 8 03:37:14 2002 --- write.c Tue Aug 13 14:36:32 2002 *************** set_segment_vma (abfd, sec, xxx) *** 1419,1429 **** PTR xxx ATTRIBUTE_UNUSED; { static bfd_vma addr = 0; ! bfd_set_section_vma (abfd, sec, addr); ! addr += bfd_section_size (abfd, sec); } ! #endif /* BFD_ASSEMBLER && OBJ_COFF && !TE_PE */ /* Finish the subsegments. After every sub-segment, we fake an ".align ...". This conforms to BSD4.2 brane-damage. We then fake --- 1419,1456 ---- PTR xxx ATTRIBUTE_UNUSED; { static bfd_vma addr = 0; + flagword flags; + int debug_section, maybe_debug_section; ! flags = bfd_get_section_flags (abfd, sec); ! debug_section = (flags & SEC_DEBUGGING) != 0; ! ! /* SEC_DEBUGGING may not be set for DWARF2 sections. ! Check for them by name to be certain. */ ! maybe_debug_section = (flags & SEC_ALLOC) == 0 ! && (flags & SEC_HAS_CONTENTS) != 0; ! ! /* Set the vma of debugging sections to zero to keep ! BFD's DWARF2 reader from complaining about bad data ! when an undefined symbol is reported by the linker. */ ! if (!debug_section && maybe_debug_section) ! { ! const char *sec_name = bfd_get_section_name (abfd, sec); ! if (strncmp (sec_name, ".debug", 6) == 0 ! || strncmp (sec_name, ".gnu.linkonce.wi.", 17) == 0) ! debug_section = 1; ! } ! ! if (debug_section) ! { ! bfd_set_section_vma (abfd, sec, 0); ! return; ! } ! ! bfd_set_section_vma (abfd, sec, addr); ! addr += bfd_section_size (abfd, sec); } ! #endif /* BFD_ASSEMBLER && OBJ_COFF && !TE_GO32 */ /* Finish the subsegments. After every sub-segment, we fake an ".align ...". This conforms to BSD4.2 brane-damage. We then fake