Bug 1576735

Summary: /usr/bin/ld: BFD version 2.30 assertion fail elf32-i386.c:3881 (PIE related)
Product: [Fedora] Fedora Reporter: Honza Horak <hhorak>
Component: binutilsAssignee: H.J. Lu <hongjiu.lu>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 29CC: dvlasenk, hongjiu.lu, jakub, nickc
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: binutils-2.30-20.fc29 Doc Type: Bug Fix
Doc Text:
Cause: The x86 targeted form of the BFD linker would attempt to resolve the special symbols __bss_start, _end and _edata on a global basis when creating a shared library. Consequence: The linker would trigger an assertion failure due to these symbols being multiply defined. Fix: Correct the linker so that the references to these special symbols are resolved locally rather than globally. Result: The linker no longer triggers an assertion failure and instead links the binary properly.
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-11-27 22:47:49 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Honza Horak 2018-05-10 09:32:51 UTC
Description of problem:
When compiling a community-mysql package, ld fails on assert. Koji log e.g: https://kojipkgs.fedoraproject.org//work/tasks/8835/26868835/build.log

Version-Release number of selected component (if applicable):
# rpm -q binutils
binutils-2.30-18.fc29.i686

How reproducible:
every-time, only on 32bit intel

Steps to Reproduce:
1. Download a package that causes this issue
#> wget https://kojipkgs.fedoraproject.org//packages/community-mysql/5.6.39/2.module_1725+1570e8f8/src/community-mysql-5.6.39-2.module_1725+1570e8f8.src.rpm

2. Build the RPM on 32bit intel:
#> mock -r fedora-rawhide-i386 community-mysql-5.6.39-2.module_1725+1570e8f8.src.rpm

3. Run mock interactively:
#> mock -r fedora-rawhide-i386 --shell

4. Run the problematic c++ command:
#> cd /builddir/build/BUILD/mysql-5.6.39/build/sql
#> /usr/bin/c++  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m32 -march=i686 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fPIC -Wall -Wextra -Wformat-security -Wvla -Woverloaded-virtual -Wno-unused-parameter -O3 -g -fabi-version=2 -fno-omit-frame-pointer -fno-strict-aliasing -DDBUG_OFF -DMY_PTHREAD_FASTMUTEX=1  -Wl,--export-dynamic  -pie -Wl,-z,relro,-z,now CMakeFiles/mysqld.dir/main.cc.o  -o mysqld -lpthread libsql.a libbinlog.a librpl.a libmaster.a libslave.a libsql.a ../mysys/libmysys.a ../mysys_ssl/libmysys_ssl.a ../storage/archive/libarchive.a ../storage/blackhole/libblackhole.a ../storage/csv/libcsv.a ../storage/federated/libfederated.a ../storage/heap/libheap.a ../storage/innobase/libinnobase.a -laio ../storage/myisam/libmyisam.a ../storage/myisammrg/libmyisammrg.a ../storage/perfschema/libperfschema.a libpartition.a ../mysys/libmysys.a ../dbug/libdbug.a ../mysys/libmysys.a ../dbug/libdbug.a -lz -lm ../strings/libstrings.a ../vio/libvio.a ../regex/libregex.a -lcrypt -lssl -lcrypto -ldl -lpthread 


Actual results:
/usr/bin/ld: BFD version 2.30-18.fc29 assertion fail elf32-i386.c:3881
collect2: error: ld returned 1 exit status

Expected results:
no error

Additional info:
Seems to work on F28, where there is binutils-2.29
Also, when removing -pie option, it succeeds, using -O0 does not have any effect.

Comment 1 H.J. Lu 2018-05-11 02:47:22 UTC
A patch is posted at

https://sourceware.org/ml/binutils/2018-05/msg00127.html

Comment 2 H.J. Lu 2018-05-14 11:04:57 UTC
It has been fixed for binutils 2.31.

Comment 3 Nick Clifton 2018-05-14 11:48:03 UTC
I have added H.J.'s patch to the rawhide binutils.

Fixed in: binutils-2.30-20.fc29

Comment 4 Jan Kurik 2018-08-14 11:19:21 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 29 development cycle.
Changing version to '29'.

Comment 5 Ben Cotton 2019-10-31 19:09:47 UTC
This message is a reminder that Fedora 29 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 29 on 2019-11-26.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '29'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 29 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 6 Ben Cotton 2019-11-27 22:47:49 UTC
Fedora 29 changed to end-of-life (EOL) status on 2019-11-26. Fedora 29 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.