public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* [1.7] binutils-2.19.51-1: ld -r bug ?
@ 2009-09-11 22:00 Christian Franke
  2009-09-12  0:48 ` Dave Korn
  0 siblings, 1 reply; 2+ messages in thread
From: Christian Franke @ 2009-09-11 22:00 UTC (permalink / raw)
  To: Cygwin

Testing build of grub 1.97 beta on Cygwin 1.7, I found that the grub 
.mod files are much larger than on 1.5. The modules are build by 'ld -r' 
(and later converted to ELF).

The root of the problem is that the binutils-2.19.51-1 ld behavior 
differs from previous 1.5 binutils. The new ld increases the size of 
each segment by the size of the previous segment. Bug?


Testcase:

$ cat segm.c
void text() { __asm__(".space 104"); }
char       data[256] = "DATA";
const char rdata[16] = "RDATA";

$ gcc -c segm.c


cygwin-1.5:
$ cygcheck -f /bin/ld
binutils-20080624-2

$ ld -r -o segm-r5.o segm.o


cygwin-1.7:
$ cygcheck -f /bin/ld
binutils-2.19.51-1

$ ld -r -o segm-r7.o segm.o


$ size segm.o segm-*.o
   text    data     bss     dec     hex filename
    128     256       0     384     180 segm.o
    128     256       0     384     180 segm-r5.o
    512     384     400    1296     510 segm-r7.o


$ objdump -s segm-r*.o

segm-r5.o:     file format pe-i386

Contents of section .text:
 0000 5589e500 00000000 00000000 00000000  U...............
 ...
 0060 00000000 00000000 0000005d c3909090  ...........]....
Contents of section .data:
 0080 44415441 00000000 00000000 00000000  DATA............
 ...
 0170 00000000 00000000 00000000 00000000  ................
Contents of section .rdata:
 0180 52444154 41000000 00000000 00000000  RDATA...........

segm-r7.o:     file format pe-i386

Contents of section .text:
 0000 5589e500 00000000 00000000 00000000  U...............
 ...
 0060 00000000 00000000 0000005d c3909090  ...........]....
Contents of section .data:
 0000 00000000 00000000 00000000 00000000  ................
 ...
 0080 44415441 00000000 00000000 00000000  DATA............
 ...
 0170 00000000 00000000 00000000 00000000  ................
Contents of section .rdata:
 0000 00000000 00000000 00000000 00000000  ................
 ...
 0180 52444154 41000000 00000000 00000000  RDATA...........


There are no related changes in the builtin linker scripts (ld --verbose 
-r).

Christian


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [1.7] binutils-2.19.51-1: ld -r bug ?
  2009-09-11 22:00 [1.7] binutils-2.19.51-1: ld -r bug ? Christian Franke
@ 2009-09-12  0:48 ` Dave Korn
  0 siblings, 0 replies; 2+ messages in thread
From: Dave Korn @ 2009-09-12  0:48 UTC (permalink / raw)
  To: cygwin

Christian Franke wrote:
> Testing build of grub 1.97 beta on Cygwin 1.7, I found that the grub
> .mod files are much larger than on 1.5. The modules are build by 'ld -r'
> (and later converted to ELF).
> 
> The root of the problem is that the binutils-2.19.51-1 ld behavior
> differs from previous 1.5 binutils. The new ld increases the size of
> each segment by the size of the previous segment. Bug?

  Yes, it looks so.  Thanks for the report, this is now tracked at

http://sourceware.org/bugzilla/show_bug.cgi?id=10634

    cheers,
      DaveK

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-09-12  0:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-11 22:00 [1.7] binutils-2.19.51-1: ld -r bug ? Christian Franke
2009-09-12  0:48 ` Dave Korn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).