[Bug binutils/12658] ld: potential infinite loop and memory leaks when link many object files

2011-04-13 Thread cvs-commit at gcc dot gnu.org
http://sourceware.org/bugzilla/show_bug.cgi?id=12658

--- Comment #9 from cvs-commit at gcc dot gnu.org  2011-04-13 12:53:39 UTC ---
CVSROOT:/cvs/src
Module name:src
Changes by:kti...@sourceware.org2011-04-13 12:53:36

Modified files:
ld : ChangeLog deffile.h deffilep.y pe-dll.c 

Log message:
2011-04-13  Kai Tietz  

PR binutils/12658
* deffile.h (def_file_add_export): Add is_dup argument.
(def_file_add_import): Likewise.
* deffilep.y (are_names_equal): New helper.
(cmp_export_elem): New helper.
(find_export_in_list): Add search routine for exports.
(def_file_add_export): Check for duplicates.
(cmp_import_elem): New helper.
(find_import_in_list): Add search routine for imports.
(def_file_add_import): Check for duplicates.
(def_exports): Handle duplicates.
(def_imports): Likewise.
* pe-dll.c (process_def_file_and_drectve): Likewise.
(pe_implied_import_dll): Likewise.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/ChangeLog.diff?cvsroot=src&r1=1.2310&r2=1.2311
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/deffile.h.diff?cvsroot=src&r1=1.14&r2=1.15
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/deffilep.y.diff?cvsroot=src&r1=1.33&r2=1.34
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/pe-dll.c.diff?cvsroot=src&r1=1.135&r2=1.136

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are on the CC list for the bug.

___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/12669] New: Suspected bug in calculation of gp-relative offsets for ia64 target

2011-04-13 Thread jakub at jermar dot eu
http://sourceware.org/bugzilla/show_bug.cgi?id=12669

   Summary: Suspected bug in calculation of gp-relative offsets
for ia64 target
   Product: binutils
   Version: 2.21
Status: NEW
  Severity: normal
  Priority: P2
 Component: ld
AssignedTo: unassig...@sources.redhat.com
ReportedBy: ja...@jermar.eu


Starting with ld from binutils 2.21, we are observing a change in ld's behavior
when cross-linking HelenOS for ia64-pc-linux-gnu. Instructions that compute the
gp-relative offset like the following:

addl r36 = @ltoff(@fptr(__entry#)), gp

are linked with a large bias which was not previously there. For example:

ld 2.20:

   20246:  40 02 04 00 48 20   addl r36=0,r1

ld 2.21:

   20246:  40 62 07 8c 48 20   addl r36=9068,r1

Note that the only thing which changed is ld, as can be seen in the attached
testcase. The compiler, assembler and linker script remained the same (gcc 4.6
and as 2.21).

The bias is causing the application to crash and the resulting address is
beyond the end of the program's data segment. When linked with 2.20 ld, the
application works as expected. Thus we are suspecting the offset computed by ld
2.21 is wrong. However, we cannot simply rule out a problem in our linker
script either thanks to the complexity of the issue.

I am attaching a testcase which can easily demonstrate the problem provided
that both versions of ld are available (just edit the Makefile). It contains
our libc.a and libsoftint.a plus a dummy .s containing symbol main. Attached is
also the linker script which we use to generate ia64 binaries on HelenOS and a
Makefile. I tried to come up with a smaller testcase, but unfortunately was not
successful. If there is a desire, I can attach also the binaries generated by
the testcase Makefile.

The testcase produces two binaries, testcase-2.20 and testcase-2.21,
corresponding map files and disassembler files. Finally, testcase.diff shows
that the difference is only in instructions like the above.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are on the CC list for the bug.

___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/12669] Suspected bug in calculation of gp-relative offsets for ia64 target

2011-04-13 Thread jakub at jermar dot eu
http://sourceware.org/bugzilla/show_bug.cgi?id=12669

--- Comment #1 from Jakub Jermar  2011-04-13 13:22:46 
UTC ---
Created attachment 5669
  --> http://sourceware.org/bugzilla/attachment.cgi?id=5669
HelenOS testcase showing ld 2.21 computes apparently wrong gp-relative offsets

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are on the CC list for the bug.

___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/12669] Suspected bug in calculation of gp-relative offsets for ia64 target

