Rewrite/fix cygwin1.dbg generation

Christopher Faylor cgf-use-the-mailinglist-please@cygwin.com
Thu Nov 8 14:14:00 GMT 2007


On Thu, Nov 08, 2007 at 12:03:59AM +0000, Pedro Alves wrote:
> Christopher Faylor wrote:
>
>> That would be fine with me.  OTOH, if the dllfixdbg isn't doing the
>> right thing for gdb couldn't it be adapted to include the required
>> sections?
>
> Yep.  Here is a patch that does that.
>
> Testsuite shows no changes, I could build cygwin in cygwin with
> this, and gdb doesn't complain anymore.
>
> Also tested that the cygheap can grow as much as the previous
> version.
>
>  >objdump.exe -h new-cygwin1.dll
>
> new-cygwin1.dll:     file format pei-i386
>
> Sections:
> Idx Name          Size      VMA       LMA       File off  Algn
>    0 .text         001350d4  61001000  61001000  00000400  2**4
>                    CONTENTS, ALLOC, LOAD, READONLY, CODE, DATA
>    1 .autoload_text 000013d8  61137000  61137000  00135600  2**2
>                    CONTENTS, ALLOC, LOAD, CODE
>    2 .data         0000b51c  61139000  61139000  00136a00  2**4
>                    CONTENTS, ALLOC, LOAD, DATA
>    3 .rdata        0004fb80  61145000  61145000  00142000  2**4
>                    CONTENTS, ALLOC, LOAD, READONLY, DATA
>    4 .bss          00009530  61195000  61195000  00000000  2**4
>                    ALLOC
>    5 .edata        00008487  6119f000  6119f000  00191c00  2**2
>                    CONTENTS, ALLOC, LOAD, READONLY, DATA
>    6 .rsrc         00000420  611a8000  611a8000  0019a200  2**2
>                    CONTENTS, ALLOC, LOAD, DATA
>    7 .reloc        00013434  611a9000  611a9000  0019a800  2**2
>                    CONTENTS, ALLOC, LOAD, READONLY, DATA
>    8 .cygwin_dll_common 00017ae4  611bd000  611bd000  001ade00  2**2
>                    CONTENTS, ALLOC, LOAD, DATA, SHARED
>    9 .gnu_debuglink 00000010  611d5000  611d5000  001c5a00  2**2
>                    CONTENTS, READONLY, DEBUGGING, EXCLUDE
>   10 .idata        0000a000  611d6000  611d6000  001c5c00  2**2
>                    CONTENTS, ALLOC, LOAD, DATA
>   11 .cygheap      000a0000  611e0000  611e0000  00000000  2**2
>                    ALLOC
>
>  >objdump.exe -h cygwin1.dbg
>
> cygwin1.dbg:     file format pei-i386
>
> Sections:
> Idx Name          Size      VMA       LMA       File off  Algn
>    0 .text         001350d4  61001000  61001000  00000000  2**4
>                    ALLOC, LOAD, READONLY, CODE, DATA
>    1 .autoload_text 000013d8  61137000  61137000  00000000  2**2
>                    ALLOC, LOAD, CODE
>    2 .data         0000b51c  61139000  61139000  00000000  2**4
>                    ALLOC, LOAD, DATA
>    3 .rdata        0004fb80  61145000  61145000  00000000  2**4
>                    ALLOC, LOAD, READONLY, DATA
>    4 .bss          00009530  61195000  61195000  00000000  2**4
>                    ALLOC
>    5 .edata        00008487  6119f000  6119f000  00000000  2**2
>                    ALLOC, LOAD, READONLY, DATA
>    6 .rsrc         00000420  611a8000  611a8000  00000000  2**2
>                    ALLOC, LOAD, DATA
>    7 .reloc        00013434  611a9000  611a9000  00000000  2**2
>                    ALLOC, LOAD, READONLY, DATA
>    8 .cygwin_dll_common 00017ae4  611bd000  611bd000  00000000  2**2
>                    ALLOC, LOAD, DATA, SHARED
>    9 .idata        0000a000  611d6000  611d6000  00000000  2**2
>                    ALLOC, LOAD, DATA
>   10 .cygheap      000a0000  611e0000  611e0000  00000000  2**2
>                    ALLOC
>   11 .stab         00212ce8  61280000  61280000  00000380  2**2
>                    CONTENTS, READONLY, DEBUGGING, EXCLUDE
>   12 .stabstr      006b00a6  61493000  61493000  00213180  2**0
>                    CONTENTS, READONLY, DEBUGGING, EXCLUDE
>
> Cheers,
> Pedro Alves
>

>2007-11-07  Pedro Alves  <pedro_alves@portugalmail.pt>
>
>	* dllfixdbg: Pass --only-keep-debug to objcopy, instead of
>	selecting the sections manually.
>
>---
> winsup/cygwin/dllfixdbg |    8 +++-----
> 1 file changed, 3 insertions(+), 5 deletions(-)
>
>Index: src/winsup/cygwin/dllfixdbg
>===================================================================
>--- src.orig/winsup/cygwin/dllfixdbg	2007-11-07 23:44:00.000000000 +0000
>+++ src/winsup/cygwin/dllfixdbg	2007-11-07 23:44:38.000000000 +0000
>@@ -1,5 +1,5 @@
> #!/usr/bin/perl
>-# Copyright 2006 Red Hat, Inc.
>+# Copyright 2006, 2007 Red Hat, Inc.
> #
> # This file is part of Cygwin.
> #
>@@ -16,10 +16,8 @@ my $objdump = shift;
> my @objcopy = ((shift));
> my $dll = shift;
> my $dbg = shift;
>-xit 0, @objcopy, '-j', '.stab', '-j', '.stabstr', '-j', '.debug_aranges',
>-       '-j', '.debug_pubnames', '-j', '.debug_info', '-j', '.debug_abbrev',
>-       '-j', '.debug_line', '-j', '.debug_frame', '-j', '.debug_str', '-j',
>-       '.debug_loc', '-j', '.debug_macinfo', '-j', '.debug_ranges', $dll, $dbg;
>+xit 0, @objcopy, '--only-keep-debug', $dll, $dbg;
>+xit 0, @objcopy, '-R', '.gnu_debuglink_overlay', $dbg;

Is there some reason why you can't just put the '-R' in the previous
objcopy?

cgf



More information about the Cygwin-patches mailing list