Summary: | internal error in sized_write_symbol, at symtab.cc:3133 | ||
---|---|---|---|
Product: | binutils | Reporter: | Markus Trippelsdorf <markus> |
Component: | gold | Assignee: | Cary Coutant <ccoutant> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | hjl.tools, ian |
Priority: | P2 | ||
Version: | 2.26 | ||
Target Milestone: | --- | ||
Host: | Target: | ||
Build: | Last reconfirmed: |
Description
Markus Trippelsdorf
2015-09-07 09:20:35 UTC
Also happens on x86_64, e.g. trying to build perf: ... CC util/parse-events.o CC util/parse-events-flex.o CC util/pmu.o CC util/pmu-flex.o LD util/libperf-in.o LD libperf-in.o AR libperf.a LINK perf LINK libperf-gtk.so /usr/lib/gcc/x86_64-pc-linux-gnu/5.2.1/../../../../x86_64-pc-linux-gnu/bin/ld: internal error in sized_write_symbol, at /var/tmp/portage/sys-devel/binutils-9999/work/binutils/gold/symtab.cc:3133 collect2: error: ld returned 1 exit status Makefile.perf:306: recipe for target 'perf' failed markus@x4 gold % cat pex-unix.i pex_unix_exec_child() { vfork(); } markus@x4 gold % gcc -w -c pex-unix.i markus@x4 gold % ./ld-new pex-unix.o -lpthread -lc ./ld-new: internal error in sized_write_symbol, at symtab.cc:3133 Breakpoint 1, gold::Symbol_table::sized_write_symbol<64, false> (this=0x7fffffff5f40, sym=0x94c5c0, value=4194928, shndx=9, binding=elfcpp::STB_GLOBAL, pool=0x7fffffff6248, p=0x7ffff7fe04f0 "+") at symtab.cc:3133 3133 gold_assert(type != elfcpp::STT_GNU_IFUNC || !sym->is_from_dynobj()); (gdb) p sym->type() $1 = elfcpp::STT_FUNC (gdb) p sym->is_from_dynobj() $2 = false (gdb) bt #0 gold::Symbol_table::sized_write_symbol<64, false> (this=0x7fffffff5f40, sym=0x94c5c0, value=4194928, shndx=9, binding=elfcpp::STB_GLOBAL, pool=0x7fffffff6248, p=0x7ffff7fe04f0 "+") at symtab.cc:3133 #1 0x00000000006943b4 in gold::Symbol_table::sized_write_globals<64, false> (this=0x7fffffff5f40, sympool=0x7fffffff6248, dynpool=0x7fffffff62d0, symtab_xindex=0x0, dynsym_xindex=0x0, of=0xa4a100) at symtab.cc:3087 #2 0x000000000068890e in gold::Symbol_table::write_globals (this=0x7fffffff5f40, sympool=0x7fffffff6248, dynpool=0x7fffffff62d0, symtab_xindex=0x0, dynsym_xindex=0x0, of=0xa4a100) at symtab.cc:2886 #3 0x00000000006ae710 in gold::Workqueue::find_and_run_task (this=this@entry=0x7fffffff5c30, thread_number=thread_number@entry=0) at workqueue.cc:319 #4 0x00000000006aeaaa in gold::Workqueue::process (this=this@entry=0x7fffffff5c30, thread_number=thread_number@entry=0) at workqueue.cc:495 #5 0x0000000000407e73 in main (argc=4, argv=0x7fffffffe2a8) at main.cc:252 resolve.cc isn't used at all in this case. The master branch has been updated by Cary Coutant <ccoutant@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=3d4fde6974a1237d79055ee734d99cc49c6fd3f9 commit 3d4fde6974a1237d79055ee734d99cc49c6fd3f9 Author: Cary Coutant <ccoutant@gmail.com> Date: Mon Sep 7 09:44:11 2015 -0700 Fix internal error caused by IFUNC patch. The previous commit to fix PR gold/18886 converted STT_IFUNC to STT_FUNC when resolving to a symbol defined in a shared library. This leads to an internal error if the shared library symbol is seen first, as we do not convert the symbol at all. We need to override the STT_IFUNC in add_from_dynobj() instead of in override_base(). gold/ PR gold/18930 PR gold/18886 * resolve.cc (Symbol::override_base): Don't convert IFUNC symbols here. * symtab.cc (Symbol_table::add_from_dynobj): Convert them here instead. Fixed on master. |