Bug 1935785

Summary: Linker garbage collection removes weak alias references (possibly "regression" of bz1804325)
Product: Red Hat Enterprise Linux 8 Reporter: Miloš Prchlík <mprchlik>
Component: binutilsAssignee: Nick Clifton <nickc>
binutils sub component: system-version QA Contact: Miloš Prchlík <mprchlik>
Status: CLOSED ERRATA Docs Contact:
Severity: unspecified    
Priority: unspecified CC: fweimer, mprchlik, ohudlick
Version: 8.4Keywords: Bugfix, Triaged
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: binutils-2.30-97.el8 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-11-09 19:31:20 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 Miloš Prchlík 2021-03-05 14:29:56 UTC
Description of problem:

Reproducer provided by https://bugzilla.redhat.com/show_bug.cgi?id=1804325#c0 triggers for binutils-2.30-93.el8. The bug was concerned with Developer Toolset binutils build, I assume that was caused by DTS binutils being affected while system binutils were "too old" - now when system binutils caught up, NVR-wise, is the fix needed here as well?


[root@ci-vm-10-0-137-76 ~]# rpm -q binutils
binutils-2.30-93.el8.x86_64
[root@ci-vm-10-0-137-76 ~]# cat environ.c
#include <stdio.h>

extern char **environ;
int main(int argc, char **argv) {
  printf("%p\n", environ);
  return 0;
}
[root@ci-vm-10-0-137-76 ~]# gcc -o environ environ.c && readelf -s environ | grep " _environ"
     6: 0000000000601040     8 OBJECT  WEAK   DEFAULT   24 _environ.5 (2)
[root@ci-vm-10-0-137-76 ~]# gcc -Wl,--gc-sections -o environ environ.c && readelf -s environ | grep " _environ"
[root@ci-vm-10-0-137-76 ~]# 



Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Nick Clifton 2021-03-09 12:10:38 UTC
The fix is not in the baseOS version of the binutils for RHEL-8.  Hence a patch is needed.

Comment 4 Nick Clifton 2021-03-19 14:25:57 UTC
Fixed in binutils-2.30-96.el8

Comment 7 Nick Clifton 2021-03-24 12:03:18 UTC
Fixed in binutils-2.30-97.el8

Comment 11 Miloš Prchlík 2021-04-01 11:10:17 UTC
Verified with binutils-2.30-98.el8

Comment 14 errata-xmlrpc 2021-11-09 19:31:20 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: binutils security update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2021:4364