This is an archive of the discontinued LLVM Phabricator instance.

ELFObjectWriter: Allow one unique symver per symbol
ClosedPublic

Authored by vlad.tsyrklevich on Apr 19 2018, 3:51 PM.

Details

Summary

Only allow a single unique .symver alias per symbol. This matches the
behavior of gas. I noticed that we ignored multiple mismatched symver
directives looking at https://reviews.llvm.org/D45798

Diff Detail

Event Timeline

pcc accepted this revision.Apr 26 2018, 11:48 AM

LGTM

lib/MC/ELFObjectWriter.cpp
423

Nit: I think line 423-427 can be written with one insert:

if (Renames.insert(std::make_pair(&Symbol, Alias)).first->second != Alias) report_fatal_error(...);

Maybe a little too terse though.

This revision is now accepted and ready to land.Apr 26 2018, 11:48 AM
This revision was automatically updated to reflect the committed changes.
shkhln added a subscriber: shkhln.EditedNov 8 2019, 5:26 AM

Was this really necessary? For what it's worth, there is now an enhancement request on the Sourceware bug tracker regarding gas behavior: https://sourceware.org/bugzilla/show_bug.cgi?id=23840.

Herald added a project: Restricted Project. · View Herald TranscriptNov 8 2019, 5:26 AM