summaryrefslogtreecommitdiffstats
path: root/bfd/xcofflink.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2005-05-03 17:05:51 +0000
committerAlan Modra <amodra@gmail.com>2005-05-03 17:05:51 +0000
commit04dd1667401316be04feb97696399d0728b63bf6 (patch)
tree849dce115776a1595762ea91b3fc857ea24673fb /bfd/xcofflink.c
parentc1d05a606c3ae775523d364d3aa185ba1dd7ab46 (diff)
downloadppe42-binutils-04dd1667401316be04feb97696399d0728b63bf6.tar.gz
ppe42-binutils-04dd1667401316be04feb97696399d0728b63bf6.zip
* section.c (bfd_section_list_remove): Don't clear s->next.
(bfd_section_list_append): Always init s->prev. (bfd_section_list_prepend): Define. (bfd_section_list_insert_after): Minor optimization. (bfd_section_removed_from_list): Rewrite. * elf.c (assign_section_numbers): Simplify list traversal now that bfd_section_list_remove doesn't destroy removed section next ptr. * sunos.c (sunos_add_dynamic_symbols): Likewise. * elfxx-ia64.c (elfNN_ia64_object_p): Use bfd_section_list_prepend. * xcofflink.c (_bfd_xcoff_bfd_final_link): Simplify list traversal. * bfd-in2.h: Regenerate.
Diffstat (limited to 'bfd/xcofflink.c')
-rw-r--r--bfd/xcofflink.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/bfd/xcofflink.c b/bfd/xcofflink.c
index 127ac3d67d..c72507edfa 100644
--- a/bfd/xcofflink.c
+++ b/bfd/xcofflink.c
@@ -5436,19 +5436,18 @@ _bfd_xcoff_bfd_final_link (bfd *abfd, struct bfd_link_info *info)
{
bfd_boolean saw_contents;
int indx;
- asection **op;
file_ptr sofar;
/* Insert .pad sections before every section which has
contents and is loaded, if it is preceded by some other
section which has contents and is loaded. */
saw_contents = TRUE;
- for (op = &abfd->sections; *op != NULL; op = &(*op)->next)
+ for (o = abfd->sections; o != NULL; o = o->next)
{
- if (strcmp ((*op)->name, ".pad") == 0)
+ if (strcmp (o->name, ".pad") == 0)
saw_contents = FALSE;
- else if (((*op)->flags & SEC_HAS_CONTENTS) != 0
- && ((*op)->flags & SEC_LOAD) != 0)
+ else if ((o->flags & SEC_HAS_CONTENTS) != 0
+ && (o->flags & SEC_LOAD) != 0)
{
if (! saw_contents)
saw_contents = TRUE;
@@ -5465,9 +5464,7 @@ _bfd_xcoff_bfd_final_link (bfd *abfd, struct bfd_link_info *info)
n->alignment_power = 0;
bfd_section_list_remove (abfd, n);
- bfd_section_list_insert_before (abfd, *op, n);
-
- op = &n->next;
+ bfd_section_list_insert_before (abfd, o, n);
saw_contents = FALSE;
}
}
OpenPOWER on IntegriCloud