2011-04-13 Thread sch...@linux-m68k.org
http://sourceware.org/bugzilla/show_bug.cgi?id=12669

--- Comment #2 from Andreas Schwab  2011-04-13 13:55:02 
UTC ---
Note that the linker does not always put gp at the start of the .got section. 
If you want to force a particular gp value you need to define the symbol __gp. 
Otherwise use this symbol to find the actually chosen gp value.  You should
also keep .got, .sdata and .sbss close together.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are on the CC list for the bug.

___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/12658] ld: potential infinite loop and memory leaks when link many object files

2011-04-13 Thread nickc at redhat dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=12658

--- Comment #10 from Nick Clifton  2011-04-13 14:01:37 
UTC ---
Hi Dongsheng,

 Please could you try the latest FSF mainline sources with Kai's patch in them,
and see if this has any affect on your problem ?

Cheers
  Nick

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are on the CC list for the bug.

___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/12669] Suspected bug in calculation of gp-relative offsets for ia64 target

2011-04-13 Thread jakub at jermar dot eu
http://sourceware.org/bugzilla/show_bug.cgi?id=12669

--- Comment #3 from Jakub Jermar  2011-04-13 14:16:02 
UTC ---
(In reply to comment #2)
> Note that the linker does not always put gp at the start of the .got section. 
> If you want to force a particular gp value you need to define the symbol 
> __gp. 
> Otherwise use this symbol to find the actually chosen gp value.  You should
> also keep .got, .sdata and .sbss close together.

Interestingly, defining and using __gp instead of _gp seems to fix the problem
for us. Thanks! Btw, is this documented somewhere?

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are on the CC list for the bug.

___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/12669] Suspected bug in calculation of gp-relative offsets for ia64 target

2011-04-13 Thread sch...@linux-m68k.org
http://sourceware.org/bugzilla/show_bug.cgi?id=12669

Andreas Schwab  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||INVALID

--- Comment #4 from Andreas Schwab  2011-04-13 14:28:20 
UTC ---
You can always use @gprel to compute the offset to the gp value, see
.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are on the CC list for the bug.

___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/12658] ld: potential infinite loop and memory leaks when link many object files

2011-04-13 Thread dongsheng.song at gmail dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=12658

--- Comment #11 from Dongsheng Song  
2011-04-13 14:53:22 UTC ---
(In reply to comment #10)
> Hi Dongsheng,
> 
>  Please could you try the latest FSF mainline sources with Kai's patch in 
> them,
> and see if this has any affect on your problem ?
> 
> Cheers
>   Nick

In 32bit Linux, still out of memory:

/home/dongsheng/gcc-4.6-windows-linux/lib/gcc/i686-w64-mingw32/4.6.1/../../../../i686-w64-mingw32/bin/ld:
out of memory allocating 82956108 bytes after a total of 2268610560 bytes
collect2: ld returned 1 exit status
make: *** [/home/dongsheng/tmp/wx/lib/wxmsw28u_gcc.dll] Error 1

  PID USER  PR  NI  VIRT  RES  SHR S %CPU %MEMTIME+  COMMAND
 4039 oracle20   0 3024m 2.9g  724 R  100 89.6  18:50.58 ld

VmPeak:  3097084 kB
VmSize:  3097084 kB
VmLck: 0 kB
VmHWM:   3041600 kB
VmRSS:   3022700 kB
VmData:  3094432 kB
VmStk:   100 kB
VmExe:  1036 kB
VmLib:  1472 kB
VmPTE:  3036 kB

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are on the CC list for the bug.

___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/12672] New: LTO on powerpc will not work with static libraries

2011-04-13 Thread meissner at gcc dot gnu.org
http://sourceware.org/bugzilla/show_bug.cgi?id=12672

   Summary: LTO on powerpc will not work with static libraries
   Product: binutils
   Version: 2.22 (HEAD)
Status: NEW
  Severity: critical
  Priority: P2
 Component: ld
AssignedTo: unassig...@sources.redhat.com
ReportedBy: meiss...@gcc.gnu.org


Created attachment 5670
  --> http://sourceware.org/bugzilla/attachment.cgi?id=5670
Tar file to show the problem

