diff options
author | Alan Modra <amodra@gmail.com> | 2005-05-03 17:08:43 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2005-05-03 17:08:43 +0000 |
commit | 698527983f3f2375a4e49264fef52dafe3ece00c (patch) | |
tree | f5f9d696ba01bcfc9ccdaf83ec15d23d7e543042 /gas/config/obj-ecoff.c | |
parent | 04dd1667401316be04feb97696399d0728b63bf6 (diff) | |
download | gdb-698527983f3f2375a4e49264fef52dafe3ece00c.zip gdb-698527983f3f2375a4e49264fef52dafe3ece00c.tar.gz gdb-698527983f3f2375a4e49264fef52dafe3ece00c.tar.bz2 |
* config/obj-ecoff.c (ecoff_frob_file_before_fix): Correct section
list traversal. Use bfd_section_list_prepend.
* config/tc-mmix.c (mmix_frob_file): Don't needlessly iterate
over the section list.
* config/tc-xtensa.c (xtensa_remove_section): Delete.
(xtensa_insert_section): Delete.
(xtensa_move_seg_list_to_beginning): Use bfd_section_list_remove
and bfd_section_list_prepend.
(xtensa_reorder_seg_list): Use bfd_section_list_remove and
bfd_section_list_insert_after.
Diffstat (limited to 'gas/config/obj-ecoff.c')
-rw-r--r-- | gas/config/obj-ecoff.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/gas/config/obj-ecoff.c b/gas/config/obj-ecoff.c index 6bfb79e..7a1e29f 100644 --- a/gas/config/obj-ecoff.c +++ b/gas/config/obj-ecoff.c @@ -37,7 +37,7 @@ void ecoff_frob_file_before_fix (void) { bfd_vma addr; - asection **sec; + asection *sec; /* Set the section VMA values. We force the .sdata and .sbss sections to the end to ensure that their VMA addresses are close @@ -80,20 +80,19 @@ ecoff_frob_file_before_fix (void) for (i = 0; i < n_names; i++) secs[i] = NULL; - for (sec = &stdoutput->sections; *sec != NULL;) + for (sec = stdoutput->sections; sec != NULL; sec = sec->next) { for (i = 0; i < n_names; i++) - if (!strcmp ((*sec)->name, names[i])) + if (!strcmp (sec->name, names[i])) { - secs[i] = *sec; - bfd_section_list_remove (stdoutput, *sec); + secs[i] = sec; + bfd_section_list_remove (stdoutput, sec); break; } if (i == n_names) { - bfd_set_section_vma (stdoutput, *sec, addr); - addr += bfd_section_size (stdoutput, *sec); - sec = &(*sec)->next; + bfd_set_section_vma (stdoutput, sec, addr); + addr += bfd_section_size (stdoutput, sec); } } for (i = 0; i < n_names; i++) @@ -104,7 +103,7 @@ ecoff_frob_file_before_fix (void) } for (i = n_names - 1; i >= 0; i--) if (secs[i]) - bfd_section_list_insert_after (stdoutput, stdoutput->sections, secs[i]); + bfd_section_list_prepend (stdoutput, secs[i]); /* Fill in the register masks. */ { |