[Bug ld/13250] New: unresolvable R_X86_64_64 relocations with ld --as-needed

2011-10-04 Thread doko at debian dot org
http://sourceware.org/bugzilla/show_bug.cgi?id=13250

 Bug #: 13250
   Summary: unresolvable R_X86_64_64 relocations with ld
--as-needed
   Product: binutils
   Version: 2.22
Status: NEW
  Severity: normal
  Priority: P2
 Component: ld
AssignedTo: unassig...@sourceware.org
ReportedBy: d...@debian.org
Classification: Unclassified


fails on the 2.22 branch and trunk, works with ld.gold on both the branch and
the trunk.

$ cat mpitest.f90
program main
include 'mpif.h'
integer ierr
call mpi_init(ierr)
end
$ mpif90 -Wl,--as-needed -g mpitest.f90 
/usr/bin/ld: /tmp/cc9rtjMR.o(.debug_info+0x493): unresolvable R_X86_64_64
relocation against symbol `mpi_fortran_argv_null_'
/usr/bin/ld: /tmp/cc9rtjMR.o(.debug_info+0x4ad): unresolvable R_X86_64_64
relocation against symbol `mpi_fortran_argv_null_'
/usr/bin/ld: /tmp/cc9rtjMR.o(.debug_info+0x523): unresolvable R_X86_64_64
relocation against symbol `mpi_fortran_errcodes_ignore_'
/usr/bin/ld: /tmp/cc9rtjMR.o(.debug_info+0x53d): unresolvable R_X86_64_64
relocation against symbol `mpi_fortran_errcodes_ignore_'

