gas .include and .incbin
authorAlan Modra <amodra@gmail.com>
Sun, 12 Mar 2023 02:57:38 +0000 (13:27 +1030)
committerAlan Modra <amodra@gmail.com>
Tue, 14 Mar 2023 01:44:32 +0000 (12:14 +1030)
commitadb9ac5f3984b4ad2d8be1550dc5683d6129e1a6
treef0c3287356bda7212583c29ef9b1dedc5a4244a5
parenta2aee680684ec8c79bbdc169d73fe5111e8e9a64
gas .include and .incbin

This fixes a bug in .include and .incbin where given an absolute path
the -I dirs would be searched for the path.

* read.c (include_dir_count, include_dir_maxlen): Make them size_t.
(search_and_open): New function.
(s_incbin, s_include): Use search_and_open.
(init_include_dir): New function.
(add_include_dir): Don't set initial "." dir here.
* read.h (include_dir_count, include_dir_maxlen): Update.
(init_include_dir, search_and_open): Declare.
* as.c (gas_early_init): Call init_include_dir.
* config/tc-rx.c (rx_include): Avoid warning by using size_t.
* config/tc-tic54x.c (tic54x_set_default_include): Simplify and
use notes for include path.
(tic54x_mlib): Use search_and_open.
gas/as.c
gas/config/tc-rx.c
gas/config/tc-tic54x.c
gas/read.c
gas/read.h