This is an archive of the discontinued LLVM Phabricator instance.

[ELF] for symver directives, preserve the given symbol's size
ClosedPublic

Authored by aeden on Jul 28 2020, 12:26 PM.

Details

Summary

A versioned symbol alias created by .symver should copy the size from the source symbol, since it may be used by R_X86_64_COPY and the like.

Diff Detail

Event Timeline

aeden created this revision.Jul 28 2020, 12:26 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 28 2020, 12:26 PM
aeden requested review of this revision.Jul 28 2020, 12:26 PM
MaskRay added a comment.EditedJul 28 2020, 2:32 PM

Can you add a test to test/MC/ELF/symver.s?
I can add one and commit it on your behalf if you don't have commit access

aeden updated this revision to Diff 281440.Jul 28 2020, 6:14 PM

Updated to include llvm/test/MC/ELF/symver.s modifications

MaskRay added inline comments.Jul 28 2020, 9:12 PM
llvm/test/MC/ELF/symver.s
26

You can set the size of global1 instead of adding a new symbol

aeden updated this revision to Diff 282267.Jul 31 2020, 10:54 AM

Updated to use existing global1 in llvm/test/MC/ELF/symver.s

MaskRay accepted this revision.Jul 31 2020, 11:37 AM

LGTM.

This revision is now accepted and ready to land.Jul 31 2020, 11:37 AM
aeden added a comment.Jan 9 2021, 8:19 PM

Ping. Would love to see this in an upcoming release.

MaskRay closed this revision.Feb 22 2021, 10:51 PM

I think st_size is already correct. Please see line 544 if (!ESize && Base) ESize = Base->getSize();