From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1562 invoked by alias); 3 May 2005 12:11:39 -0000 Mailing-List: contact binutils-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sources.redhat.com Received: (qmail 24769 invoked from network); 3 May 2005 12:02:03 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 3 May 2005 12:02:03 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.11) with ESMTP id j43C23pa028795 for ; Tue, 3 May 2005 08:02:03 -0400 Received: from pobox.surrey.redhat.com (pobox.surrey.redhat.com [172.16.10.17]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id j43C22O23668 for ; Tue, 3 May 2005 08:02:02 -0400 Received: from localhost.localdomain.redhat.com (vpnuser2.surrey.redhat.com [172.16.9.2]) by pobox.surrey.redhat.com (8.12.8/8.12.8) with ESMTP id j43C1xkk023343 for ; Tue, 3 May 2005 13:02:00 +0100 To: binutils@sources.redhat.com Subject: Fixup references to bfd_section_list... macros From: Nick Clifton Date: Tue, 03 May 2005 12:11:00 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2005-05/txt/msg00055.txt.bz2 Hi Guys, H.J.'s recent patch to update the bfd_section_list manipulation macros fixed a few small cases in the gas directory. So I am going to apply the patch below to fix them. Cheers Nick gas/ChangeLog 2005-05-03 Nick Clifton * config/obj-ecoff.c (ecoff_frob_file_before_fix): Fix invocations of bfd_section_list... macros. * config/tc-mmix.c (mmix_frob_file): Likewise. * config/tc-xtensa.c (xtensa_remove_section): Likewise. (xtensa_insert_section): Likewise. Index: gas/config/obj-ecoff.c =================================================================== RCS file: /cvs/src/src/gas/config/obj-ecoff.c,v retrieving revision 1.13 diff -c -3 -p -r1.13 obj-ecoff.c *** gas/config/obj-ecoff.c 24 Mar 2005 20:40:25 -0000 1.13 --- gas/config/obj-ecoff.c 3 May 2005 11:55:43 -0000 *************** ecoff_frob_file_before_fix (void) *** 78,84 **** addr = 0; for (i = 0; i < n_names; i++) ! secs[i] = 0; for (sec = &stdoutput->sections; *sec != NULL;) { --- 78,84 ---- addr = 0; for (i = 0; i < n_names; i++) ! secs[i] = NULL; for (sec = &stdoutput->sections; *sec != NULL;) { *************** ecoff_frob_file_before_fix (void) *** 86,92 **** if (!strcmp ((*sec)->name, names[i])) { secs[i] = *sec; ! bfd_section_list_remove (stdoutput, sec); break; } if (i == n_names) --- 86,92 ---- if (!strcmp ((*sec)->name, names[i])) { secs[i] = *sec; ! bfd_section_list_remove (stdoutput, *sec); break; } if (i == n_names) *************** ecoff_frob_file_before_fix (void) *** 104,110 **** } for (i = n_names - 1; i >= 0; i--) if (secs[i]) ! bfd_section_list_insert (stdoutput, &stdoutput->sections, secs[i]); /* Fill in the register masks. */ { --- 104,110 ---- } for (i = n_names - 1; i >= 0; i--) if (secs[i]) ! bfd_section_list_insert_after (stdoutput, stdoutput->sections, secs[i]); /* Fill in the register masks. */ { Index: gas/config/tc-mmix.c =================================================================== RCS file: /cvs/src/src/gas/config/tc-mmix.c,v retrieving revision 1.20 diff -c -3 -p -r1.20 tc-mmix.c *** gas/config/tc-mmix.c 20 Apr 2005 17:40:01 -0000 1.20 --- gas/config/tc-mmix.c 3 May 2005 11:55:44 -0000 *************** mmix_frob_file (void) *** 3747,3764 **** if (real_reg_section != NULL) { ! asection **secpp; /* FIXME: Pass error state gracefully. */ if (bfd_get_section_flags (stdoutput, real_reg_section) & SEC_HAS_CONTENTS) as_fatal (_("register section has contents\n")); /* Really remove the section. */ ! for (secpp = &stdoutput->sections; ! *secpp != real_reg_section; ! secpp = &(*secpp)->next) ; ! bfd_section_list_remove (stdoutput, secpp); --stdoutput->section_count; } --- 3747,3764 ---- if (real_reg_section != NULL) { ! asection *secp; /* FIXME: Pass error state gracefully. */ if (bfd_get_section_flags (stdoutput, real_reg_section) & SEC_HAS_CONTENTS) as_fatal (_("register section has contents\n")); /* Really remove the section. */ ! for (secp = stdoutput->sections; ! secp != real_reg_section; ! secp = secp->next) ; ! bfd_section_list_remove (stdoutput, secp); --stdoutput->section_count; } Index: gas/config/tc-xtensa.c =================================================================== RCS file: /cvs/src/src/gas/config/tc-xtensa.c,v retrieving revision 1.36 diff -c -3 -p -r1.36 tc-xtensa.c *** gas/config/tc-xtensa.c 22 Apr 2005 21:37:31 -0000 1.36 --- gas/config/tc-xtensa.c 3 May 2005 11:55:48 -0000 *************** xtensa_remove_section (segT sec) *** 9690,9701 **** /* Handle brain-dead bfd_section_list_remove macro, which expect the address of the prior section's "next" field, not just the address of the section to remove. */ ! segT *ps_next_ptr = &stdoutput->sections; ! while (*ps_next_ptr != sec && *ps_next_ptr != NULL) ! ps_next_ptr = &(*ps_next_ptr)->next; ! assert (*ps_next_ptr != NULL); bfd_section_list_remove (stdoutput, ps_next_ptr); } --- 9690,9701 ---- /* Handle brain-dead bfd_section_list_remove macro, which expect the address of the prior section's "next" field, not just the address of the section to remove. */ + segT ps_next_ptr = stdoutput->sections; ! while (ps_next_ptr != sec && ps_next_ptr != NULL) ! ps_next_ptr = ps_next_ptr->next; ! assert (ps_next_ptr != NULL); bfd_section_list_remove (stdoutput, ps_next_ptr); } *************** xtensa_remove_section (segT sec) *** 9704,9716 **** static void xtensa_insert_section (segT after_sec, segT sec) { ! segT *after_sec_next; if (after_sec == NULL) ! after_sec_next = &stdoutput->sections; else ! after_sec_next = &after_sec->next; ! bfd_section_list_insert (stdoutput, after_sec_next, sec); } --- 9704,9717 ---- static void xtensa_insert_section (segT after_sec, segT sec) { ! segT after_sec_next; ! if (after_sec == NULL) ! after_sec_next = stdoutput->sections; else ! after_sec_next = after_sec->next; ! bfd_section_list_insert_after (stdoutput, after_sec_next, sec); }