This is an archive of the discontinued LLVM Phabricator instance.

[ELF] - Implement -z nodefaultlib
ClosedPublic

Authored by grimar on Nov 15 2018, 5:27 AM.

Details

Summary

This is https://bugs.llvm.org//show_bug.cgi?id=38978.

Spec says that:

Objects may be built with the -z nodefaultlib option to suppress any search of the default locations at runtime.
Use of this option implies that all the dependencies of an object can be located using its runpaths.
Without this option, which is the most common case, no matter how you augment the runtime linker's library
search path, its last element is always /usr/lib for 32-bit objects and /usr/lib/64 for 64-bit objects.

(https://www.shrubbery.net/solaris9ab/SUNWdev/LLM/p4.html#CHAPTER2-84569)

The patch implements this option.

Diff Detail

Event Timeline

grimar created this revision.Nov 15 2018, 5:27 AM
emaste added inline comments.Nov 22 2018, 4:06 PM
docs/ld.lld.1
501

looks like the rest of this sentence is missing - e.g.
Set the DF_1_NODEFLIB flag to ...

grimar updated this revision to Diff 175086.Nov 23 2018, 12:04 AM
  • Addressed review comment.
docs/ld.lld.1
501

Thanks!

ruiu accepted this revision.Nov 26 2018, 10:12 AM

LGTM

docs/ld.lld.1
502

path -> paths

This revision is now accepted and ready to land.Nov 26 2018, 10:12 AM
This revision was automatically updated to reflect the committed changes.