diff options
author | Alan Modra <amodra@gmail.com> | 2001-11-20 15:31:10 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2001-11-20 15:31:10 +0000 |
commit | 2181f54fd8bcebf21905b3fc5cff5e8acfeab641 (patch) | |
tree | a22e6f172f7e90bb32b7cabe3502c0584b0431ec /ld/ldlang.c | |
parent | ca0b584738aaf9f36d8d19b850e4231188c5bf8e (diff) | |
download | gdb-2181f54fd8bcebf21905b3fc5cff5e8acfeab641.zip gdb-2181f54fd8bcebf21905b3fc5cff5e8acfeab641.tar.gz gdb-2181f54fd8bcebf21905b3fc5cff5e8acfeab641.tar.bz2 |
* ldlang.c (walk_wild_section): Move sec == NULL case out of loop.
Diffstat (limited to 'ld/ldlang.c')
-rw-r--r-- | ld/ldlang.c | 53 |
1 files changed, 25 insertions, 28 deletions
diff --git a/ld/ldlang.c b/ld/ldlang.c index 40f109a..fa52475 100644 --- a/ld/ldlang.c +++ b/ld/ldlang.c @@ -251,47 +251,44 @@ walk_wild_section (ptr, file, callback, data) struct wildcard_list *sec; sec = ptr->section_list; - do + if (sec == NULL) + (*callback) (ptr, sec, s, file, data); + + while (sec != NULL) { boolean skip = false; + struct name_list *list_tmp; - if (sec != NULL) + /* Don't process sections from files which were + excluded. */ + for (list_tmp = sec->spec.exclude_name_list; + list_tmp; + list_tmp = list_tmp->next) { - struct name_list *list_tmp; - - /* Don't process sections from files which were - excluded. */ - for (list_tmp = sec->spec.exclude_name_list; - list_tmp; - list_tmp = list_tmp->next) - { - if (wildcardp (list_tmp->name)) - skip = fnmatch (list_tmp->name, file->filename, 0) == 0; - else - skip = strcmp (list_tmp->name, file->filename) == 0; + if (wildcardp (list_tmp->name)) + skip = fnmatch (list_tmp->name, file->filename, 0) == 0; + else + skip = strcmp (list_tmp->name, file->filename) == 0; - if (skip) - break; - } + if (skip) + break; + } - if (!skip && sec->spec.name != NULL) - { - const char *sname = bfd_get_section_name (file->the_bfd, s); + if (!skip && sec->spec.name != NULL) + { + const char *sname = bfd_get_section_name (file->the_bfd, s); - if (wildcardp (sec->spec.name)) - skip = fnmatch (sec->spec.name, sname, 0) != 0; - else - skip = strcmp (sec->spec.name, sname) != 0; - } + if (wildcardp (sec->spec.name)) + skip = fnmatch (sec->spec.name, sname, 0) != 0; + else + skip = strcmp (sec->spec.name, sname) != 0; } if (!skip) (*callback) (ptr, sec, s, file, data); - if (sec != NULL) - sec = sec->next; + sec = sec->next; } - while (sec != NULL); } } |