Bug 1960667

Summary: binutils: Less corruption with weak symbols in dynamic links on ppc64le
Product: Red Hat Enterprise Linux 9 Reporter: Florian Weimer <fweimer>
Component: binutilsAssignee: Nick Clifton <nickc>
binutils sub component: system-version QA Contact: Miloš Prchlík <mprchlik>
Status: CLOSED CURRENTRELEASE Docs Contact:
Severity: medium    
Priority: high CC: fweimer, mprchlik, ohudlick
Version: 9.0Keywords: Bugfix, Triaged
Target Milestone: beta   
Target Release: ---   
Hardware: ppc64le   
OS: Unspecified   
Whiteboard:
Fixed In Version: binutils-2.35.2-4.el9 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of:
: 1960730 (view as bug list) Environment:
Last Closed: 2021-12-07 21:35:16 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:
Bug Depends On: 1960730    
Bug Blocks: 1958224    

Description Florian Weimer 2021-05-14 14:27:34 UTC
Would it be possible to backport this upstream commit?

Without it, recent bison built on ppc64le will not run on glibc 2.34 because undefined weak symbols get corrupted during dynamic linking (and gnulib contains such symbols for libpthread references).

commit b293661219c36e72acb80502a86b51160bb88cfd
Author: Alan Modra <amodra>
Date:   Mon May 3 10:03:06 2021 +0930

    PPC: ensure_undef_dynamic on weak undef only in plt
    
    It's slightly weird to have a call to a weak function not protected by
    a test of that function being non-NULL, but the non-NULL test might be
    covered by a test of another function.  For example:
      if (func1)
        {
          func1 ();
          func2 ();
        }
    where func2 is known to exist if func1 exists.
    
            * elf32-ppc.c (allocate_dynrelocs): Call ensure_undef_dynamic for
            weak undefined symols that only appear on PLT relocs.
            * elf64-ppc.c (allocate_dynrelocs): Likewise.


It would be nice to backport this soon, so that we can rebuild affected packages with the new binutils.

Comment 1 Nick Clifton 2021-05-18 14:57:17 UTC
Fixed in binutils-2.35.2-4.el9_0_0