[Bug ld/12152] Many 64-bit Solaris/SPARC gcc -gstabs testcases fail to link

2010-10-22 Thread ro at TechFak dot Uni-Bielefeld.DE
http://sourceware.org/bugzilla/show_bug.cgi?id=12152

--- Comment #1 from Rainer Orth  2010-10-22 
10:32:03 UTC ---
Created attachment 5078
  --> http://sourceware.org/bugzilla/attachment.cgi?id=5078
corresponding object file

-- 
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/12152] New: Many 64-bit Solaris/SPARC gcc -gstabs testcases fail to link

2010-10-22 Thread ro at TechFak dot Uni-Bielefeld.DE
http://sourceware.org/bugzilla/show_bug.cgi?id=12152

   Summary: Many 64-bit Solaris/SPARC gcc -gstabs testcases fail
to link
   Product: binutils
   Version: 2.21 (HEAD)
Status: NEW
  Severity: normal
  Priority: P2
 Component: ld
AssignedTo: unassig...@sources.redhat.com
ReportedBy: r...@techfak.uni-bielefeld.de
  Host: sparc-sun-solaris2.10
Target: sparc-sun-solaris2.10
 Build: sparc-sun-solaris2.10


Created attachment 5077
  --> http://sourceware.org/bugzilla/attachment.cgi?id=5077
assembler output for testcase

When comparing GCC mainline testsuite results on Solaris 10/SPARC with either
Sun
ld or mainline GNU ld (2.20.51.20101021), many (all) 64-bit -gstabs* testcases
fail to link:

spawn /var/gcc/regression/trunk/10-gcc-gas-gld-cvs/build/gcc/xgcc
-B/var/gcc/regression/trunk/10-gcc-gas-gld-cvs/build/gcc/
/vol/gcc/src/hg/trunk/local/gcc/testsuite/gcc.dg/debug/20020220-1.c -gstabs1
-lm -m64 -o ./20020220-1.exe

/var/tmp//ccOgZAdZ.o: In function `bar':

/vol/gcc/src/hg/trunk/local/gcc/testsuite/gcc.dg/debug/20020220-1.c:19:
relocation truncated to fit: R_SPARC_UA32 against `.text'

/vol/gcc/src/hg/trunk/local/gcc/testsuite/gcc.dg/debug/20020220-1.c:23:
relocation truncated to fit: R_SPARC_UA32 against symbol `foo' defined in .text
section in /var/tmp//ccOgZAdZ.o

/vol/gcc/src/hg/trunk/local/gcc/testsuite/gcc.dg/debug/20020220-1.c:24:
relocation truncated to fit: R_SPARC_UA32 against symbol `bar' defined in .text
section in /var/tmp//ccOgZAdZ.o

/var/tmp//ccOgZAdZ.o: In function `main':

/vol/gcc/src/hg/trunk/local/gcc/testsuite/gcc.dg/debug/20020220-1.c:29:
relocation truncated to fit: R_SPARC_UA32 against symbol `main' defined in
.text section in /var/tmp//ccOgZAdZ.o

/vol/gcc/src/hg/trunk/local/gcc/testsuite/gcc.dg/debug/20020220-1.c:31:
relocation truncated to fit: R_SPARC_UA32 against `.text'

collect2: ld returned 1 exit status


Linking the same object file with Sun ld instead just works.

$ gld-2.20.51 -V -m elf64_sparc_sol2 -Y P,/usr/lib/sparcv9 -rpath-link
/usr/lib/sparcv9 -Qy -o ./20020220-1.exe
/var/gcc/regression/trunk/10-gcc-gas-gld-cvs/build/gcc/sparcv9/crt1.o
/var/gcc/regression/trunk/10-gcc-gas-gld-cvs/build/gcc/sparcv9/crti.o
/usr/ccs/lib/sparcv9/values-Xa.o
/var/gcc/regression/trunk/10-gcc-gas-gld-cvs/build/gcc/sparcv9/crtbegin.o
-L/var/gcc/regression/trunk/10-gcc-gas-gld-cvs/build/gcc/sparcv9
-L/usr/ccs/lib/sparcv9 -L/lib/sparcv9 -L/usr/lib/sparcv9
-L/var/gcc/regression/trunk/10-gcc-gas-gld-cvs/build/gcc -L/usr/ccs/lib
20020220-1.o -lm -lgcc -lgcc_eh -lc -lgcc -lgcc_eh -lc
/var/gcc/regression/trunk/10-gcc-gas-gld-cvs/build/gcc/sparcv9/crtend.o
/var/gcc/regression/trunk/10-gcc-gas-gld-cvs/build/gcc/sparcv9/crtn.o
GNU ld (GNU Binutils) 2.20.51.20101021
  Supported emulations:
   elf32_sparc_sol2
   elf32_sparc
   elf64_sparc_sol2
   elf64_sparc