I built binutils for powerpc64-linux that was the top of the tree from April
12th, adding the --enable-plugins

I then built a GCC compiler that was top of the tree from April 13ths, using
that binutils for the target assembler, linker, etc.  I added the options:
--with-plugin-ld= --enable-plugin and --enable-lto to enable LTO.

I then tried a case where I was enabling vectorization of the math functions on
power7 with -ffast-math -mcpu=power7 -mveclibabi=mass, and I get undefined
errors (the MASS library is only available as static archives).  If I extract
the objects and put them on the link line manually, it works fine.  If I create
a shared library with these objects and use that, it also works.  However, if I
use a static library, I get undefined errors.

I built a sample test case to try this out that is the attachment.  In this
case, when linking test-lto1-static, I get:

-igoo-> make clean; make CC=/home/meissner/fsf-install-ppc64/trunk/bin/gcc all
rm -f *.[osia] *.so *.so.1 test-lto1-shared test-lto1-static all
/home/meissner/fsf-install-ppc64/trunk/bin/gcc -O3 -mcpu=power7
-mveclibabi=mass -ffast-math -flto -fwhole-program -fuse-linker-plugin -c
test-lto1-a.c
/home/meissner/fsf-install-ppc64/trunk/bin/gcc -O3 -mcpu=power7
-mveclibabi=mass -ffast-math -flto -fwhole-program -fuse-linker-plugin -c
test-lto1-b.c
/home/meissner/fsf-install-ppc64/trunk/bin/gcc -O3 -mcpu=power7
-mveclibabi=mass -ffast-math -flto -fwhole-program -fuse-linker-plugin -fpic -c
test-lto1-c.c
rm -f liblto1-shared.so.1
/home/meissner/fsf-install-ppc64/trunk/bin/gcc -shared -o liblto1-shared.so.1
-Wl,-soname,liblto1-shared.so.1 test-lto1-c.o
rm -f liblto1-shared.so
ln -s liblto1-shared.so.1 liblto1-shared.so
/home/meissner/fsf-install-ppc64/trunk/bin/gcc -o test-lto1-shared -O3
-mcpu=power7 -mveclibabi=mass -ffast-math -flto -fwhole-program
-fuse-linker-plugin  test-lto1-a.o test-lto1-b.o -L . -Wl,-rpath,$(pwd)
-llto1-shared -lm
rm -f liblto1-static.a
ar cq liblto1-static.a test-lto1-c.o
ranlib liblto1-static.a
/home/meissner/fsf-install-ppc64/trunk/bin/gcc -o test-lto1-static -O3
-mcpu=power7 -mveclibabi=mass -ffast-math -flto -fwhole-program
-fuse-linker-plugin  test-lto1-a.o test-lto1-b.o -L . -llto1-static -lm
/tmp/ccLckNND.ltrans0.ltrans.o:(.text.startup+0xc4): undefined reference to
`sind2'
collect2: ld returned 1 exit status
make: *** [test-lto1-static] Error 1

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are on the CC list for the bug.

___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/12672] LTO on powerpc will not work with static libraries

2011-04-13 Thread bergner at vnet dot ibm.com
http://sourceware.org/bugzilla/show_bug.cgi?id=12672

Peter Bergner  changed:

   What|Removed |Added

 CC||bergner at vnet dot ibm.com

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are on the CC list for the bug.

___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/12672] LTO on powerpc will not work with static libraries

2011-04-13 Thread meissner at gcc dot gnu.org
http://sourceware.org/bugzilla/show_bug.cgi?id=12672

--- Comment #1 from Michael Meissner  2011-04-13 
21:25:10 UTC ---
Ian Taylor has said that gold fixes this problem.  Unfortunately, gold does not
work for powerpc64-linux.

http://sourceware.org/ml/binutils/2011-01/msg00270.html

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are on the CC list for the bug.

___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/12672] LTO on powerpc will not work with static libraries

2011-04-13 Thread meissner at gcc dot gnu.org
http://sourceware.org/bugzilla/show_bug.cgi?id=12672

Michael Meissner  changed:

   What|Removed |Added

 CC||meissner at gcc dot gnu.org

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are on the CC list for the bug.

___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/12658] ld: potential infinite loop and memory leaks when link many object files

2011-04-13 Thread dongsheng.song at gmail dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=12658

--- Comment #12 from Dongsheng Song  
2011-04-14 01:32:17 UTC ---
(In reply to comment #11)
> (In reply to comment #10)
> > Hi Dongsheng,
> > 
> >  Please could you try the latest FSF mainline sources with Kai's patch in 
> > them,
> > and see if this has any affect on your problem ?
> > 
> > Cheers
> >   Nick
> 
> In 32bit Linux, still out of memory:

It seems that Kai's patch save about 300M+ memory on 64 bit Linux box (My new
Scientific Linux 6 VM, 1G physical memory).

But it seems that still do a infinite loop:

  PID USER  PR  NI  VIRT  RES  SHR S %CPU %MEMTIME+  DATA COMMAND
15602 dongshen  20   0 4246m 768m  144 D  4.3 77.0  47:49.43 4.1g ld

VmPeak:  4348140 kB
VmSize:  4348140 kB
VmLck: 0 kB
VmHWM:892440 kB
VmRSS:787316 kB
VmData:  4341348 kB
VmStk:   100 kB
VmExe:   928 kB
VmLib:  1620 kB
VmPTE:  8508 kB
VmSwap:  3554152 kB

# pmap -d 15602
15602:  
/home/dongsheng/gcc-4.6-windows-linux/lib/gcc/i686-w64-mingw32/4.6.1/../../../../i686-w64-mingw32/bin/ld
--sysroot=/home/dongsheng/gcc-4.6-windows-linux -m i386pe --shared -Bstatic -e
_DllMainCRTStartup@12 --enable-auto-image-base -o
/home/dongsheng/tmp/wx/lib/wxmsw28u_gcc.dll -s -s
/home/dongsheng/gcc-4.6-windows-linux/lib/gcc/i686-w64-mingw32/4.6.1/../../../../i686-w64-mingw32/lib/../lib/dllcrt2.o
/home/dongsheng/gcc-4.6-windows-linux/lib/gcc/i686-w64-mingw32/4.6.1/crtbegin.o
-L/home/dongsheng/tmp/wx/lib
Address   Kbytes Mode  Offset   DeviceMapping
0040 928 r-x--  0fd:0 ld
006e7000  12 rw--- 000e7000 0fd:0 ld
006ea000  20 rw---  000:0   [ anon ]
00801000 3494196 rw---  000:0   [ anon ]
7f016d2650001052 rw---  000:0   [ anon ]
7f016d38c000  835028 rw---  000:0   [ anon ]
7f01a03020001832 rw---  000:0   [ anon ]
7f01a04cd0001816 rw---  000:0   [ anon ]
7f01a06940001848 rw---  000:0   [ anon ]
7f01a08630001848 rw---  000:0   [ anon ]
7f01a0a320001908 rw---  000:0   [ anon ]
7f01a0c1 420 rw---  000:0   [ anon ]
7f01a0c790001492 r-x--  0fd:0 libc-2.12.so
7f01a0dee0002048 - 00175000 0fd:0 libc-2.12.so
7f01a0fee000  16 r 00175000 0fd:0 libc-2.12.so
7f01a0ff2000   4 rw--- 00179000 0fd:0 libc-2.12.so
7f01a0ff3000  20 rw---  000:0   [ anon ]
7f01a0ff8000   8 r-x--  0fd:0 libdl-2.12.so
7f01a0ffa0002048 - 2000 0fd:0 libdl-2.12.so
7f01a11fa000   4 r 2000 0fd:0 libdl-2.12.so
7f01a11fb000   4 rw--- 3000 0fd:0 libdl-2.12.so
7f01a11fc000 120 r-x--  0fd:0 ld-2.12.so
7f01a1225000  20 rw---  000:0   [ anon ]
7f01a126a0001724 rw---  000:0   [ anon ]
7f01a1419000   4 rw---  000:0   [ anon ]
7f01a141a000   4 r 0001e000 0fd:0 ld-2.12.so
7f01a141b000   4 rw--- 0001f000 0fd:0 ld-2.12.so
7f01a141c000   4 rw---  000:0   [ anon ]
7fffc12ad000  96 rw---  000:0   [ stack ]
7fffc13c4000   4 r-x--  000:0   [ anon ]
ff60   4 r-x--  000:0   [ anon ]
mapped: 4348536Kwriteable/private: 4341860Kshared: 0K

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are on the CC list for the bug.

___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/12658] ld: potential infinite loop and memory leaks when link many object files

2011-04-13 Thread dongsheng.song at gmail dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=12658

--- Comment #13 from Dongsheng Song  
2011-04-14 02:04:40 UTC ---
Here is the stack trace (After ld running 8 minutes, use 1.4GB memory):

# gdb /home/dongsheng/gcc-4.6-windows-linux/i686-w64-mingw32/bin/ld 28412
GNU gdb (GDB) Red Hat Enterprise Linux (7.1-29.el6)
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
...
Reading symbols from
/home/dongsheng/gcc-4.6-windows-linux/i686-w64-mingw32/bin/ld...done.
Attaching to program:
/home/dongsheng/gcc-4.6-windows-linux/i686-w64-mingw32/bin/ld, process 28412
Reading symbols from /lib64/libdl.so.2...(no debugging symbols found)...done.
Loaded symbols for /lib64/libdl.so.2
Reading symbols from /lib64/libc.so.6...(no debugging symbols found)...done.
Loaded symbols for /lib64/libc.so.6
Reading symbols from /lib64/ld-linux-x86-64.so.2...(no debugging symbols
found)...done.
Loaded symbols for /lib64/ld-linux-x86-64.so.2
_bfd_pei_swap_sym_in (abfd=0x4c5eda20, ext1=0x5474af34, in1=0x7fff02619200) at
peigen.c:115
115 in->n_type = H_GET_16 (abfd, ext->e_type);
Missing separate debuginfos, use: debuginfo-install
glibc-2.12-1.7.el6_0.5.x86_64
(gdb) bt
#0  _bfd_pei_swap_sym_in (abfd=0x4c5eda20, ext1=0x5474af34, in1=0x7fff02619200)
at peigen.c:115
#1  0x00446106 in handle_COMDAT (abfd=0x4c5eda20, hdr=, name=,
section=0x55422a28, flags_ptr=0x7fff02619ebc) at
/home/dongsheng/vcs/git/binutils/bfd/coffcode.h:897
#2  styp_to_sec_flags (abfd=0x4c5eda20, hdr=, name=, section=0x55422a28,
flags_ptr=0x7fff02619ebc) at
/home/dongsheng/vcs/git/binutils/bfd/coffcode.h:1253
#3  0x00431c0a in make_a_section_from_file (abfd=0x4c5eda20) at
/home/dongsheng/vcs/git/binutils/bfd/coffgen.c:132
#4  coff_real_object_p (abfd=0x4c5eda20) at
/home/dongsheng/vcs/git/binutils/bfd/coffgen.c:222
#5  coff_object_p (abfd=0x4c5eda20) at
/home/dongsheng/vcs/git/binutils/bfd/coffgen.c:301
#6  0x004320ce in bfd_check_format_matches (abfd=0x4c5eda20,
format=, matching=0x0)
at /home/dongsheng/vcs/git/binutils/bfd/format.c:211
#7  0x0041b9df in ldfile_try_open_bfd (attempt=0x7fff0261c97b
"monodll_msw_notebook.o", entry=0x160ea90)
at /home/dongsheng/vcs/git/binutils/ld/ldfile.c:178
#8  0x0041c10c in ldfile_open_file (entry=0x160ea90) at
/home/dongsheng/vcs/git/binutils/ld/ldfile.c:443
#9  0x00410465 in load_symbols (entry=0x160ea90, place=0x7fff0261a040)
at /home/dongsheng/vcs/git/binutils/ld/ldlang.c:2678
#10 0x00410e52 in open_input_bfds (s=0x160ea90, force=0) at
/home/dongsheng/vcs/git/binutils/ld/ldlang.c:3239
#11 0x0041215a in lang_process () at
/home/dongsheng/vcs/git/binutils/ld/ldlang.c:6471
#12 0x004168e6 in main (argc=536, argv=0x7fff0261a288) at
/home/dongsheng/vcs/git/binutils/ld/ldmain.c:461
(gdb) q
A debugging session is active.

Inferior 1 [process 28412] will be detached.

Quit anyway? (y or n) y
Detaching from program:
/home/dongsheng/gcc-4.6-windows-linux/i686-w64-mingw32/bin/ld, process 28412

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are on the CC list for the bug.

___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/12658] ld: potential infinite loop and memory leaks when link many object files

2011-04-13 Thread dongsheng.song at gmail dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=12658

--- Comment #14 from Dongsheng Song  
2011-04-14 02:37:12 UTC ---
Here is the updated stack trace (After ld running 25 minutes, use 3.6GB
memory):


  PID USER  PR  NI  VIRT  RES  SHR S %CPU %MEMTIME+  DATA COMMAND
28412 dongshen  20   0 3685m 860m  228 D 22.9 86.3  25:03.09 3.6g ld

# gdb /home/dongsheng/gcc-4.6-windows-linux/i686-w64-mingw32/bin/ld 28412
GNU gdb (GDB) Red Hat Enterprise Linux (7.1-29.el6)
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
...
Reading symbols from
/home/dongsheng/gcc-4.6-windows-linux/i686-w64-mingw32/bin/ld...done.
Attaching to program:
/home/dongsheng/gcc-4.6-windows-linux/i686-w64-mingw32/bin/ld, process 28412
Reading symbols from /lib64/libdl.so.2...(no debugging symbols found)...done.
Loaded symbols for /lib64/libdl.so.2
Reading symbols from /lib64/libc.so.6...(no debugging symbols found)...done.
Loaded symbols for /lib64/libc.so.6
Reading symbols from /lib64/ld-linux-x86-64.so.2...(no debugging symbols
found)...done.
Loaded symbols for /lib64/ld-linux-x86-64.so.2
0x004092e3 in match_simple_wild (pattern=0x161aa90 ".gnu.lto_*",
name=0xbbcc5538 ".text$_ZNK12wxWindowBase9IsEnabledEv") at
/home/dongsheng/vcs/git/binutils/ld/ldlang.c:368
368   if (pattern[0] != name[0] || pattern[1] != name[1]
Missing separate debuginfos, use: debuginfo-install
glibc-2.12-1.7.el6_0.5.x86_64
(gdb) bt
#0  0x004092e3 in match_simple_wild (pattern=0x161aa90 ".gnu.lto_*",
name=0xbbcc5538 ".text$_ZNK12wxWindowBase9IsEnabledEv") at
/home/dongsheng/vcs/git/binutils/ld/ldlang.c:368
#1  0x0040b2d5 in walk_wild_section_specs1_wild1 (ptr=0x161a7a0,
file=0x1613260,
callback=0x409960 , data=0x0) at
/home/dongsheng/vcs/git/binutils/ld/ldlang.c:591
#2  0x00410a11 in walk_wild (s=0x161a7a0, callback=0x409960
, data=0x0)
at /home/dongsheng/vcs/git/binutils/ld/ldlang.c:908
#3  0x00410b67 in lang_gc_sections_1 (s=0x161a7a0) at
/home/dongsheng/vcs/git/binutils/ld/ldlang.c:6241
#4  0x00410b1d in lang_gc_sections_1 (s=0x1605cb0) at
/home/dongsheng/vcs/git/binutils/ld/ldlang.c:6250
#5  0x00412348 in lang_gc_sections () at
/home/dongsheng/vcs/git/binutils/ld/ldlang.c:6263
#6  lang_process () at /home/dongsheng/vcs/git/binutils/ld/ldlang.c:6549
#7  0x004168e6 in main (argc=536, argv=0x7fff0261a288) at
/home/dongsheng/vcs/git/binutils/ld/ldmain.c:461
(gdb) q
A debugging session is active.

Inferior 1 [process 28412] will be detached.

Quit anyway? (y or n) y
Detaching from program:
/home/dongsheng/gcc-4.6-windows-linux/i686-w64-mingw32/bin/ld, process 28412

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are on the CC list for the bug.

___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/12658] ld: potential infinite loop and memory leaks when link many object files

2011-04-13 Thread dongsheng.song at gmail dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=12658

--- Comment #15 from Dongsheng Song  
2011-04-14 05:14:09 UTC ---
Here is the updated stack trace (After ld running CPU time 36 minutes, use
3.7GB
memory):

  PID USER  PR  NI  VIRT  RES  SHR S %CPU %MEMTIME+  DATA COMMAND
28412 dongshen  20   0 3714m 844m  248 R  7.0 84.7  36:20.98 3.6g ld

VmPeak:  3803368 kB
VmSize:  3803368 kB
VmLck: 0 kB
VmHWM:892824 kB
VmRSS:860116 kB
VmData:  3796576 kB
VmStk:   100 kB
VmExe:   928 kB
VmLib:  1620 kB
VmPTE:  7448 kB
VmSwap:  2936724 kB

# gdb /home/dongsheng/gcc-4.6-windows-linux/i686-w64-mingw32/bin/ld 28412
GNU gdb (GDB) Red Hat Enterprise Linux (7.1-29.el6)
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
...
Reading symbols from
/home/dongsheng/gcc-4.6-windows-linux/i686-w64-mingw32/bin/ld...done.
Attaching to program:
/home/dongsheng/gcc-4.6-windows-linux/i686-w64-mingw32/bin/ld, process 28412
Reading symbols from /lib64/libdl.so.2...(no debugging symbols found)...done.
Loaded symbols for /lib64/libdl.so.2
Reading symbols from /lib64/libc.so.6...(no debugging symbols found)...done.
Loaded symbols for /lib64/libc.so.6
Reading symbols from /lib64/ld-linux-x86-64.so.2...(no debugging symbols
found)...done.
Loaded symbols for /lib64/ld-linux-x86-64.so.2
0x0040bf93 in compare_section (sort=,
asec=0x52e6b5e8, bsec=0x242e1758)
at /home/dongsheng/vcs/git/binutils/ld/ldlang.c:454
454   ret = strcmp (bfd_get_section_name (asec->owner, asec),
Missing separate debuginfos, use: debuginfo-install
glibc-2.12-1.7.el6_0.5.x86_64
(gdb) bt
#0  0x0040bf93 in compare_section (sort=,
asec=0x52e6b5e8, bsec=0x242e1758)
at /home/dongsheng/vcs/git/binutils/ld/ldlang.c:454
#1  0x0040c0c7 in wild_sort_fast (ptr=0x1618140, sec=0x1618410,
section=0x52e6b5e8, file=,
output=) at
/home/dongsheng/vcs/git/binutils/ld/ldlang.c:499
#2  output_section_callback_fast (ptr=0x1618140, sec=0x1618410,
section=0x52e6b5e8, file=, output=)
at /home/dongsheng/vcs/git/binutils/ld/ldlang.c:531
#3  0x0040b2f0 in walk_wild_section_specs1_wild1 (ptr=0x1618140,
file=0x160e8d0, callback=0x40bff0 ,
data=0x16057e0) at /home/dongsheng/vcs/git/binutils/ld/ldlang.c:594
#4  0x00410a11 in walk_wild (s=0x1618140, callback=0x40bff0
, data=0x16057e0)
at /home/dongsheng/vcs/git/binutils/ld/ldlang.c:908
#5  0x0041208d in wild (s=0x1618140, target=0x0, os=0x16057e0) at
/home/dongsheng/vcs/git/binutils/ld/ldlang.c:2835
#6  map_input_to_output_sections (s=0x1618140, target=0x0, os=0x16057e0) at
/home/dongsheng/vcs/git/binutils/ld/ldlang.c:3533
#7  0x00412057 in map_input_to_output_sections (s=0x16057e0,
target=0x0, os=0x0) at /home/dongsheng/vcs/git/binutils/ld/ldlang.c:3555
#8  0x00412451 in lang_process () at
/home/dongsheng/vcs/git/binutils/ld/ldlang.c:6560
#9  0x004168e6 in main (argc=536, argv=0x7fff0261a288) at
/home/dongsheng/vcs/git/binutils/ld/ldmain.c:461
(gdb) q
A debugging session is active.

Inferior 1 [process 28412] will be detached.

Quit anyway? (y or n) y
Detaching from program:
/home/dongsheng/gcc-4.6-windows-linux/i686-w64-mingw32/bin/ld, process 28412

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are on the CC list for the bug.

___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils