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/tc-xtensa.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/tc-xtensa.c')
-rw-r--r-- | gas/config/tc-xtensa.c | 45 |
1 files changed, 7 insertions, 38 deletions
diff --git a/gas/config/tc-xtensa.c b/gas/config/tc-xtensa.c index 9340e4d..53d3bad 100644 --- a/gas/config/tc-xtensa.c +++ b/gas/config/tc-xtensa.c @@ -9682,39 +9682,6 @@ set_subseg_freq (segT seg, subsegT subseg, float total_f, float target_f) /* Segment Lists and emit_state Stuff. */ -/* Remove the segment from the global sections list. */ - -static void -xtensa_remove_section (segT sec) -{ - /* 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); -} - - -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); -} - - static void xtensa_move_seg_list_to_beginning (seg_list *head) { @@ -9725,9 +9692,11 @@ xtensa_move_seg_list_to_beginning (seg_list *head) /* Move the literal section to the front of the section list. */ assert (literal_section); - xtensa_remove_section (literal_section); - xtensa_insert_section (NULL, literal_section); - + if (literal_section != stdoutput->sections) + { + bfd_section_list_remove (stdoutput, literal_section); + bfd_section_list_prepend (stdoutput, literal_section); + } head = head->next; } } @@ -9893,8 +9862,8 @@ xtensa_reorder_seg_list (seg_list *head, segT after) assert (literal_section); if (literal_section != after) { - xtensa_remove_section (literal_section); - xtensa_insert_section (after, literal_section); + bfd_section_list_remove (stdoutput, literal_section); + bfd_section_list_insert_after (stdoutput, after, literal_section); } head = head->next; |