The undefined references to `__libc_csu_(init|fini)' are an artefact in the
self-contained 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
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/13250] unresolvable R_X86_64_64 relocations with ld --as-needed

2011-10-04 Thread doko at debian dot org
http://sourceware.org/bugzilla/show_bug.cgi?id=13250

--- Comment #1 from Matthias Klose doko at debian dot org 2011-10-04 08:58:59 
UTC ---
self-contained test case at
http://people.debian.org/~doko/tmp/mpi.tar.xz

-- 
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
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gold/13245] PREVAILING_DEF reported too often.

2011-10-04 Thread hubicka at ucw dot cz
http://sourceware.org/bugzilla/show_bug.cgi?id=13245

--- Comment #10 from hubicka at ucw dot cz 2011-10-04 09:17:43 UTC ---
 http://sourceware.org/bugzilla/show_bug.cgi?id=13245
 
 --- Comment #9 from Cary Coutant ccoutant at google dot com 2011-10-03 
 21:50:21 UTC ---
  Here the function test is comdat both in libt.so and t2.so. 
  In t2.so we would like to make it static because doing so improves dynamic
  linking time (i.e. the function in question don't need to be resolved at 
  all).
  We can't want to do that in libt.so because that one is not LTOed.
  
  This would happen if linker returned PREVAILING_DEF_IRONLY_EXP for _Z4testv
  instead of PREVAILING_DEF.  I think this is consistent with documentation 
  of it
  - i.e. symbol is IRONLY within current DSO but exported. It does not matter
  much whether we know if libt.so will bind to it or not.
 
 So do you want the linker to ignore references from shared objects completely,
 or only if the reference is a (pre-empted) definition? I could make the former
 happen with the following patch:

Hi,
I am by far not confident in this area, but I personally don't see much
difference for
compiler to know whether the symbol will be bound by dynamic linker to other
DSO or
may be bound.  So I guess ignoring symbols from shared libraries should work
well,
since they will all end up PREVAILING_DEF_IRONLY_EXP.

Note that while looking at differences in resolution files in between gold and
GNU LD I noticed that gold reports some symbols as UNDEF that are PREEMPTED_DYN
for GNU LD.  It is harmless, because internally GCC handles both prety much
equally, but it seems wrong?

Honza

-- 
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
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gold/13245] PREVAILING_DEF reported too often.

2011-10-04 Thread rguenther at suse dot de
http://sourceware.org/bugzilla/show_bug.cgi?id=13245

--- Comment #11 from rguenther at suse dot de 2011-10-04 09:24:22 UTC ---
On Sun, 2 Oct 2011, Jan Hubicka wrote:

  
  Yes, it does solve the problem here (I have 8GB of RAM and used a
  large swapfile on my SSD. It took ~10 minutes to output all ltrans.o 
  files).
 
 I am surprised it converge with 8GB of RAM at all...
 
  
  -fprofile-generate should set -fno-lto automatically IMHO.
 
 I suggested this at one point and richi didn't like it, forgot why.
 
 Thanks for looking into this! It is good to know this is the last bug WRT 
 LTO linking of Mozilla ;)

Well, it sounded like a hack.  I'd rather have a way to force LTO
profiling at least.

Richard.

-- 
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
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gold/13245] PREVAILING_DEF reported too often.

2011-10-04 Thread hubicka at ucw dot cz
http://sourceware.org/bugzilla/show_bug.cgi?id=13245

--- Comment #12 from hubicka at ucw dot cz 2011-10-04 09:41:40 UTC ---
 http://sourceware.org/bugzilla/show_bug.cgi?id=13245
 
 --- Comment #11 from rguenther at suse dot de 2011-10-04 09:24:22 UTC ---
 On Sun, 2 Oct 2011, Jan Hubicka wrote:
 
   
   Yes, it does solve the problem here (I have 8GB of RAM and used a
   large swapfile on my SSD. It took ~10 minutes to output all ltrans.o 
   files).
  
  I am surprised it converge with 8GB of RAM at all...
  
   
   -fprofile-generate should set -fno-lto automatically IMHO.
  
  I suggested this at one point and richi didn't like it, forgot why.
  
  Thanks for looking into this! It is good to know this is the last bug WRT 
  LTO linking of Mozilla ;)
 
 Well, it sounded like a hack.  I'd rather have a way to force LTO
 profiling at least.

Instrumentation at linktime is in my longer term TODO, but it will be fun - we
will need to pickle
CFG at compile time and with -fprofile-generate decide on placement of
instrumentation at WPA time
making the actual modifications at ltrans time.
It is not that hard to do, but needs some work - i.e. cleanup what gcov has
already, because gcov
has pretty much all needed, but not readily useable within compiler and not
with the fancier features
like automatic correction.

Also if we get variant of LIPO into mainline, we will be stuck with the
instrumentation at compile time
too.

Honza

-- 
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
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/13252] fails to link statically with '[symbol] referenced in section [...]: defined in discarded section [...]' with g++ (Debian 4.6.1-13) 4.6.1 - with test case hyperlinked

2011-10-04 Thread lkajan at rostlab dot org
http://sourceware.org/bugzilla/show_bug.cgi?id=13252

--- Comment #1 from Laszlo Kajan lkajan at rostlab dot org 2011-10-04 
13:58:25 UTC ---
Please find the test case here (too big to attach):

http://rostlab.org/~lkajan/ld_testcase_for_defined_in_discarded_section_bug.tgz

-- 
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
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/13254] New: -z text warning breaks gcc testsuite on Solaris

2011-10-04 Thread ro at TechFak dot Uni-Bielefeld.DE
http://sourceware.org/bugzilla/show_bug.cgi?id=13254

 Bug #: 13254
   Summary: -z text warning breaks gcc testsuite on Solaris
   Product: binutils
   Version: 2.22
Status: NEW
  Severity: critical
  Priority: P1
 Component: ld
AssignedTo: unassig...@sourceware.org
ReportedBy: r...@techfak.uni-bielefeld.de
CC: amo...@gmail.com
Classification: Unclassified
  Host: *-*-solaris2.*
Target: *-*-solaris2.*
 Build: *-*-solaris2.*


I've just tried mainline gcc with binutils 2.21.90 on Solaris 11/x86.  Two
changes from 2.21.1 cause massive gcc testsuite failures:

FAIL: staticrootslib.lo -O2 (test for excess errors)
Excess errors:
/vol/gcc/bin/gld-2.21.90: warning: -z text ignored.

The warning is new in 2.22.  It was introduced by this change

2011-07-14  Alan Modra  amo...@gmail.com

* emultempl/elf32.em (gld${EMULATION_NAME}_add_options,
gld${EMULATION_NAME}_handle_option, gld${EMULATION_NAME}_list_options):
Provide --build-id, -z defs, -z muldefs, -z max-page-size,
-z common-page-size, -z execstack, -z noexecstack for all targets.
Add help for --exclude-libs.

but is missing from the ChangeLog.  If this warning remains in the released
ld 2.22, that becomes mostly useless on Solaris.  While one might be able to
change gcc itself to not pass -z text if using (recent) gld, other instances
of the option are from libtool and cannot that easily changed.

  Rainer

-- 
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
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/13255] New: Wrong `local symbol is referenced by DSO' warnings on Solaris

