aboutsummaryrefslogtreecommitdiff
path: root/gas/read.h
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2023-03-12 13:27:38 +1030
committerAlan Modra <amodra@gmail.com>2023-03-14 12:14:32 +1030
commitadb9ac5f3984b4ad2d8be1550dc5683d6129e1a6 (patch)
treef0c3287356bda7212583c29ef9b1dedc5a4244a5 /gas/read.h
parenta2aee680684ec8c79bbdc169d73fe5111e8e9a64 (diff)
downloadgdb-adb9ac5f3984b4ad2d8be1550dc5683d6129e1a6.zip
gdb-adb9ac5f3984b4ad2d8be1550dc5683d6129e1a6.tar.gz
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/read.h')
-rw-r--r--gas/read.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/gas/read.h b/gas/read.h
index 406b026..42efce9 100644
--- a/gas/read.h
+++ b/gas/read.h
@@ -79,8 +79,8 @@ extern const char line_separator_chars[];
/* Table of -I directories. */
extern const char **include_dirs;
-extern int include_dir_count;
-extern int include_dir_maxlen;
+extern size_t include_dir_count;
+extern size_t include_dir_maxlen;
/* The offset in the absolute section. */
extern addressT abs_section_offset;
@@ -124,7 +124,9 @@ extern unsigned int next_char_of_string (void);
extern void s_mri_sect (char *);
extern char *mri_comment_field (char *);
extern void mri_comment_end (char *, int);
-extern void add_include_dir (char *path);
+extern void init_include_dir (void);
+extern void add_include_dir (char *);
+extern FILE *search_and_open (const char *, char *);
extern void cons (int nbytes);
extern void demand_empty_rest_of_line (void);
extern void emit_expr (expressionS *exp, unsigned int nbytes);