[Bug ld/12369] Symbols present in LTO symbol table resolved as PREVAILING_DEF_IRONLY and optimized out appears in final symbol table.

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

H.J. Lu  changed:

   What|Removed |Added

 CC||hjl.tools at gmail 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 ld/12369] Symbols present in LTO symbol table resolved as PREVAILING_DEF_IRONLY and optimized out appears in final symbol table.

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

--- Comment #1 from H.J. Lu  2011-01-05 23:23:46 
UTC ---
Works for me on hjl/lto-mixed branch at

http://git.kernel.org/?p=devel/binutils/hjl/x86.git;a=summary

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

2011-01-05 Thread jh at suse dot cz
http://sourceware.org/bugzilla/show_bug.cgi?id=12370

   Summary: Symbols present in LTO symbol table resolved as
PREVAILING_DEF_IRONLY and optimized out appears in
final symbol table.
   Product: binutils
   Version: unspecified
Status: NEW
  Severity: normal
  Priority: P2
 Component: gold
AssignedTo: i...@airs.com
ReportedBy: j...@suse.cz


Gold expose simplar problem to PR 12369 in GNU LD

j...@evans:/abuild/jh/trunk-3/build-inst2/gcc> cat t.C
struct S {
  virtual ~S() { }
};

int main(void)
{
  S t;
  return 0;
}
h...@evans:/abuild/jh/trunk-3/build-inst2/gcc> ./g++ -B ./ -O2 t.C -save-temps
-flto -fuse-linker-plugin
[Leaving LTRANS /abuild/jh/tmp//ccoul7Xo.args]
[Leaving LTRANS /abuild/jh/tmp//ccT1KSUO.ltrans.out]
[Leaving LTRANS /abuild/jh/tmp//ccOM6q7y.args]
[Leaving LTRANS /abuild/jh/tmp//ccT1KSUO.ltrans0.o]
j...@evans:/abuild/jh/trunk-3/build-inst2/gcc> cat *.s
.file   "ccT1KSUO.ltrans0.o"
.section.text.startup,"ax",@progbits
.p2align 4,,15
.globl  main
.type   main, @function
main:
.LFB0:
.cfi_startproc
xorl%eax, %eax
ret
.cfi_endproc
.LFE0:
.size   main, .-main
    .ident  "GCC: (GNU) 4.6.0 20110105 (experimental)"
.section.note.GNU-stack,"",@progbits


it is optimized out. 

With GNU LD I get
j...@evans:/abuild/jh/trunk-3/build-inst2/gcc> nm a.out
00401720 d _DYNAMIC
004018f8 d _GLOBAL_OFFSET_TABLE_
0040063c R _IO_stdin_used
 w _Jv_RegisterClasses
 w _ZTI1S
 w _ZTS1S
 v _ZTVN10__cxxabiv117__class_type_infoE
 U _ZdlPv
00401930 d __CTOR_END__
00401928 d __CTOR_LIST__
00401940 d __DTOR_END__
00401938 d __DTOR_LIST__
004006d8 r __FRAME_END__
00401948 d __JCR_END__
00401948 d __JCR_LIST__
00401950 A __bss_start
00401918 D __data_start
00400600 t __do_global_ctors_aux
004004b0 t __do_global_dtors_aux
00401920 d __dso_handle
 w __gmon_start__
 a __init_array_end
 a __init_array_start
00400560 T __libc_csu_fini
00400570 T __libc_csu_init
 U __libc_start_main
00401950 A _edata
00401960 A _end
00400658 T _fini
00400640 T _init
00400460 T _start
0040048c t call_gmon_start
00401950 b completed.5822
00401918 W data_start
00401958 b dtor_idx.5824
00400520 t frame_dummy
00400550 T main


typeinfo for S and friends should not appear in the symbol table, they are not
in the linker plugin output (but was originally

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

2011-01-05 Thread jh at suse dot cz
http://sourceware.org/bugzilla/show_bug.cgi?id=12369

   Summary: Symbols present in LTO symbol table resolved as
PREVAILING_DEF_IRONLY and optimized out appears in
final symbol table.
   Product: binutils
   Version: unspecified
Status: NEW
  Severity: normal
  Priority: P2
 Component: ld
AssignedTo: unassig...@sources.redhat.com
ReportedBy: j...@suse.cz


As observed in http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47183

j...@evans:/abuild/jh/trunk-3/build-inst2/gcc> cat t.C
struct S {
  virtual ~S() { }
};

int main(void)
{
  S t;
  return 0;
}
h...@evans:/abuild/jh/trunk-3/build-inst2/gcc> ./g++ -B ./ -O2 t.C -save-temps
-flto -fuse-linker-plugin
[Leaving LTRANS /abuild/jh/tmp//ccoul7Xo.args]
[Leaving LTRANS /abuild/jh/tmp//ccT1KSUO.ltrans.out]
[Leaving LTRANS /abuild/jh/tmp//ccOM6q7y.args]
[Leaving LTRANS /abuild/jh/tmp//ccT1KSUO.ltrans0.o]
j...@evans:/abuild/jh/trunk-3/build-inst2/gcc> cat *.s
.file   "ccT1KSUO.ltrans0.o"
.section.text.startup,"ax",@progbits
.p2align 4,,15
.globl  main
.type   main, @function
main:
.LFB0:
.cfi_startproc
xorl%eax, %eax
ret
.cfi_endproc
.LFE0:
.size   main, .-main
    .ident  "GCC: (GNU) 4.6.0 20110105 (experimental)"
.section.note.GNU-stack,"",@progbits


it is optimized out. 

With GNU LD I get
j...@evans:/abuild/jh/trunk-3/build-inst2/gcc> nm a.out
00600748 d _DYNAMIC
00600910 d _GLOBAL_OFFSET_TABLE_
0040067c R _IO_stdin_used
 w _Jv_RegisterClasses
00400582 W _ZTI1S
00400582 W _ZTS1S
 U _ZTVN10__cxxabiv117__class_type_infoE@@CXXABI_1.3
 U _ZdlPv@@GLIBCXX_3.4
00600728 d __CTOR_END__
00600720 d __CTOR_LIST__
00600738 D __DTOR_END__
00600730 d __DTOR_LIST__
00400700 r __FRAME_END__
00600740 d __JCR_END__
00600740 d __JCR_LIST__
00600940 A __bss_start
00600930 D __data_start
00400630 t __do_global_ctors_aux
004004f0 t __do_global_dtors_aux
00600938 D __dso_handle
 w __gmon_start__
00600720 d __init_array_end
00600720 d __init_array_start
00400590 T __libc_csu_fini
004005a0 T __libc_csu_init
 U __libc_start_main@@GLIBC_2.2.5
00600940 A _edata
00600950 A _end
0040066c T _fini
00400460 T _init
004004a4 T _start
004004d0 t call_gmon_start
00600940 b completed.5822
00600930 W data_start
00600948 b dtor_idx.5824
00400560 t frame_dummy
004004a0 T main

typeinfo for S and friends should not appear in the symbol table, they are not
in the linker plugin output (but was originally

-- 
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/12366] assertion failure with STT_GNU_IFUNC symbols on x86_64

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

H.J. Lu  changed:

   What|Removed |Added

 CC||hjl.tools at gmail 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 ld/12365] undefined references produced by linker plugin are silently ignored

2011-01-05 Thread jh at suse dot cz
http://sourceware.org/bugzilla/show_bug.cgi?id=12365

--- Comment #3 from Jan Hubicka  2011-01-05 20:23:59 UTC ---
Hmm, wonder how testcases for linker plugin related bugs should look like.  All
I can think of is the GCC version + testcase that is in testsuite anyway.

-- 
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/12365] undefined references produced by linker plugin are silently ignored

2011-01-05 Thread davek at gcc dot gnu.org
http://sourceware.org/bugzilla/show_bug.cgi?id=12365

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


[Bug ld/12366] New: assertion failure with STT_GNU_IFUNC symbols on x86_64

2011-01-05 Thread richard.sandiford at linaro dot org
http://sourceware.org/bugzilla/show_bug.cgi?id=12366

   Summary: assertion failure with STT_GNU_IFUNC symbols on x86_64
   Product: binutils
   Version: 2.22 (HEAD)
Status: NEW
  Severity: normal
  Priority: P2
 Component: ld
AssignedTo: unassig...@sources.redhat.com
ReportedBy: richard.sandif...@linaro.org


Created attachment 5181
  --> http://sourceware.org/bugzilla/attachment.cgi?id=5181
Shell script to reproduce bug

The x86 and x86_64 IFUNC code assumes that check_relocs can rely on def_regular
being set for all regular definitions.  That's not true, because def_regular is
set by the same pass that calls check_relocs, and doesn't therefore take into
account regular definitions in later objects.  Everything works if the regular
definition comes before the regular use, but not the other way round.

I've attached a simple example.  The link order in the example gives:

./ld/ld-new: BFD (GNU Binutils) 2.21.51.20110105 internal error, aborting at
/usr/export/richards-desktop-2/richards/binutils/HEAD/src/bfd/elf64-x86-64.c
line 2802 in elf_x86_64_relocate_section

./ld/ld-new: Please report this bug.

But linking bar.o before foo.o works as expected.

-- 
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/12365] undefined references produced by linker plugin are silently ignored

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

H.J. Lu  changed:

   What|Removed |Added

 Status|WAITING |NEW

--- Comment #2 from H.J. Lu  2011-01-05 15:44:18 
UTC ---
Works for me on hjl/lto-mixed branch at

http://git.kernel.org/?p=devel/binutils/hjl/x86.git;a=summary

[...@gnu-32 testsuite]$ ../xgcc -B../
/export/gnu/import/git/gcc/gcc/testsuite/gcc.c-torture/execute/builtins/memops-asm*.c
/export/gnu/import/git/gcc/gcc/testsuite/gcc.c-torture/execute/builtins/lib/main.c
-O2 -fuse-linker-plugin -flto
/tmp/ccUDWDxu.ltrans0.ltrans.o: In function `main':
ccUDWDxu.ltrans0.o:(.text.startup+0x173): undefined reference to `my_bcopy'
collect2: ld returned 1 exit status
[...@gnu-32 testsuite]$

-- 
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/12323] linker plugin does not handle TLS

2011-01-05 Thread jh at suse dot cz
http://sourceware.org/bugzilla/show_bug.cgi?id=12323

Jan Hubicka  changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
 Resolution|FIXED   |

--- Comment #4 from Jan Hubicka  2011-01-05 15:40:06 UTC ---
Agreed. Until the problem is fixed in mainline, the PR should stay open.

-- 
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/12365] undefined references produced by linker plugin are silently ignored

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

H.J. Lu  changed:

   What|Removed |Added

 Status|NEW |WAITING
 CC||hjl.tools at gmail dot com

--- Comment #1 from H.J. Lu  2011-01-05 15:19:55 
UTC ---
Please provide a complete 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 ld/12365] New: undefined references produced by linker plugin are silently ignored

2011-01-05 Thread jh at suse dot cz
http://sourceware.org/bugzilla/show_bug.cgi?id=12365

   Summary: undefined references produced by linker plugin are
silently ignored
   Product: binutils
   Version: unspecified
Status: NEW
  Severity: normal
  Priority: P2
 Component: ld
AssignedTo: unassig...@sources.redhat.com
ReportedBy: j...@suse.cz


Compiling memcpy-asm testcase from GCC testsuite with current GCC mainline and
-O2 -flto results in call to my_memcpy that is not defined:

./xgcc -B ./ -O2 memops-asm*.c 
/abuild/jh/trunk-3/gcc/testsuite/gcc.c-torture/execute/builtins/lib/main.c  -g
-O0 -flto --save-temps -fdump-ipa-all-details-save-temps
evans:/abuild/jh/trunk-3/build-inst2/gcc/:[0]# grep memcpy *.s
ccNd9GvG.ltrans0.s: .globl  memcpy
ccNd9GvG.ltrans0.s: .type   memcpy, @function
ccNd9GvG.ltrans0.s:memcpy:
ccNd9GvG.ltrans0.s: callmy_memcpy.2055
ccNd9GvG.ltrans0.s: .size   memcpy, .-memcpy
ccNd9GvG.ltrans0.s: .type   my_memcpy.2055, @function
ccNd9GvG.ltrans0.s:my_memcpy.2055:
ccNd9GvG.ltrans0.s: .size   my_memcpy.2055, .-my_memcpy.2055
ccNd9GvG.ltrans0.s: callmy_memcpy
ccNd9GvG.ltrans0.s: callmy_memcpy
ccNd9GvG.ltrans0.s: .string "memcpy"
ccNd9GvG.ltrans0.s: .string "my_memcpy"

this is GCC bug where my_memcpy is once defined as alias and once as normal
function and declarations are not merged. 
This however should result in linktime error instead of producing binary.
In the binary the call to my_memcpy is linked to bogus destination:

   400a41:   e8 9c fb ff ff  callq  4005e2 

I assume this is caused by fact that my_memcpy appears in original LTO symbol
tables.

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


[Bug ld/12364] Segmentation fault in get_symbols

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

H.J. Lu  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED

--- Comment #3 from H.J. Lu  2011-01-05 14:27:13 
UTC ---
Fixed.

-- 
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/12364] Segmentation fault in get_symbols

2011-01-05 Thread cvs-commit at gcc dot gnu.org
http://sourceware.org/bugzilla/show_bug.cgi?id=12364

--- Comment #2 from cvs-commit at gcc dot gnu.org  2011-01-05 14:25:29 UTC ---
CVSROOT:/cvs/src
Module name:src
Changes by:h...@sourceware.org2011-01-05 14:25:26

Modified files:
ld : ChangeLog plugin.c 

Log message:
Check if a bfd is NULL before accessing its flags field.

2011-01-05  H.J. Lu  

PR ld/12364
* plugin.c (get_symbols): Check if owner_sec->owner is NULL
before accessing its flags field.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/ChangeLog.diff?cvsroot=src&r1=1.2264&r2=1.2265
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/plugin.c.diff?cvsroot=src&r1=1.19&r2=1.20

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