diff options
author | Alan Modra <amodra@gmail.com> | 2023-03-12 13:27:38 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2023-03-14 12:14:32 +1030 |
commit | adb9ac5f3984b4ad2d8be1550dc5683d6129e1a6 (patch) | |
tree | f0c3287356bda7212583c29ef9b1dedc5a4244a5 /gas/config/tc-rx.c | |
parent | a2aee680684ec8c79bbdc169d73fe5111e8e9a64 (diff) | |
download | fsf-binutils-gdb-adb9ac5f3984b4ad2d8be1550dc5683d6129e1a6.zip fsf-binutils-gdb-adb9ac5f3984b4ad2d8be1550dc5683d6129e1a6.tar.gz fsf-binutils-gdb-adb9ac5f3984b4ad2d8be1550dc5683d6129e1a6.tar.bz2 |
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.
Diffstat (limited to 'gas/config/tc-rx.c')
-rw-r--r-- | gas/config/tc-rx.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/gas/config/tc-rx.c b/gas/config/tc-rx.c index 36b7f0b..c011ec1 100644 --- a/gas/config/tc-rx.c +++ b/gas/config/tc-rx.c @@ -380,9 +380,7 @@ rx_include (int ignore) if (try == NULL) { - int i; - - for (i = 0; i < include_dir_count; i++) + for (size_t i = 0; i < include_dir_count; i++) { sprintf (path, "%s/%s", include_dirs[i], f); if ((try = fopen (path, FOPEN_RT)) != NULL) |