Skip to content

[SR-15376] Duplicate "__PROTOCOL_*" metadata in linked binaries #57698

@swift-ci

Description

@swift-ci
Previous ID SR-15376
Radar None
Original Reporter alxb (JIRA User)
Type Bug
Additional Detail from JIRA
Votes 0
Component/s
Labels Bug
Assignee None
Priority Medium

md5: 9d567090a81023015bb0128b792a70ec

Issue Description:

Some binaries show duplicate entries such as:

__PROTOCOL_NSObject

along with all descending linked metadata.

The Issue seems to be coming from GenClass.cpp#L1396 where, a global is created with internal linkage: GenClass.cpp#L2181. Because of the internal linkage, the linker will not merge identical records in the final output.

The fix seems to be updating the linkage to WeakAnyLinkage, as in ObjC
CGObjCMac.cpp#L6967

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions