From 420e579cc4f1252a4e915ad866b49f76bda0c1cd Mon Sep 17 00:00:00 2001 From: Hans-Peter Nilsson Date: Sat, 11 Oct 2003 09:16:20 +0000 Subject: * ld.texinfo (Builtin Functions) : Say that only symbols defined before the statement using DEFINED yield 1. * ldexp.c (fold_name) : In lang_first_phase_enum, call lang_track_definedness on symbol. In subsequent phases, use lang_symbol_definition_iteration and lang_statement_iteration to check whether the symbol was defined before the current statement. (exp_fold_tree) : Call lang_update_definedness before updating symbol type when setting symbol. * ldlang.c (lang_definedness_table): New variable. (lang_definedness_newfunc, lang_track_definedness) (lang_symbol_definition_iteration, lang_update_definedness): New functions. (lang_init): Initialize lang_definedness_table and lang_statement_iteration. (lang_finish): Destroy bfd_hash_table_free. (lang_size_sections): Increment lang_statement_iteration. (lang_do_assignments_1): New function with former lang_do_assignments contents. Change recursive calls to call this function. (lang_do_assignments): Evacuate contents. Increment lang_statement_iteration, then just call lang_do_assignments_1. * ldlang.h (struct lang_definedness_hash_entry) (lang_statement_iteration, lang_track_definedness) (lang_symbol_definition_iteration, lang_update_definedness): Declare. --- ld/ld.texinfo | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'ld/ld.texinfo') diff --git a/ld/ld.texinfo b/ld/ld.texinfo index b01a105..1713294 100644 --- a/ld/ld.texinfo +++ b/ld/ld.texinfo @@ -4452,7 +4452,8 @@ evaluation purposes. @kindex DEFINED(@var{symbol}) @cindex symbol defaults Return 1 if @var{symbol} is in the linker global symbol table and is -defined, otherwise return 0. You can use this function to provide +defined before the statement using DEFINED in the script, otherwise +return 0. You can use this function to provide default values for symbols. For example, the following script fragment shows how to set a global symbol @samp{begin} to the first location in the @samp{.text} section---but if a symbol called @samp{begin} already -- cgit v1.1