From 8a7140c38f21984c512ac97bcfa2f0d7417bdc27 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Thu, 29 Apr 2004 16:40:20 +0000 Subject: Add support for generating DWARF2 debug sections in the x86 PE port --- ld/ChangeLog | 5 ++++ ld/scripttempl/pe.sc | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 85 insertions(+), 2 deletions(-) (limited to 'ld') diff --git a/ld/ChangeLog b/ld/ChangeLog index 6d535da..d511853 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,8 @@ +2004-04-29 Brian Ford + + * scripttempl/pe.sc: Handle .debug* and .gnu.linkonce.wi.* sections + for DWARF 2/3. Update stab section's syntax. + 2004-04-29 Alan Modra * pe-dll.c: Revert changes accidentally committed 2004-03-08. diff --git a/ld/scripttempl/pe.sc b/ld/scripttempl/pe.sc index 91c6c55..60d4ed1 100644 --- a/ld/scripttempl/pe.sc +++ b/ld/scripttempl/pe.sc @@ -159,13 +159,91 @@ SECTIONS .stab ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} : { - [ .stab ] + *(.stab) } .stabstr ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} : { - [ .stabstr ] + *(.stabstr) } + /* DWARF debug sections. + Symbols in the DWARF debugging sections are relative to the beginning + of the section. Unlike other targets that fake this by putting the + section VMA at 0, the PE format will not allow it. */ + + /* DWARF 1.1 and DWARF 2. */ + .debug_aranges ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} : + { + *(.debug_aranges) + } + + .debug_pubnames ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} : + { + *(.debug_pubnames) + } + + /* DWARF 2. */ + .debug_info ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} : + { + *(.debug_info) *(.gnu.linkonce.wi.*) + } + + .debug_abbrev ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} : + { + *(.debug_abbrev) + } + + .debug_line ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} : + { + *(.debug_line) + } + + .debug_frame ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} : + { + *(.debug_frame) + } + + .debug_str ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} : + { + *(.debug_str) + } + + .debug_loc ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} : + { + *(.debug_loc) + } + + .debug_macinfo ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} : + { + *(.debug_macinfo) + } + + /* SGI/MIPS DWARF 2 extensions. */ + .debug_weaknames ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} : + { + *(.debug_weaknames) + } + + .debug_funcnames ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} : + { + *(.debug_funcnames) + } + + .debug_typenames ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} : + { + *(.debug_typenames) + } + + .debug_varnames ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} : + { + *(.debug_varnames) + } + + /* DWARF 3. */ + .debug_ranges ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} : + { + *(.debug_ranges) + } } EOF -- cgit v1.1