[Bug ld/26806] Suspected linker bug with LTO

2020-11-01 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=26806

--- Comment #11 from cvs-commit at gcc dot gnu.org  ---
The master branch has been updated by Alan Modra :

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=b1a92c635c1ec10fd703302ce1fc4ab3a8515a04

commit b1a92c635c1ec10fd703302ce1fc4ab3a8515a04
Author: Alan Modra 
Date:   Fri Oct 30 14:56:35 2020 +1030

PR26806, Suspected linker bug with LTO

This patch reverts most of git commit 1e3b96fd6cf, so IR symbols are
again not marked def_regular or ref_regular.  That should be enough to
stop IR symbols from becoming dynamic.  To mark as-needed shared
libraries referenced by IR symbols, use the referencing BFD rather
than the ref flags.

bfd/
PR 15146
PR 26314
PR 26530
PR 26806
* elflink.c (elf_link_add_object_symbols): Don't set def/ref flags
for plugin syms.  Do allow plugin syms to mark as-needed libs.
ld/
PR 26806
* testsuite/ld-plugin/lto-19.h,
* testsuite/ld-plugin/lto-19a.c,
* testsuite/ld-plugin/lto-19b.c,
* testsuite/ld-plugin/lto-19c.c: New test.
* testsuite/ld-plugin/pr26806.c,
* testsuite/ld-plugin/pr26806.d: New test.
* testsuite/ld-plugin/lto.exp: Run them.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug ld/26314] Linking LTO objects with conflicting symbol definitions from static and shared libraries fails

2020-11-01 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=26314

--- Comment #8 from cvs-commit at gcc dot gnu.org  ---
The master branch has been updated by Alan Modra :

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=b1a92c635c1ec10fd703302ce1fc4ab3a8515a04

commit b1a92c635c1ec10fd703302ce1fc4ab3a8515a04
Author: Alan Modra 
Date:   Fri Oct 30 14:56:35 2020 +1030

PR26806, Suspected linker bug with LTO

This patch reverts most of git commit 1e3b96fd6cf, so IR symbols are
again not marked def_regular or ref_regular.  That should be enough to
stop IR symbols from becoming dynamic.  To mark as-needed shared
libraries referenced by IR symbols, use the referencing BFD rather
than the ref flags.

bfd/
PR 15146
PR 26314
PR 26530
PR 26806
* elflink.c (elf_link_add_object_symbols): Don't set def/ref flags
for plugin syms.  Do allow plugin syms to mark as-needed libs.
ld/
PR 26806
* testsuite/ld-plugin/lto-19.h,
* testsuite/ld-plugin/lto-19a.c,
* testsuite/ld-plugin/lto-19b.c,
* testsuite/ld-plugin/lto-19c.c: New test.
* testsuite/ld-plugin/pr26806.c,
* testsuite/ld-plugin/pr26806.d: New test.
* testsuite/ld-plugin/lto.exp: Run them.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug ld/15146] Reference from dummy plugin symbol isn't removed

2020-11-01 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=15146

--- Comment #8 from cvs-commit at gcc dot gnu.org  ---
The master branch has been updated by Alan Modra :

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=b1a92c635c1ec10fd703302ce1fc4ab3a8515a04

commit b1a92c635c1ec10fd703302ce1fc4ab3a8515a04
Author: Alan Modra 
Date:   Fri Oct 30 14:56:35 2020 +1030

PR26806, Suspected linker bug with LTO

This patch reverts most of git commit 1e3b96fd6cf, so IR symbols are
again not marked def_regular or ref_regular.  That should be enough to
stop IR symbols from becoming dynamic.  To mark as-needed shared
libraries referenced by IR symbols, use the referencing BFD rather
than the ref flags.

bfd/
PR 15146
PR 26314
PR 26530
PR 26806
* elflink.c (elf_link_add_object_symbols): Don't set def/ref flags
for plugin syms.  Do allow plugin syms to mark as-needed libs.
ld/
PR 26806
* testsuite/ld-plugin/lto-19.h,
* testsuite/ld-plugin/lto-19a.c,
* testsuite/ld-plugin/lto-19b.c,
* testsuite/ld-plugin/lto-19c.c: New test.
* testsuite/ld-plugin/pr26806.c,
* testsuite/ld-plugin/pr26806.d: New test.
* testsuite/ld-plugin/lto.exp: Run them.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug ld/26530] Inconsistency in between bfd and gold about -Wl,--as-needed

2020-11-01 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=26530

--- Comment #6 from cvs-commit at gcc dot gnu.org  ---
The master branch has been updated by Alan Modra :

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=b1a92c635c1ec10fd703302ce1fc4ab3a8515a04

commit b1a92c635c1ec10fd703302ce1fc4ab3a8515a04
Author: Alan Modra 
Date:   Fri Oct 30 14:56:35 2020 +1030

PR26806, Suspected linker bug with LTO

This patch reverts most of git commit 1e3b96fd6cf, so IR symbols are
again not marked def_regular or ref_regular.  That should be enough to
stop IR symbols from becoming dynamic.  To mark as-needed shared
libraries referenced by IR symbols, use the referencing BFD rather
than the ref flags.

bfd/
PR 15146
PR 26314
PR 26530
PR 26806
* elflink.c (elf_link_add_object_symbols): Don't set def/ref flags
for plugin syms.  Do allow plugin syms to mark as-needed libs.
ld/
PR 26806
* testsuite/ld-plugin/lto-19.h,
* testsuite/ld-plugin/lto-19a.c,
* testsuite/ld-plugin/lto-19b.c,
* testsuite/ld-plugin/lto-19c.c: New test.
* testsuite/ld-plugin/pr26806.c,
* testsuite/ld-plugin/pr26806.d: New test.
* testsuite/ld-plugin/lto.exp: Run them.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug ld/26806] Suspected linker bug with LTO

2020-11-01 Thread amodra at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=26806

Alan Modra  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|ASSIGNED|RESOLVED

--- Comment #12 from Alan Modra  ---
Fixed.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug gold/26827] New: ld.gold --threads segfault since 2.35

2020-11-01 Thread nick.gasson at arm dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=26827

Bug ID: 26827
   Summary: ld.gold --threads segfault since 2.35
   Product: binutils
   Version: 2.35
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: gold
  Assignee: ccoutant at gmail dot com
  Reporter: nick.gasson at arm dot com
CC: ian at airs dot com
  Target Milestone: ---

With latest binutils 2.35:

$ gcc -fuse-ld=gold -Wl,--threads test.c 
malloc(): invalid next size (unsorted)
collect2: fatal error: ld terminated with signal 6 [Aborted], core dumped
compilation terminated.
$ gcc -fuse-ld=gold -Wl,--threads test.c 
$ gcc -fuse-ld=gold -Wl,--threads test.c 
double free or corruption (out)
collect2: fatal error: ld terminated with signal 11 [Segmentation fault], core
dumped
compilation terminated.

The contents of the .c file don't matter. I think it was introduced with

  f37b21b481a7 PR 22843: ld, gold: Add --dependency-file option.

Simple fix:

--- a/gold/fileread.cc
+++ b/gold/fileread.cc
@@ -212,6 +212,7 @@ File_read::open(const Task* task, const std::string& name)
   gold_debug(DEBUG_FILES, "Attempt to open %s succeeded",
 this->name_.c_str());
   this->token_.add_writer(task);
+  file_counts_initialize_lock.initialize();
   Hold_optional_lock hl(file_counts_lock);
   record_file_read(this->name_);
 }

-- 
You are receiving this mail because:
You are on the CC list for the bug.