This is an archive of the discontinued LLVM Phabricator instance.

[ELF] Define __start_XXX/__stop_XXX symbols where XXX is a section name
ClosedPublic

Authored by atanasyan on Jul 2 2015, 9:15 AM.

Details

Summary

This is GNU ELF linker extension used particularly by LibC code. If input object files contain section named XXX and the XXX is a valid C identifier, and there are undefined or weak symbols start_XXX/stop_XXX, linker should define start_XXX/stop_XXX symbols point to the begin/end of the XXX section correspondingly.

For example, without support of this extension statically linked executables for X86_64 and Mips (maybe other) targets do not flush IO buffers at the end of executing.

Diff Detail

Repository
rL LLVM

Event Timeline

atanasyan updated this revision to Diff 28956.Jul 2 2015, 9:15 AM
atanasyan retitled this revision from to [ELF] Define __start_XXX/__stop_XXX symbols where XXX is a section name.
atanasyan updated this object.
atanasyan set the repository for this revision to rL LLVM.
atanasyan added a project: lld.
atanasyan added a subscriber: llvm-commits.
ruiu accepted this revision.Jul 2 2015, 6:47 PM
ruiu edited edge metadata.

LGTM.

I'd think notifyInputSectionName is too generic as a name as this actually serves only one purpose (implementing this feature), but it's up to you.

This revision is now accepted and ready to land.Jul 2 2015, 6:47 PM
atanasyan closed this revision.Jul 3 2015, 4:29 AM

Thanks for review. I agree that the notifyInputSectionName is not the best name for the method but I could not invent anything better except very long variants.

Closed by commit rL241341.