2011-10-04 Thread ro at TechFak dot Uni-Bielefeld.DE
http://sourceware.org/bugzilla/show_bug.cgi?id=13255

 Bug #: 13255
   Summary: Wrong `local symbol is referenced by DSO' warnings on
Solaris
   Product: binutils
   Version: 2.22
Status: NEW
  Severity: critical
  Priority: P1
 Component: ld
AssignedTo: unassig...@sourceware.org
ReportedBy: r...@techfak.uni-bielefeld.de
Classification: Unclassified
  Host: i386-pc-solaris2.11
Target: i386-pc-solaris2.11
 Build: i386-pc-solaris2.11


I've just tried gcc mainline with binutils 2.21.90 on Solaris 11/x86.  Apart
from
PR ld/13254, I've got many gcc testsuite failures like the following:

FAIL: gcc.dg/special/gcsec-1.c (test for excess errors)
Excess errors:
/vol/gcc/bin/gld-2.21.90: .
WARNING: gcc.dg/special/gcsec-1.c compilation failed to produce executable

Running test manually yields

 /vol/gcc/obj/gcc-4.7.0-20110930/11-gcc-gas-gld22190/gcc/xgcc 
 -B/vol/gcc/obj/gcc-4.7.0-20110930/11-gcc-gas-gld22190/gcc/ 
 /vol/gcc/src/hg/trunk/solaris/gcc/testsuite/gcc.dg/special/gcsec-1.c 
 -ffunction-sections -fdata-sections -Wl,--gc-sections -lm -o ./gcsec-1.exe
/vol/gcc/bin/gld-2.21.90: ./gcsec-1.exe: local symbol
`__flt_rounds@@SYSVABI_1.3' in /lib/libc.so is referenced by DSO
/vol/gcc/bin/gld-2.21.90: final link failed: Bad value
collect2: error: ld returned 1 exit status

so it seems most of the error message is stripped by the gcc testsuite
framework.

 gld-2.21.90 --eh-frame-hdr -m elf_i386_sol2 -Y P,/usr/ccs/lib:/lib:/usr/lib 
 -Qy -o ./gcsec-1.exe /usr/lib/crt1.o /usr/lib/crti.o /usr/lib/values-Xa.o 
 /vol/gcc/obj/gcc-4.7.0-20110930/11-gcc-gas-gld22190/gcc/crtbegin.o 
 -L/vol/gcc/obj/gcc-4.7.0-20110930/11-gcc-gas-gld22190/gcc gcsec-1.o 
 --gc-sections -lm -lgcc -lgcc_eh -lc -lgcc -lgcc_eh 
 /vol/gcc/obj/gcc-4.7.0-20110930/11-gcc-gas-gld22190/gcc/crtend.o 
 /usr/lib/crtn.o
