This is an archive of the discontinued LLVM Phabricator instance.

[llvm-objcopy] --weaken-symbol/--weaken: weaken STB_GNU_UNIQUE symbols
ClosedPublic

Authored by MaskRay on Feb 27 2022, 5:20 PM.

Details

Summary

STB_GNU_UNIQUE is like STB_GLOBAL with extra semantics:

  • gold and ld.lld: changed to STB_GLOBAL if --no-gnu-unique is specified
  • glibc: unique even with dlopen RTLD_LOCAL, implies DF_1_NODELETE

Therefore, I think it makes sense for --weaken-symbol/--weaken-symbols/--weaken
to change STB_GNU_UNIQUE symbols.

binutils 2.39 will have the same behavior: https://sourceware.org/bugzilla/show_bug.cgi?id=28926

Diff Detail

Event Timeline

MaskRay created this revision.Feb 27 2022, 5:20 PM
MaskRay requested review of this revision.Feb 27 2022, 5:20 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 27 2022, 5:20 PM
jhenderson accepted this revision.Feb 28 2022, 1:12 AM

Looks good iff the GNU side are happy with the behaviour change.

This revision is now accepted and ready to land.Feb 28 2022, 1:12 AM
MaskRay added a comment.EditedMar 11 2022, 11:29 AM

Looks good iff the GNU side are happy with the behaviour change.

They haven't responded yet: https://sourceware.org/pipermail/binutils/2022-March/119961.html
I am inclined to land this instead of keep waiting.

Herald added a project: Restricted Project. · View Herald TranscriptMar 11 2022, 11:29 AM

Looks good iff the GNU side are happy with the behaviour change.

They haven't responded yet: https://sourceware.org/pipermail/binutils/2022-March/119961.html
I am inclined to land this instead of keep waiting.

I'm not. llvm-objcopy promises to match the behaviour of GNU objcopy except for where he GNU behaviour doesn't make sense. This doesn't fall into that exception, in my opinion (yes, what you're doing is not unreasonable, but the old behaviour is not nonsense).

MaskRay edited the summary of this revision. (Show Details)Mar 16 2022, 9:45 AM

binutils 2.39 will have the same behavior: https://sourceware.org/bugzilla/show_bug.cgi?id=28926

This revision was landed with ongoing or failed builds.Mar 16 2022, 9:48 AM
This revision was automatically updated to reflect the committed changes.