This is an archive of the discontinued LLVM Phabricator instance.

lld: add -z nodump support
AbandonedPublic

Authored by emaste on Sep 14 2018, 7:56 AM.

Details

Summary

-z nodump sets the DF_1_NODUMP flag, marking the object as not dumpable by the runtime linker's dldump().

FreeBSD does not support dldump() and ignores the DF_1_NODUMP flag; I am not sure about support in any other operating systems outside of Solaris derivatives. That said, some third-party software sets the flag in its build, and it is trivial to support in lld.

Found via FreeBSD PR 230603, kstars failed to link with lld.

NOTE: In contrast to -z interpose I am not sure how useful this flag really is. If this change is not desired we'll make requests upstream to drop the flag in the link invocations.

Diff Detail

Event Timeline

emaste created this revision.Sep 14 2018, 7:56 AM
NOTE: In contrast to -z interpose I am not sure how useful this flag really is. If this change is not desired we'll make requests upstream to drop the flag in the link invocations.

I'll leave it to Rui to decide then.

markj added a comment.Sep 14 2018, 8:32 AM

dldump() was supposedly added to Solaris to support emacs: http://lists.gnu.org/archive/html/emacs-devel/2016-01/msg01022.html

It's not implemented by any other OS as far as I can see. I can't imagine that -z nodump sees much legitimate use these days.

Thanks for finding that Mark - based on that IMO this feature is not worth supporting.

ruiu added a comment.Sep 14 2018, 9:28 AM

If no one really wants this, maybe you should abandon it.

emaste abandoned this revision.Sep 14 2018, 10:31 AM

Agreed - when I submitted it I thought it might be uncommon but worth supporting, but the evidence Mark found suggests it is a single-purpose feature that is not relevant to the platforms lld supports.