Rewrite add_sysroot
authorAlan Modra <amodra@gmail.com>
Sat, 11 Mar 2017 12:27:29 +0000 (22:57 +1030)
committerAlan Modra <amodra@gmail.com>
Sat, 11 Mar 2017 13:10:20 +0000 (23:40 +1030)
commit316a1245fe31e327223ca66797b789eaf9544c2c
tree0cf7c4a5336153b9d0636c5f8d7726b59b75c970
parent4aef764338ed40a7fa9573b0e6e2ade817acd688
Rewrite add_sysroot

Relative paths shouldn't have the sysroot prefix added.  The patch
also makes some attempt at supporting DOS paths, and tidies code using
the new add_sysroot.

* emultempl/elf32.em (gld${EMULATION_NAME}_add_sysroot): Rewrite.
Only prefix absolute paths with sysroot.  Handle DOS paths.
(gld${EMULATION_NAME}_check_ld_elf_hints): Constify variable.
(gld${EMULATION_NAME}_check_ld_so_conf): Likewise.
(gld${EMULATION_NAME}_after_open): Short-circuit NULL path
searches.  Rename variable.  Simplify get_runpath search.
ld/ChangeLog
ld/emultempl/elf32.em