[Bug ld/16452] ELF executable with weak reference linked with ld causes assertion in ld.so
https://sourceware.org/bugzilla/show_bug.cgi?id=16452 --- Comment #10 from cvs-commit at gcc dot gnu.org --- This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "gdb and binutils". The annotated tag, hjl/linux/release/2.25.51.0.1 has been created at 02458b5b7894e10794a1e1b87e4f8e36b3198b10 (tag) tagging a0890eb04228a6b921697b1192285b57e5f46e97 (commit) replaces hjl/linux/release/2.24.51.0.4 tagged by H.J. Lu on Wed Dec 24 16:43:46 2014 -0800 - Log - Linux binutils 2.25.51.0.1 Ajit Kumar Agarwal (2): Microblaze: Reject invalid target descriptions Microblaze: Replace microblaze-expedite from pc to rpc Alan Modra (122): daily update Regen gold POTFILES.in daily update daily update daily update Do away with hash table line lookup in dwarf2dbg.c daily update daily update daily update daily update daily update daily update daily update Discard zero address range eh_frame FDEs daily update daily update daily update daily update daily update daily update daily update daily update daily update Run eh_frame optimisation for relocatable link daily update sparc-aout and sparc-coff breakage Correct fscanf char field count Avoid undefined behaviour with signed expressions daily update ChangeLog typo fix Define bfd_find_line entry of BFD_JUMP_TABLE_SYMBOLS using NAME. Merge bfd_find_nearest_line variants daily update PR17488, powerpc64-linux-ld segfault Fix 17492, ld segfault with --oformat=binary daily update daily update Fix PR17493, attempted output of *GAS `reg' section* symbol PowerPC64 ELFv1 function symbol definition vs LTO and discarded sections daily update daily update daily update Add gcc-4.9 libgomp symbols requiring --plt-thread-safe for power7 Relax ppc64_elf_tls_optimize assertion [GOLD] Add gcc-4.9 libgomp symbols requiring --plt-thread-safe for power7 daily update daily update daily update daily update daily update daily update daily update daily update daily update daily update daily update daily update daily update daily update Provide stat function for spu overlay manager iovec Regenerate spu overlay and icache manager files Use frag_now_fix_octets in gas d10v, d30v Don't use register keyword daily update Use obstack_blank_fast to shrink obstacks Cast result of obstack_next_free daily update daily update Revert bfd_get_size checks aoutx.h tidy tekhex buffer management and symbol types tekhex architecure daily update Correct buffer overrun test daily update daily update daily update ld -r abort in _bfd_elf_write_section_eh_frame Avoid coff OOM coff coff daily update Fix x86 non-ELF build breakage Fix z80-coff build breakage Throw away dodgy coff line number info earlier daily update daily update Default powerpc64 to --plt-thread-safe for Go ppc476 workaround sizing PPC gold doesn't check for overflow properly PPC gold doesn't check for overflow properly PowerPC64 --plt-align [GOLD] PowerPC relaxation corner case Retry powerpc gold stub grouping when groups prove too large _bfd_elf_slurp_version_tables tidy Fix build breakage on 32-bit targets with 64-bit bfd Don't deprecate powerpc mftb insn Sanity checks on version section Don't output symbol version definitions for non-DT_NEEDED libs Power4 should treat mftb as extended mfspr mnemonic ppc64_elf_edit_opd revamp powerpc gold, fix pr17566 powerpc gold, work around pr17670 Sort relocs output by ld -r PowerPC gold, fix 32-bit branch address arithmetic ChangeLog typo fix ppc64_elf_edit_opd revamp, take 2 Don't sort ld -r relocs for mips Don't access elf tdata in dwarf.c without first checking for an ELF bfd Don't return DW_AT_name for function name in C++ Don't always build coffgen.o Use autoconf check for long long in binutils Copy relocations against protected symbols Set bfd_error in _bfd_elf_adjust_dynamic_copy PowerPC register numbers in DWARF Move support code for linker script DEFINED to ldexp.c Correct logic for "defined by object" Don't PROVIDE over top of common symbols Use a symbol flag bit to mark linker defined symbols Report an error for script multiply defined symbols Yet another DEFINED testcase Fix generic linker symb
[Bug ld/16452] ELF executable with weak reference linked with ld causes assertion in ld.so
https://sourceware.org/bugzilla/show_bug.cgi?id=16452 --- Comment #9 from cvs-commit at gcc dot gnu.org --- This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "gdb and binutils". The branch, binutils-2_25-branch has been updated via 89e0345fdfad506e4692126cabd618ef859dc63f (commit) from d1862f3ab140073e8aefb38afedbb883bcbc8b60 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log - https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=89e0345fdfad506e4692126cabd618ef859dc63f commit 89e0345fdfad506e4692126cabd618ef859dc63f Author: H.J. Lu Date: Mon Dec 1 06:06:21 2014 -0800 Add tests for PR ld/16452 and PR ld/16457 PR ld/16452 PR ld/16457 * ld-elf/pr16452.map: New file. * ld-elf/pr16452.od: Likewise. * ld-elf/pr16452a.c: Likewise. * ld-elf/pr16452b.c: Likewise. * ld-elf/pr16457.od: Likewise. * ld-elf/shared.exp (build_tests): Add tests for PR ld/16452 and PR ld/16457. --- Summary of changes: ld/testsuite/ChangeLog | 13 + ld/testsuite/ld-elf/pr16452.map |1 + ld/testsuite/ld-elf/pr16452.od |7 +++ ld/testsuite/ld-elf/pr16452a.c |1 + ld/testsuite/ld-elf/pr16452b.c |2 ++ ld/testsuite/ld-elf/pr16457.od |6 ++ ld/testsuite/ld-elf/shared.exp | 12 7 files changed, 42 insertions(+), 0 deletions(-) create mode 100644 ld/testsuite/ld-elf/pr16452.map create mode 100644 ld/testsuite/ld-elf/pr16452.od create mode 100644 ld/testsuite/ld-elf/pr16452a.c create mode 100644 ld/testsuite/ld-elf/pr16452b.c create mode 100644 ld/testsuite/ld-elf/pr16457.od -- 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/16452] ELF executable with weak reference linked with ld causes assertion in ld.so
https://sourceware.org/bugzilla/show_bug.cgi?id=16452 --- Comment #8 from cvs-commit at gcc dot gnu.org --- This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "gdb and binutils". The branch, master has been updated via fb389763e0ee42be2f221da60e1c126314857d11 (commit) from 55cfb2c4c8accd5031fd7c8167988fc4624e847c (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log - https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=fb389763e0ee42be2f221da60e1c126314857d11 commit fb389763e0ee42be2f221da60e1c126314857d11 Author: H.J. Lu Date: Mon Dec 1 06:06:21 2014 -0800 Add tests for PR ld/16452 and PR ld/16457 PR ld/16452 PR ld/16457 * ld-elf/pr16452.map: New file. * ld-elf/pr16452.od: Likewise. * ld-elf/pr16452a.c: Likewise. * ld-elf/pr16452b.c: Likewise. * ld-elf/pr16457.od: Likewise. * ld-elf/shared.exp (build_tests): Add tests for PR ld/16452 and PR ld/16457. --- Summary of changes: ld/testsuite/ChangeLog | 13 + ld/testsuite/ld-elf/pr16452.map |1 + ld/testsuite/ld-elf/pr16452.od |7 +++ ld/testsuite/ld-elf/pr16452a.c |1 + ld/testsuite/ld-elf/pr16452b.c |2 ++ ld/testsuite/ld-elf/pr16457.od |6 ++ ld/testsuite/ld-elf/shared.exp | 12 7 files changed, 42 insertions(+), 0 deletions(-) create mode 100644 ld/testsuite/ld-elf/pr16452.map create mode 100644 ld/testsuite/ld-elf/pr16452.od create mode 100644 ld/testsuite/ld-elf/pr16452a.c create mode 100644 ld/testsuite/ld-elf/pr16452b.c create mode 100644 ld/testsuite/ld-elf/pr16457.od -- 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/16452] ELF executable with weak reference linked with ld causes assertion in ld.so
https://sourceware.org/bugzilla/show_bug.cgi?id=16452 Alan Modra changed: What|Removed |Added Status|ASSIGNED|RESOLVED CC|amodra at gmail dot com| Resolution|--- |FIXED Target Milestone|--- |2.25 --- Comment #7 from Alan Modra --- Patch committed -- 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/16452] ELF executable with weak reference linked with ld causes assertion in ld.so
https://sourceware.org/bugzilla/show_bug.cgi?id=16452 --- Comment #6 from cvs-commit at gcc dot gnu.org --- This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "gdb and binutils". The branch, binutils-2_25-branch has been updated via bdaf8f8eb88bfbd434a016bbdc9869d7d5d29a82 (commit) from 012d8ebc4bd1a1afb95d902604007b04762207f0 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log - https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=bdaf8f8eb88bfbd434a016bbdc9869d7d5d29a82 commit bdaf8f8eb88bfbd434a016bbdc9869d7d5d29a82 Author: Alan Modra Date: Thu Nov 27 15:16:49 2014 +1030 Don't output symbol version definitions for non-DT_NEEDED libs PR 16452, 16457 * elflink.c (_bfd_elf_link_find_version_dependencies): Exclude symbols from libraries that won't be listed in DT_NEEDED. (elf_link_output_extsym): Don't output verdefs for such symbols. --- Summary of changes: bfd/ChangeLog |7 +++ bfd/elflink.c |8 ++-- 2 files changed, 13 insertions(+), 2 deletions(-) -- 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/16452] ELF executable with weak reference linked with ld causes assertion in ld.so
https://sourceware.org/bugzilla/show_bug.cgi?id=16452 --- Comment #5 from cvs-commit at gcc dot gnu.org --- This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "gdb and binutils". The branch, master has been updated via 7b20f09964ba4275768350a24fca109527a19425 (commit) from b6a8f012d1813271c74cbc49545a27a2e8781fc0 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log - https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=7b20f09964ba4275768350a24fca109527a19425 commit 7b20f09964ba4275768350a24fca109527a19425 Author: Alan Modra Date: Thu Nov 27 15:16:49 2014 +1030 Don't output symbol version definitions for non-DT_NEEDED libs PR 16452, 16457 * elflink.c (_bfd_elf_link_find_version_dependencies): Exclude symbols from libraries that won't be listed in DT_NEEDED. (elf_link_output_extsym): Don't output verdefs for such symbols. --- Summary of changes: bfd/ChangeLog |7 +++ bfd/elflink.c |8 ++-- 2 files changed, 13 insertions(+), 2 deletions(-) -- 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/16452] ELF executable with weak reference linked with ld causes assertion in ld.so
https://sourceware.org/bugzilla/show_bug.cgi?id=16452 Alan Modra changed: What|Removed |Added CC||amodra at gmail dot com Assignee|unassigned at sourceware dot org |amodra at gmail dot com -- 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/16452] ELF executable with weak reference linked with ld causes assertion in ld.so
https://sourceware.org/bugzilla/show_bug.cgi?id=16452 Alan Modra changed: What|Removed |Added Status|NEW |ASSIGNED CC|amodra at gmail dot com| Component|dynamic-link|ld Version|2.21|2.26 (HEAD) Product|glibc |binutils -- 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/16452] ELF executable with weak reference linked with ld causes assertion in ld.so
https://sourceware.org/bugzilla/show_bug.cgi?id=16452 Alan Modra changed: What|Removed |Added URL||https://sourceware.org/ml/b ||inutils/2014-11/msg00351.ht ||ml CC||amodra at gmail dot com -- 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/16452] ELF executable with weak reference linked with ld causes assertion in ld.so
https://sourceware.org/bugzilla/show_bug.cgi?id=16452 Evangelos Foutras changed: What|Removed |Added CC||evangelos at foutrelis dot com -- 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/16452] ELF executable with weak reference linked with ld causes assertion in ld.so
https://sourceware.org/bugzilla/show_bug.cgi?id=16452 Sam Watkins changed: What|Removed |Added CC||sam at nipl dot net --- Comment #3 from Sam Watkins --- Here is a related bug report, this bug in ld causes programs using GL to fail when using the nvidia binary driver. I linked to the best comment, describing where the bug is to be found. https://bugs.launchpad.net/ubuntu/+source/nvidia-graphics-drivers-331/+bug/1248642/comments/16 There is also a report that it manifested with libselinux, smartctl and smartd. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=728529 This is a serious bug, distros are shipping broken packages due to this bug, e.g. celestia-glut in Ubuntu "Trusty" stable fails with Nvidia GL, also even small test programs such as the following fail with Nvidia GL: cat
[Bug ld/16452] ELF executable with weak reference linked with ld causes assertion in ld.so
https://sourceware.org/bugzilla/show_bug.cgi?id=16452 Allan McRae changed: What|Removed |Added CC||allan at archlinux dot org -- 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/16452] ELF executable with weak reference linked with ld causes assertion in ld.so
http://sourceware.org/bugzilla/show_bug.cgi?id=16452 --- Comment #2 from roseandrew at me dot com --- Good day, I would like to clarify : I'm trying to compile openssh , using own compiled toolchan. at compile tim e I come across such an error openbsd-compat / / libopenbsd-compat.a (bsd-misc.o): (. pdr +0 x20): undefi ned reference to `setlogin @ @ GLIBC_2.0 ' / home / andrew / Desktop / mips-toolchan / bin /.. /.. / mips-toolchan / / root/lib/libc.so.6: undefined reference to `setlogin @ @ GLIBC_2.0 I checked Content libraries connected during linking: libc_pic.a: setlogin.os: U __ divdi3_internal libc_pic.a: setlogin.os: n __ evoke_link_warning_setlogin libc_pic.a: setlogin.os: U __ GI_memmove libc_pic.a: setlogin.os: U __ GI_memset libc_pic.a: setlogin.os: U _gp_disp libc_pic.a: setlogin.os: U __ libc_errno libc_pic.a: setlogin.os: U __ moddi3_internal libc_pic.a: setlogin.os: T setlogin libc_pic.a: setlogin.os: U __ udivdi3_internal libc_pic.a: setlogin.os: U __ umoddi3_internal This may be due to an error upomyanotoy (regression in ld)?15 ян в. 2014 г. > http://sourceware.org/bugzilla/show_bug.cgi?id=16452 > >Bug ID: 16452 > Summary: ELF executable with weak reference linked with ld >causes assertion in ld.so > Product: binutils > Version: 2.25 (HEAD) >Status: NEW > Severity: normal > Priority: P2 > Component: ld > Assignee: unassigned at sourceware dot org > Reporter: brnguyen at nvidia dot com > > Created attachment 7357 > --> http://sourceware.org/bugzilla/attachment.cgi?id=7357&action=edit > Reproduction test case > > The attached reproduction test case builds two DSOs, one linked against > pthreads, and one not linked against pthreads, which implement the same > interface. It also builds a test application which is linked against the DSO > that uses pthreads. To reproduce the bug, the DSO that does not use pthr eads > is copied over the DSO that uses pthreads, and the test application is ru n. > > Using an ld built from commit 08d0cad39e31083cb8a885703604f7b20d359849, t his > triggers the following assertion on ld.so built from commit > 2f10c4d6901e7a4c4ad294cc5bb8ece6547f4f62 as well as ld.so from glibc > 2.15-0ubuntu10.5-ppa1 on my Ubuntu 12.04 LTS system: > > Inconsistency detected by ld.so: dl-version.c: 224: _dl_check_map_version s: > Assertion `needed != ((void *)0)' failed! > > This may be related to bugs #15149 and #12549. Also relevant is Debian bug > #728529. > > This appears to be a regression in ld (though there may be a bug in ld.so as > well). I bisected binutils using this reproduction test case to try to na rrow > down the commit(s) responsible for this regression. Interestingly, ld fai ls to > link the test executable in a commit range between ToT master and > binutils_2.22, with the following error messages: > > /home/brnguyen/build/binutils//ld/ld: /tmp/cc3K1rHK.o: undefined referenc e to > symbol 'pthread_create@@GLIBC_2.2.5' > /home/brnguyen/build/binutils//ld/ld: note: 'pthread_create@@GLIBC_2.2.5' is > defined in DSO //lib/x86_64-linux-gnu/libpthread.so.0 so try adding it to the > linker command line > > It appears this link error was introduced by commit > b64fb44af4f416fbbbda3de03fcfff61d80c841c ("Also track weak references") a nd > later removed by commit 879707c642925947e156b7ae2169b89f844532cd ("Exclud e weak > refs when considering whether an --as-needed library is needed"), at which > point ld produces an executable which triggers the assertion. > > -- > 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 -- 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/16452] ELF executable with weak reference linked with ld causes assertion in ld.so
https://sourceware.org/bugzilla/show_bug.cgi?id=16452 Dmitry V. Levin changed: What|Removed |Added CC||ldv at altlinux dot org See Also||https://sourceware.org/bugz ||illa/show_bug.cgi?id=16457 --- Comment #1 from Dmitry V. Levin --- Even more simple test case for this issue: $ cat libf.c int f(void){return 0;} $ cat libf.map FOO{global:f;}; $ gcc -shared -Wl,-soname,libf.so,--version-script,libf.map -Wall -Werror -fPIC -o libf.so libf.c $ gcc -shared -Wl,--no-as-needed,-soname,liba.so -o liba.so -L. -lf $ cat e.c int f(void) __attribute__((weak)); int main(void){return f?f():0;} $ gcc -Wall -Werror -o e e.c -Wl,--no-as-needed,--rpath,. -L. -la $ gcc -shared -Wl,-soname,liba.so -o liba.so -Wall -Werror -fPIC libf.c $ ./e Inconsistency detected by ld.so: dl-version.c: 224: _dl_check_map_versions: Assertion `needed != ((void *)0)' failed! This happens because the executable has no DT_NEEDED entry for the library that defines the versioned symbol, but at the same time the executable has an entry for that symbol and library in .gnu.version_r section, so, when dynamic linker sees this unversioned symbol (provided by another library), assertion is triggered. -- 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