gld-2.21.90: ./gcsec-1.exe: local symbol `__flt_rounds@@SYSVABI_1.3' in
/lib/libc.so is referenced by DSO
gld-2.21.90: final link failed: Bad value

The main problem is that the error is wrong: __flt_rounds *isn't* a local
symbol:

ro@fuego 185  nm /lib/libc.so|grep __flt_rounds
[8262]  |   1496252| 4|OBJT |GLOB |0|29 |__flt_rounds
[1237]  | 0| 0|FILE |LOCL |0|ABS|__flt_rounds.c

It is referenced in libm.so:

/lib/libm.so: [2411]| 0| 0|OBJT |GLOB |0|UNDEF 
|__flt_rounds
/lib/libc.so: [8262]|   1496252| 4|OBJT |GLOB |0|29
|__flt_rounds
/lib/libc.so: [1237]| 0| 0|FILE |LOCL |0|ABS   
|__flt_rounds.c

Apart from that, even if it were correct, the error message is pretty useless:
which DSO does it reference?

I fear this is a showstopper bug: it renders gld complete useless on Solaris.
I've only tried Solaris 11 so far, but expect that there's no difference on
older releases.

  Rainer

-- 
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
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/13256] New: AR + plugin fails with no operation specified error

2011-10-04 Thread d.g.gorbachev at gmail dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=13256

 Bug #: 13256
   Summary: AR + plugin fails with no operation specified error
   Product: binutils
   Version: 2.23 (HEAD)
Status: NEW
  Severity: normal
  Priority: P2
 Component: binutils
AssignedTo: unassig...@sourceware.org
ReportedBy: d.g.gorbac...@gmail.com
Classification: Unclassified


GNU Binutils 2.22.51.20111004.

$ ar --plugin /path/to/liblto_plugin.so cr libfoo.a foo.o
ar: no operation specified

These commands work as expected:

$ ar cr --plugin /path/to/liblto_plugin.so libfoo.a foo.o
$ ar --plugin /path/to/liblto_plugin.so -cr libfoo.a foo.o

-- 
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
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/13257] New: NM + plugin does not list correctly symbols in thin archives

2011-10-04 Thread d.g.gorbachev at gmail dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=13257

 Bug #: 13257
   Summary: NM + plugin does not list correctly symbols in thin
archives
   Product: binutils
   Version: 2.23 (HEAD)
Status: NEW
  Severity: normal
  Priority: P2
 Component: binutils
AssignedTo: unassig...@sourceware.org
ReportedBy: d.g.gorbac...@gmail.com
Classification: Unclassified


Created attachment 5959
  -- http://sourceware.org/bugzilla/attachment.cgi?id=5959
Testcase

Output:

libthickfat.a:

fat.o:
 T foo

libthickslim.a:

slim.o:
 T foo

libthinfat.a:

fat.o:
0001 C __gnu_lto_v1
 T foo

libthinslim.a:

slim.o:
0001 C __gnu_lto_v1
0001 C __gnu_slim_lto

-- 
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
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/13254] -z text warning breaks gcc testsuite on Solaris

2011-10-04 Thread ian at airs dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=13254

--- Comment #1 from Ian Lance Taylor ian at airs dot com 2011-10-05 00:47:11 
UTC ---
gold supports -z text.  We should just add support to GNU ld.
Basically, if we add a DT_TEXTREL entry, we should give an error if -z
text was used.

-- 
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
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/11539] ld --gc-sections should work for PE-COFF on MinGW

2011-10-04 Thread shinji.igarashi at gmail dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=11539

--- Comment #5 from Shinji Igarashi shinji.igarashi at gmail dot com 
2011-10-05 03:42:15 UTC ---
Created attachment 5960
  -- http://sourceware.org/bugzilla/attachment.cgi?id=5960
Add KEEPs to the linker script template

Very nice. The patch saves me from some boring works splitting source files per
function.

- entry symbol
I think -Wl,-e works and is better than -Wl,--undefined in this case.

For PE-COFF targets, the default entry symbol is used according to the
subsystem,
unless explicitly specified by a command-line or a linker script.
And the code setting the gc root (search gc_sym_list in ldlang.c) ignores the
linker's default.
MinGW-GCC's default specs file gives -e option to the linker only if the
generating file is a DLL, so for now the linker's default is used for EXE
unless you specify the explicit one.

I don't know whether ignoring the default entry symbol makes sense.
Anyway the current manual says --gc-sections requires -Wl,-e or -Wl,-u
or using KEEPs in a linker script to keep sections.

- .rsrc section
Default linker scripts(generated from pe.sc) lack KEEP commands.
The attached patch may fix it.

-- 
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
https://lists.gnu.org/mailman/listinfo/bug-binutils