Bug 29293 - [2.39 Regression] elfnn-aarch64.c: def_protected member unintialized
Summary: [2.39 Regression] elfnn-aarch64.c: def_protected member unintialized
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: ld (show other bugs)
Version: 2.39
: P2 normal
Target Milestone: ---
Assignee: Alan Modra
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-06-27 12:16 UTC by Pekka Seppänen
Modified: 2022-06-28 01:58 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments
aarch64: properly initialize def_protected member (267 bytes, patch)
2022-06-27 12:16 UTC, Pekka Seppänen
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pekka Seppänen 2022-06-27 12:16:52 UTC
Created attachment 14178 [details]
aarch64: properly initialize def_protected member

Hi.

"aarch64: Disallow copy relocations on protected data" [1] commit unfortunately does not initialize def_protected member.

This leads to spurious "copy relocation against non-copyable protected symbol" errors as def_protected member might not be touched (if definition is false) and the allocation routine (bfd_hash_allocate/objalloc_alloc) does not appear to zero initialize allocated space.

Attached a patch proposal.

[1] https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=90b7a5df152a64d2bea20beb438e8b81049a5c30
Comment 1 Sourceware Commits 2022-06-28 01:57:07 UTC
The master branch has been updated by Alan Modra <amodra@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=7c24bdc583511d7c98a37d77f5536a005075ff05

commit 7c24bdc583511d7c98a37d77f5536a005075ff05
Author: Pekka Seppänen <pexu@sourceware.mail.kapsi.fi>
Date:   Tue Jun 28 11:11:35 2022 +0930

    PR29293, elfnn-aarch64.c: def_protected member unintialized
    
            PR 29293
            * elfnn-aarch64.c (elfNN_aarch64_link_hash_newfunc): Init def_protected.
Comment 2 Alan Modra 2022-06-28 01:58:02 UTC
Thanks, I'd noticed the fails too but hadn't investigated.