From 3dfe7a8c3a88e7b06afe7f8b98d247de175bec99 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Sat, 5 Jan 2002 13:14:00 +0000 Subject: [PATCH] * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Make use of bfd_section_list_remove and bfd_section_list_insert macros. * emultempl/pe.em (gld_${EMULATION_NAME}_place_orphan): Likewise. * emultempl/mmo.em (mmo_place_orphan): Likewise. --- ld/ChangeLog | 7 +++++++ ld/emultempl/elf32.em | 11 +++-------- ld/emultempl/mmo.em | 11 +++-------- ld/emultempl/pe.em | 11 +++-------- 4 files changed, 16 insertions(+), 24 deletions(-) diff --git a/ld/ChangeLog b/ld/ChangeLog index d8e21b98939..431e19e5032 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,10 @@ +2002-01-05 Alan Modra + + * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Make use + of bfd_section_list_remove and bfd_section_list_insert macros. + * emultempl/pe.em (gld_${EMULATION_NAME}_place_orphan): Likewise. + * emultempl/mmo.em (mmo_place_orphan): Likewise. + 2002-01-04 Jason Thorpe * configure.tgt (x86_64-*-netbsd*): New target. diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em index d65923ad383..b2fd9694836 100644 --- a/ld/emultempl/elf32.em +++ b/ld/emultempl/elf32.em @@ -1270,18 +1270,13 @@ gld${EMULATION_NAME}_place_orphan (file, s) if (place->section != NULL) { - /* Unlink the section. */ + /* Unlink the section. */ for (pps = &output_bfd->sections; *pps != snew; pps = &(*pps)->next) ; - *pps = snew->next; - if (snew->next == NULL) - snew->owner->section_tail = pps; + bfd_section_list_remove (output_bfd, pps); /* Now tack it on to the "place->os" section list. */ - snew->next = *place->section; - *place->section = snew; - if (snew->next == NULL) - snew->owner->section_tail = &snew->next; + bfd_section_list_insert (output_bfd, place->section, snew); } /* Save the end of this list. Further ophans of this type will diff --git a/ld/emultempl/mmo.em b/ld/emultempl/mmo.em index f871dec8592..8fed0f6c940 100644 --- a/ld/emultempl/mmo.em +++ b/ld/emultempl/mmo.em @@ -159,18 +159,13 @@ mmo_place_orphan (file, s) /* Put orphans after the first section on the list. */ place->section = &bfd_section->next; - /* Unlink the section. */ + /* Unlink the section. */ for (pps = &output_bfd->sections; *pps != snew; pps = &(*pps)->next) ; - *pps = snew->next; - if (snew->next == NULL) - snew->owner->section_tail = pps; + bfd_section_list_remove (output_bfd, pps); /* Now tack it on to the "place->os" section list. */ - snew->next = *place->section; - *place->section = snew; - if (snew->next == NULL) - snew->owner->section_tail = &snew->next; + bfd_section_list_insert (output_bfd, place->section, snew); } place->section = &snew->next; /* Save the end of this list. */ diff --git a/ld/emultempl/pe.em b/ld/emultempl/pe.em index 0af1d76e9fa..2f0026959fc 100644 --- a/ld/emultempl/pe.em +++ b/ld/emultempl/pe.em @@ -1685,20 +1685,15 @@ gld_${EMULATION_NAME}_place_orphan (file, s) if (place->section != NULL) { - /* Unlink the section. */ + /* Unlink the section. */ for (pps = &output_bfd->sections; *pps != snew; pps = &(*pps)->next) ; - *pps = snew->next; - if (snew->next == NULL) - snew->owner->section_tail = pps; + bfd_section_list_remove (output_bfd, pps); /* Now tack it on to the "place->os" section list. */ - snew->next = *place->section; - *place->section = snew; - if (snew->next == NULL) - snew->owner->section_tail = &snew->next; + bfd_section_list_insert (output_bfd, place->section, snew); } /* Save the end of this list. Further ophans of this type will -- 2.30.2