This is an archive of the discontinued LLVM Phabricator instance.

[ELF2/LinkerScript] Support for SEARCH_DIR() directive
ClosedPublic

Authored by davide on Oct 7 2015, 6:03 PM.

Details

Reviewers
ruiu
Summary

Needed by FreeBSD base system.

Diff Detail

Event Timeline

davide updated this revision to Diff 36817.Oct 7 2015, 6:03 PM
davide retitled this revision from to [ELF2/LinkerScript] Support for SEARCH_DIR() directive.
davide updated this object.
davide added a reviewer: ruiu.
davide added subscribers: emaste, llvm-commits.
ruiu accepted this revision.Oct 7 2015, 6:29 PM
ruiu edited edge metadata.

LGTM with nits.

ELF/LinkerScript.cpp
169–170
Config->InputSearchPaths.push_back(next());
test/elf2/linkerscript.s
26

You don't unquote and quote here because /lib/foo/blah does not contain any variables unlike others.

echo "SEARCH_DIR(/lib/foo/blah)" > %t.script
This revision is now accepted and ready to land.Oct 7 2015, 6:29 PM
ruiu added inline comments.Oct 7 2015, 9:13 PM
test/elf2/linkerscript.s
26

Noticed that I misunderstood this test. Its testing double-quoted path name. Linker script doesn't distinguish them, so either

echo "SEARCH_DIR(/lib/foo/blah)" > %t.script

or

echo 'SEARCH_DIR("/lib/foo/blah")' > %t.script

is fine with me. This is not a test for the tokenizer after all. I'd just avoid using double quotes inside double quotes.

davide closed this revision.Oct 8 2015, 10:54 AM