diff options
author | Fangrui Song <maskray@google.com> | 2020-04-22 16:20:02 +0100 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2020-04-22 16:20:02 +0100 |
commit | 161719466ac9ea5f186514312f6bce842181804f (patch) | |
tree | 8f5243eadc4f7266ca8362b1da384e9a9aa057c6 /ld/ld.texi | |
parent | 31c89d6038f2658f5e06a762aa9e20e78e74651f (diff) | |
download | gdb-161719466ac9ea5f186514312f6bce842181804f.zip gdb-161719466ac9ea5f186514312f6bce842181804f.tar.gz gdb-161719466ac9ea5f186514312f6bce842181804f.tar.bz2 |
For relative paths in INPUT() and GROUP(), search the directory of the current linker script before searching other paths.
PR ld/25806
* ldlang.h (struct lang_input_statement_struct): Add extra_search_path.
* ldlang.c (current_input_file): New.
(ldirname): New.
(new_afile): Add from_filename parameter. Set extra_search_path.
(lang_add_input_file): Pass current_input_file to new_afile.
(load_symbols): Set current_input_file.
Diffstat (limited to 'ld/ld.texi')
-rw-r--r-- | ld/ld.texi | 17 |
1 files changed, 10 insertions, 7 deletions
@@ -3657,13 +3657,16 @@ script, and then invoke the linker with nothing but a @samp{-T} option. In case a @dfn{sysroot prefix} is configured, and the filename starts with the @samp{/} character, and the script being processed was located inside the @dfn{sysroot prefix}, the filename will be looked -for in the @dfn{sysroot prefix}. Otherwise, the linker will try to -open the file in the current directory. If it is not found, the -linker will search through the archive library search path. -The @dfn{sysroot prefix} can also be forced by specifying @code{=} -as the first character in the filename path, or prefixing the filename -path with @code{$SYSROOT}. See also the description of @samp{-L} in -@ref{Options,,Command-line Options}. +for in the @dfn{sysroot prefix}. The @dfn{sysroot prefix} can also be forced by specifying +@code{=} as the first character in the filename path, or prefixing the +filename path with @code{$SYSROOT}. See also the description of +@samp{-L} in @ref{Options,,Command-line Options}. + +If a @dfn{sysroot prefix} is not used then the linker will try to open +the file in the directory containing the linker script. If it is not +found the linker will then search the current directory. If it is still +not found the linker will search through the archive library search +path. If you use @samp{INPUT (-l@var{file})}, @command{ld} will transform the name to @code{lib@var{file}.a}, as with the command-line argument |