20020220-1.o: In function `bar':
/vol/gcc/src/hg/trunk/local/gcc/testsuite/gcc.dg/debug/20020220-1.c:19:
relocation truncated to fit: R_SPARC_UA32 against `.text'
/vol/gcc/src/hg/trunk/local/gcc/testsuite/gcc.dg/debug/20020220-1.c:23:
relocation truncated to fit: R_SPARC_UA32 against symbol `foo' defined in .text
section in 20020220-1.o
/vol/gcc/src/hg/trunk/local/gcc/testsuite/gcc.dg/debug/20020220-1.c:24:
relocation truncated to fit: R_SPARC_UA32 against symbol `bar' defined in .text
section in 20020220-1.o
20020220-1.o: In function `main':
/vol/gcc/src/hg/trunk/local/gcc/testsuite/gcc.dg/debug/20020220-1.c:29:
relocation truncated to fit: R_SPARC_UA32 against symbol `main' defined in
.text section in 20020220-1.o
/vol/gcc/src/hg/trunk/local/gcc/testsuite/gcc.dg/debug/20020220-1.c:31:
relocation truncated to fit: R_SPARC_UA32 against `.text'
$ ld -V -Y P,/usr/lib/sparcv9 -R /usr/lib/sparcv9 -Qy -o ./20020220-1.exe
/var/gcc/regression/trunk/10-gcc-gas-gld-cvs/build/gcc/sparcv9/crt1.o
/var/gcc/regression/trunk/10-gcc-gas-gld-cvs/build/gcc/sparcv9/crti.o
/usr/ccs/lib/sparcv9/values-Xa.o
/var/gcc/regression/trunk/10-gcc-gas-gld-cvs/build/gcc/sparcv9/crtbegin.o
-L/var/gcc/regression/trunk/10-gcc-gas-gld-cvs/build/gcc/sparcv9
-L/usr/ccs/lib/sparcv9 -L/lib/sparcv9 -L/usr/lib/sparcv9
-L/var/gcc/regression/trunk/10-gcc-gas-gld-cvs/build/gcc -L/usr/ccs/lib
20020220-1.o -lm -lgcc -lgcc_eh -lc -lgcc -lgcc_eh -lc
/var/gcc/regression/trunk/10-gcc-gas-gld-cvs/build/gcc/sparcv9/crtend.o
/var/gcc/regression/trunk/10-gcc-gas-gld-cvs/build/gcc/sparcv9/crtn.o
ld: Software Generation Utilities - Solaris Link Editors: 5.10-1.497

I'm attaching the .s and .o files for investigation.

-- 
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 gas/12049] Unnecessary relaxation

2010-10-22 Thread rafael.espindola at gmail dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=12049

--- Comment #9 from Rafael Ávila de Espíndola  2010-10-22 18:42:02 UTC ---
The current binutils now gets the two previous tests right (thanks!), but it is
still missing some cases. With the new testcase it encodes a je as

0f 84 02 00 00 00

That can be also encoded as

74 06

-- 
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 gas/12049] Unnecessary relaxation

2010-10-22 Thread rafael.espindola at gmail dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=12049

Rafael Ávila de Espíndola  changed:

   What|Removed |Added

   Attachment #5024|0   |1
is obsolete||
   Attachment #5025|0   |1
is obsolete||

--- Comment #10 from Rafael Ávila de Espíndola  2010-10-22 18:42:43 UTC ---
Created attachment 5079
  --> http://sourceware.org/bugzilla/attachment.cgi?id=5079
New test that still fails.

-- 
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 gas/12049] Unnecessary relaxation

2010-10-22 Thread rafael.espindola at gmail dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=12049

Rafael Ávila de Espíndola  changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
 Resolution|FIXED   |

--- Comment #11 from Rafael Ávila de Espíndola  2010-10-22 18:43:41 UTC ---
Reopening as the new test still fails.

-- 
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 gas/12049] Unnecessary relaxation

2010-10-22 Thread hjl.tools at gmail dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=12049

H.J. Lu  changed:

   What|Removed |Added

 Status|REOPENED|RESOLVED
 Resolution||FIXED

--- Comment #8 from H.J. Lu  2010-10-22 18:38:59 
UTC ---
Fixed by

http://sourceware.org/ml/binutils-cvs/2010-10/msg00108.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 gas/12049] Unnecessary relaxation

2010-10-22 Thread hjl.tools at gmail dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=12049

H.J. Lu  changed:

   What|Removed |Added

   Attachment #5080|application/octet-stream|text/plain
  mime type||

-- 
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 gas/12049] Unnecessary relaxation

2010-10-22 Thread hjl.tools at gmail dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=12049

H.J. Lu  changed:

   What|Removed |Added

 Status|REOPENED|WAITING

--- Comment #12 from H.J. Lu  2010-10-22 19:13:15 
UTC ---
(In reply to comment #10)
> Created attachment 5079 [details]
> New test that still fails.

This is identical to the testcase in comment 5. Did you
upload the wrong testcase?

-- 
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 gas/12049] Unnecessary relaxation

2010-10-22 Thread rafael.espindola at gmail dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=12049

Rafael Ávila de Espíndola  changed:

   What|Removed |Added

   Attachment #5079|0   |1
is obsolete||

--- Comment #13 from Rafael Ávila de Espíndola  2010-10-22 19:24:18 UTC ---
Created attachment 5080
  --> http://sourceware.org/bugzilla/attachment.cgi?id=5080
The new testcase.

Attached the wrong test previously.

-- 
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 gas/12049] Unnecessary relaxation

2010-10-22 Thread hjl.tools at gmail dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=12049

H.J. Lu  changed:

   What|Removed |Added

   Attachment #5079|application/octet-stream|text/plain
  mime type||

-- 
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 gas/12049] Unnecessary relaxation

2010-10-22 Thread rafael.espindola at gmail dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=12049

--- Comment #15 from Rafael Ávila de Espíndola  2010-10-22 19:37:20 UTC ---
The last "je" is the one that fits in 8 bits:

je.LBB1_17
.align16, 0x90
.LBB1_17:

-- 
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 gas/12049] Unnecessary relaxation

2010-10-22 Thread hjl.tools at gmail dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=12049

H.J. Lu  changed:

   What|Removed |Added

 Status|WAITING |NEW

--- Comment #16 from H.J. Lu  2010-10-22 19:45:48 
UTC ---
(In reply to comment #15)
> The last "je" is the one that fits in 8 bits:
> 
> je.LBB1_17
> .align16, 0x90
> .LBB1_17:

My fix at:

http://sourceware.org/ml/binutils/2010-10/msg00281.html

handles this case correctly :-).

-- 
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 gas/12049] Unnecessary relaxation

2010-10-22 Thread hjl.tools at gmail dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=12049

--- Comment #14 from H.J. Lu  2010-10-22 19:33:46 
UTC ---
(In reply to comment #13)
> Created attachment 5080 [details]
> The new testcase.
> 
> Attached the wrong test previously.

Please tell me which branchs should have 8bit displacement.

-- 
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 gold/10708] "out of file descriptors and couldn't close any" -- probably fd leak

2010-10-22 Thread ccoutant at google dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=10708

Cary Coutant  changed:

   What|Removed |Added

 CC||ccoutant at google dot 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 gold/10708] "out of file descriptors and couldn't close any" -- probably fd leak

2010-10-22 Thread ccoutant at google dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=10708

--- Comment #9 from Cary Coutant  2010-10-23 
01:05:41 UTC ---
I've been trying to track down possible sources of file descriptor leakage.
I've found one:

In copy_relocs.cc, Copy_relocs::emit_copy_reloc():

  typename elfcpp::Elf_types::Elf_WXword addralign =
sym->object()->section_addralign(shndx);

This, and probably other similar places where we go back to an ELF file for
some info, seems to be leaking file descriptors. The call to
section_addralign() creates an Object::View, and reopens the file descriptor,
but never releases it. Also, at least in this particular case, we're accessing
a different file from the one we currently have locked (the shared library that
contains the definition of the symbol), and we haven't locked the file. If we
had locked the file here, the descriptor would have been released, but I'm not
sure it's safe to lock the shared library at this point -- we're in a
Scan_relocs task, which isn't necessarily single threaded.

I'm wondering whether it would be better to just find and eradicate places
where we need to read a file outside of the times we normally have the file
open.

I have no idea whether this is the cause of the problem reported here, but a
good way to tell is if you can rerun the link with -Wl,--debug=task. That would
give us an idea of where it is when you finally run out of file descriptors.
For this leakage to cause real problems, you'll need lots of shared libraries,
and COPY relocations into lots of them. It seems unlikely, but it's worth a
shot. It's also possible that there are other leakages similar to this that
would trigger under different conditions.

-cary

-- 
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/12030] assertion fail linker.c:2678

2010-10-22 Thread davek at gcc dot gnu.org
http://sourceware.org/bugzilla/show_bug.cgi?id=12030

Dave Korn  changed:

   What|Removed |Added

 CC||davek 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