[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug ld/17306] New: ld aborts when linking with --just-symbols
From: |
famcool at gmail dot com |
Subject: |
[Bug ld/17306] New: ld aborts when linking with --just-symbols |
Date: |
Mon, 25 Aug 2014 10:14:20 +0000 |
https://sourceware.org/bugzilla/show_bug.cgi?id=17306
Bug ID: 17306
Summary: ld aborts when linking with --just-symbols
Product: binutils
Version: 2.24
Status: NEW
Severity: normal
Priority: P2
Component: ld
Assignee: unassigned at sourceware dot org
Reporter: famcool at gmail dot com
I hit this error while I am building qemu-img with the source code from
qemu-project.org:
/usr/bin/ld: BFD (GNU Binutils) 2.24 internal error, aborting at
/build/binutils/src/binutils-2.24/bfd/elf64-x86-64.c line 3641 in
elf_x86_64_relocate_section
/usr/bin/ld: Please report this bug.
collect2: error: ld returned 1 exit status
My ld version:
$ ld --version
GNU ld (GNU Binutils) 2.24
Copyright 2013 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.
Command line: The below line, as a modified command from the one that would be
generated by QEMU's build system:
$ c++ -Werror -fPIE -DPIE -m64 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64
-D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef
-Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common
-Wno-error=deprecated-declarations -Wendif-labels -Wmissing-include-dirs
-Wempty-body -Wnested-externs -Wformat-security -Wformat-y2k -Winit-self
-Wignored-qualifiers -Wold-style-declaration -Wold-style-definition
-Wtype-limits -fstack-protector-strong -I/usr/include/p11-kit-1
-I/usr/include/p11-kit-1 -I/usr/include/libpng16
-I/usr/include/spice-server -I/usr/include/cacard -I/usr/include/nss
-I/usr/include/nspr -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include
-I/usr/include/pixman-1 -I/usr/include/spice-1 -I/usr/include/libusb-1.0
-I/usr/include/pixman-1 -I/home/fam/qemu/dtc/libfdt -I/home/fam/qemu/tests -O2
-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -pthread -I/usr/include/glib-2.0
-I/usr/lib/glib-2.0/include -pthread -I/usr/include/glib-2.0
-I/usr/lib/glib-2.0/include -g -Wl,--warn-common -Wl,-z,relro -Wl,-z,now -pie
-m64 -g -lrt -o qemu-img qemu-img.o async.o thread-pool.o nbd.o block.o
blockjob.o main-loop.o iohandler.o qemu-timer.o aio-posix.o qemu-io-cmds.o
qemu-coroutine.o qemu-coroutine-lock.o qemu-coroutine-io.o
qemu-coroutine-sleep.o coroutine-ucontext.o block/raw_bsd.o block/cow.o
block/qcow.o block/vdi.o block/vmdk.o block/cloop.o block/dmg.o block/bochs.o
block/vpc.o block/vvfat.o block/qcow2.o block/qcow2-refcount.o
block/qcow2-cluster.o block/qcow2-snapshot.o block/qcow2-cache.o block/qed.o
block/qed-gencb.o block/qed-l2-cache.o block/qed-table.o block/qed-cluster.o
block/qed-check.o block/vhdx.o block/vhdx-endian.o block/vhdx-log.o
block/quorum.o block/parallels.o block/blkdebug.o block/blkverify.o
block/snapshot.o block/qapi.o block/raw-posix.o block/linux-aio.o block/nbd.o
block/nbd-client.o block/sheepdog.o block/nfs.o
-Wl,--just-symbols=block/iscsi.o libqemuutil.a libqemustub.a -lz -laio -lm
-Wl,--export-dynamic -lgmodule-2.0 -pthread -lglib-2.0 -lgthread-2.0 -pthread
-lglib-2.0 -lz -lnfs -lz -lcap-ng -lvdeplug -luuid -lgnutls -lgnutls
-lgnutls -lSDL -lpthread -lX11 -lvte -lgtk-x11-2.0 -lgdk-x11-2.0
-lpangocairo-1.0 -latk-1.0 -lgdk_pixbuf-2.0 -lpangoft2-1.0 -lpango-1.0
-lfontconfig -lfreetype -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lcairo -lX11 -lXext
-lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0 -latk-1.0 -lcairo
-lgdk_pixbuf-2.0 -lgio-2.0 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0
-lfontconfig -lfreetype -lX11 -llzo2 -lsnappy -lseccomp -lutil
The base command is from QEMU's build command:
"cd $QEMU_SRC; ./configure --enable-modules --target-list=x86_64-softmmu; make
qemu-img V=1".
It's the last command to actually link many objects, libraries and archives to
the executable qemu-img.
The only difference is the manually added "-Wl,--just-symbols=block/iscsi.o",
which I used here to try to fix the problem described in
http://lists.gnu.org/archive/html/qemu-devel/2014-08/msg03397.html
The purpose of this --just-symbols option, is to force qemu-img to include the
definition of function "qmp_query_uuid" with --just-symbols=block/iscsi.o.
Because block/iscsi.o references this symbol but qemu-img itself doesn't.
--
You are receiving this mail because:
You are on the CC list for the bug.
- [Bug ld/17306] New: ld aborts when linking with --just-symbols,
famcool at gmail dot com <=
- [Bug ld/17306] ld aborts when linking with --just-symbols, hjl.tools at gmail dot com, 2014/08/25
- [Bug ld/17306] ld aborts when linking with --just-symbols, hjl.tools at gmail dot com, 2014/08/25
- [Bug ld/17306] ld aborts when linking with --just-symbols, famcool at gmail dot com, 2014/08/25
- [Bug ld/17306] ld aborts when linking with --just-symbols, famcool at gmail dot com, 2014/08/25
- [Bug ld/17306] ld aborts when linking with --just-symbols, hjl.tools at gmail dot com, 2014/08/26
- [Bug ld/17306] ld aborts when linking with --just-symbols, hjl.tools at gmail dot com, 2014/08/26
- [Bug ld/17306] ld aborts when linking with --just-symbols, hjl.tools at gmail dot com, 2014/08/26
- [Bug ld/17306] ld aborts when linking with --just-symbols, cvs-commit at gcc dot gnu.org, 2014/08/27
- [Bug ld/17306] ld aborts when linking with --just-symbols, hjl.tools at gmail dot com, 2014/08/27
- [Bug ld/17306] ld aborts when linking with --just-symbols, famcool at gmail dot com, 2014/08/27