[Bug ld/12430] IR and non-IR objects, partial linking, and undefined reference errors

2011-01-21 Thread hjl.tools at gmail dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=12430

H.J. Lu  changed:

   What|Removed |Added

 CC||ccoutant at google dot com,
   ||ian at airs dot com

--- Comment #1 from H.J. Lu  2011-01-22 05:01:16 
UTC ---
It is an LTO issue. In stage 2, linker sees:

 /usr/lib/../lib64/crt1.o /usr/lib/../lib64/crti.o
/usr/gcc-4.6/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/crtbegin.o
/tmp/ccsgGNAQ.obj-only.o /tmp/ccrzbXDQ.ltrans0.ltrans.o --no-whole-archive
/usr/gcc-4.6/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/libgcc.a
/usr/gcc-4.6/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/../../../../lib64/libgcc_s.so
/usr/lib/../lib64/libc.so --no-whole-archive
/usr/gcc-4.6/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/libgcc.a
/usr/gcc-4.6/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/../../../../lib64/libgcc_s.so
/usr/gcc-4.6/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/crtend.o
/usr/lib/../lib64/crtn.o

[hjl@gnu-6 pr12430]$ nm /tmp/ccrzbXDQ.ltrans0.ltrans.o
[hjl@gnu-6 pr12430]$ 

Since LTO doesn't see foo be called from main, LTO optimizes it out.
ld.hjl gives correct diagnostic.

Is there a way in LTO API for linker to inform LTO that a symbol is
referenced from an non-IR object?

-- 
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/12431] New: `gold -r' strips LTO sections

2011-01-21 Thread d.g.gorbachev at gmail dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=12431

   Summary: `gold -r' strips LTO sections
   Product: binutils
   Version: 2.22 (HEAD)
Status: NEW
  Severity: normal
  Priority: P2
 Component: gold
AssignedTo: i...@airs.com
ReportedBy: d.g.gorbac...@gmail.com


$ touch 1.c
$ gcc -c -flto 1.c
$ objdump -h 1.o | grep -c lto
7
$ ld.gold -r 1.o
$ objdump -h a.out | grep -c lto
0

-- 
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/12430] New: IR and non-IR objects, partial linking, and undefined reference errors

2011-01-21 Thread d.g.gorbachev at gmail dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=12430

   Summary: IR and non-IR objects, partial linking, and undefined
reference errors
   Product: binutils
   Version: 2.22 (HEAD)
Status: NEW
  Severity: normal
  Priority: P2
 Component: ld
AssignedTo: unassig...@sources.redhat.com
ReportedBy: d.g.gorbac...@gmail.com
CC: hjl.to...@gmail.com


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

With ld.bfd, undefined reference to `main'. With ld.hjl, undefined reference to
`foo'.

-- 
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/12291] "ld -r" doesn't work with mixed IR/non-IR objects

2011-01-21 Thread d.g.gorbachev at gmail dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=12291

--- Comment #5 from Dmitry Gorbachev  
2011-01-22 00:43:24 UTC ---
> Does prog.o contain both IR and non-IR sections?

No. I think a new bug report should be opened for gold.

When I use ld.bfd (or ld.hjl) for partial link step and ld.ian for final link,
everything works.

-- 
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/12291] "ld -r" doesn't work with mixed IR/non-IR objects

2011-01-21 Thread hjl.tools at gmail dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=12291

--- Comment #4 from H.J. Lu  2011-01-21 22:27:45 
UTC ---
(In reply to comment #3)
> ld.ian (gold with patch
> ) silently uses 
> non-IR
> part of prog.o

What does gold generate for

/usr/gcc-4.6/bin/gcc -B./ -c -O -flto -fuse-linker-plugin main.c -o main.o
/usr/gcc-4.6/bin/gcc -B./ -c -O foo.c -o foo.o
./ld -r -o prog.o main.o foo.o

Does prog.o contain both IR and non-IR sections?

-- 
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/12370] Symbols present in LTO symbol table resolved as PREVAILING_DEF_IRONLY and optimized out appears in final symbol table.

2011-01-21 Thread d.g.gorbachev at gmail dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=12370

--- Comment #1 from Dmitry Gorbachev  
2011-01-21 21:58:26 UTC ---
Patch  does not fix
this bug.

-- 
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/12291] "ld -r" doesn't work with mixed IR/non-IR objects

2011-01-21 Thread d.g.gorbachev at gmail dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=12291

Dmitry Gorbachev  changed:

   What|Removed |Added

 CC||ian at airs dot com

--- Comment #3 from Dmitry Gorbachev  
2011-01-21 21:55:59 UTC ---
ld.ian (gold with patch
) silently uses non-IR
part of prog.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
http://lists.gnu.org/mailman/listinfo/bug-binutils


Segmentation fault whew cross-compiling with included dll-s

2011-01-21 Thread Mojca Miklavec
Dear list,

I'm experiencing a nasty problem with cross-compiler. I'm using 64-bit
Mac OS X 10.6.6 with macports and

> i386-mingw32-g++ --version
i386-mingw32-g++ (GCC) 3.4.5 (mingw-vista special r2)
> i386-mingw32-ld --version
GNU ld (GNU Binutils) 2.19.1

(but I'm experiencing similar problems on another linux machine that I
have tried).

When I try to run
i386-mingw32-g++ picoscope.cpp main.cpp -o main.exe -lps4000 -L.
it crashes with
collect2: ld terminated with signal 11 [Segmentation fault]

However it works with MiwGW
g++ picoscope.cpp main.cpp -o main -lps4000 -L.
under Windows (7).

I have put the files and make-osx.sh/make-win.bat to a temporary location
http://ol.ijs.si/~mojca/osciloskop/linker.zip
(The file is 374K and I wasn't sure if it was OK to put attach it.)

I know that the version of linker on my computer might be old, but:
- I don't know how to compile & install the latest one
- I am curious to know whether the same problem happens on your
machines when you run the latest versions of linkers.

Thank you very much for your help,
Mojca

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


[Bug binutils/12422] objdump --dwarf displays ranges (from / to) with mixed(decimal and hex) output

2011-01-21 Thread stefan at obssys dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=12422

Stefan Oberhumer  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||INVALID

--- Comment #1 from Stefan Oberhumer  2011-01-21 
10:04:55 UTC ---
I misinterpreted the output.

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