This is an archive of the discontinued LLVM Phabricator instance.

ELF: Simplify handling of *_start/*_end symbols.
ClosedPublic

Authored by pcc on Oct 12 2016, 7:33 PM.

Details

Summary

We were previously using the (static) addSynthetic function to create
*_start/*_end symbols. This function was doing almost the same thing as
addOptionalSynthetic, except that it would also create the symbol in the
case where it is unreferenced. Because the symbol has hidden visibility,
creating it in that case would have no effect other than adding another
entry to the static symbol table. Remove addSynthetic and change callers to
use addOptionalSynthetic instead.

Diff Detail

Repository
rL LLVM

Event Timeline

pcc updated this revision to Diff 74470.Oct 12 2016, 7:33 PM
pcc retitled this revision from to ELF: Simplify handling of *_start/*_end symbols..
pcc updated this object.
pcc added a reviewer: ruiu.
pcc added a subscriber: llvm-commits.

My memory about it is not clear, but I think there was a reason to add addSynethic function. Eugene may know about that.

Eugene.Zelenko added a subscriber: evgeny777.

Probably you meant @evgeny777?

ruiu added a comment.Oct 13 2016, 2:44 PM

Ah, yes, sorry about that.

addSynthetic() was introduced to allow defining start/end symbols in linker scripts

Please take a look at
https://reviews.llvm.org/D23405

ruiu accepted this revision.Oct 24 2016, 1:30 PM
ruiu edited edge metadata.

LGTM.

Eugene, if you have any comment, please leave a comment as a post-commit review.

This revision is now accepted and ready to land.Oct 24 2016, 1:30 PM
This revision was automatically updated to reflect the committed changes.