From 7c6beb69886dccfb3cd3efbb5e966683936f6eac Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Sat, 5 Jan 2002 13:13:18 +0000 Subject: * write.c (write_object_file): Make use of bfd_section_list_remove. * config/obj-ecoff.c (ecoff_frob_file): Likewise. * config/tc-mmix.c (mmix_frob_file): Likewise. --- gas/write.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'gas/write.c') diff --git a/gas/write.c b/gas/write.c index 55db85a..9b20f90 100644 --- a/gas/write.c +++ b/gas/write.c @@ -1507,22 +1507,18 @@ write_object_file () #ifdef BFD_ASSEMBLER /* Remove the sections created by gas for its own purposes. */ { - asection **seclist, *sec; + asection **seclist; int i; seclist = &stdoutput->sections; - while (seclist && *seclist) + while (*seclist) { - sec = *seclist; - while (sec == reg_section || sec == expr_section) + if (*seclist == reg_section || *seclist == expr_section) { - sec = sec->next; - *seclist = sec; + bfd_section_list_remove (stdoutput, seclist); stdoutput->section_count--; - if (!sec) - break; } - if (*seclist) + else seclist = &(*seclist)->next; } i = 0; -- cgit v1.1