diff options
author | Alan Modra <amodra@gmail.com> | 2009-02-16 07:25:52 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2009-02-16 07:25:52 +0000 |
commit | bde18da45e5dea021d600aadeab702a6f7e31cb2 (patch) | |
tree | e570a5dab586d03eb27b2864e97118cde2f5e9fa /ld/emultempl | |
parent | 959b87241d85b42da82c45ecc4bc904895092730 (diff) | |
download | gdb-bde18da45e5dea021d600aadeab702a6f7e31cb2.zip gdb-bde18da45e5dea021d600aadeab702a6f7e31cb2.tar.gz gdb-bde18da45e5dea021d600aadeab702a6f7e31cb2.tar.bz2 |
* ldlang.c (push_stat_ptr, pop_stat_ptr): New functions.
(stat_save, stat_save_ptr): New variables.
(lang_insert_orphan): Use push_stat_ptr and pop_stat_ptr.
(load_symbols): Likewise. Delete dead "bad_load" code.
(open_input_bfds): Warn on script containing output sections.
(lang_enter_output_section_statement): Use push_stat_ptr.
(lang_enter_group): Likewise.
(lang_leave_output_section_statement): Use pop_stat_ptr.
(lang_leave_group): Likewise.
* ldlang.h (push_stat_ptr, pop_stat_ptr): Declare.
* ldctor.c (ldctor_build_sets): Use push_stat_ptr and pop_stat_ptr.
* emultempl/beos.em (gld_${EMULATION_NAME}_set_symbols): Likewise.
* emultempl/pe.em (gld_${EMULATION_NAME}_set_symbols): Likewise.
* emultempl/pep.em (gld_${EMULATION_NAME}_set_symbols): Likewise.
* emultempl/spuelf.em (spu_place_special_section): Likewise.
* emultempl/xtensaelf.em (ld_xtensa_insert_page_offsets): Likewise.
Diffstat (limited to 'ld/emultempl')
-rw-r--r-- | ld/emultempl/beos.em | 11 | ||||
-rw-r--r-- | ld/emultempl/pe.em | 9 | ||||
-rw-r--r-- | ld/emultempl/pep.em | 9 | ||||
-rw-r--r-- | ld/emultempl/spuelf.em | 7 | ||||
-rw-r--r-- | ld/emultempl/xtensaelf.em | 11 |
5 files changed, 16 insertions, 31 deletions
diff --git a/ld/emultempl/beos.em b/ld/emultempl/beos.em index e417693..370dbac 100644 --- a/ld/emultempl/beos.em +++ b/ld/emultempl/beos.em @@ -8,7 +8,7 @@ fi fragment <<EOF /* This file is part of GLD, the Gnu Linker. Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, - 2005, 2006, 2007, 2008 Free Software Foundation, Inc. + 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. This file is part of the GNU Binutils. @@ -330,7 +330,6 @@ gld_${EMULATION_NAME}_set_symbols (void) /* Run through and invent symbols for all the names and insert the defaults. */ int j; - lang_statement_list_type *save; if (!init[IMAGEBASEOFF].inited) { @@ -347,9 +346,7 @@ gld_${EMULATION_NAME}_set_symbols (void) return; /* Glue the assignments into the abs section */ - save = stat_ptr; - - stat_ptr = &(abs_output_section->children); + push_stat_ptr (&abs_output_section->children); for (j = 0; init[j].ptr; j++) { @@ -367,7 +364,7 @@ gld_${EMULATION_NAME}_set_symbols (void) else abort(); } /* Restore the pointer. */ - stat_ptr = save; + pop_stat_ptr (); if (pe.FileAlignment > pe.SectionAlignment) @@ -609,8 +606,6 @@ sort_sections (lang_statement_union_type *s) static void gld_${EMULATION_NAME}_before_allocation (void) { - extern lang_statement_list_type *stat_ptr; - #ifdef TARGET_IS_ppcpe /* Here we rummage through the found bfds to collect toc information */ { diff --git a/ld/emultempl/pe.em b/ld/emultempl/pe.em index d2d34ad..858f6da 100644 --- a/ld/emultempl/pe.em +++ b/ld/emultempl/pe.em @@ -10,7 +10,7 @@ rm -f e${EMULATION_NAME}.c (echo;echo;echo;echo;echo)>e${EMULATION_NAME}.c # there, now line numbers match ;-) fragment <<EOF /* Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, - 2005, 2006, 2007, 2008 Free Software Foundation, Inc. + 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. This file is part of the GNU Binutils. @@ -725,7 +725,6 @@ gld_${EMULATION_NAME}_set_symbols (void) /* Run through and invent symbols for all the names and insert the defaults. */ int j; - lang_statement_list_type *save; if (!init[IMAGEBASEOFF].inited) { @@ -748,9 +747,7 @@ gld_${EMULATION_NAME}_set_symbols (void) return; /* Glue the assignments into the abs section. */ - save = stat_ptr; - - stat_ptr = &(abs_output_section->children); + push_stat_ptr (&abs_output_section->children); for (j = 0; init[j].ptr; j++) { @@ -772,7 +769,7 @@ gld_${EMULATION_NAME}_set_symbols (void) image_base_statement = rv; } /* Restore the pointer. */ - stat_ptr = save; + pop_stat_ptr (); if (pe.FileAlignment > pe.SectionAlignment) diff --git a/ld/emultempl/pep.em b/ld/emultempl/pep.em index f6f802e..559773a 100644 --- a/ld/emultempl/pep.em +++ b/ld/emultempl/pep.em @@ -9,7 +9,7 @@ fi rm -f e${EMULATION_NAME}.c (echo;echo;echo;echo;echo)>e${EMULATION_NAME}.c # there, now line numbers match ;-) fragment <<EOF -/* Copyright 2006, 2007, 2008 Free Software Foundation, Inc. +/* Copyright 2006, 2007, 2008, 2009 Free Software Foundation, Inc. Written by Kai Tietz, OneVision Software GmbH&CoKg. This file is part of the GNU Binutils. @@ -681,7 +681,6 @@ gld_${EMULATION_NAME}_set_symbols (void) /* Run through and invent symbols for all the names and insert the defaults. */ int j; - lang_statement_list_type *save; if (!init[IMAGEBASEOFF].inited) { @@ -704,9 +703,7 @@ gld_${EMULATION_NAME}_set_symbols (void) return; /* Glue the assignments into the abs section. */ - save = stat_ptr; - - stat_ptr = &(abs_output_section->children); + push_stat_ptr (&abs_output_section->children); for (j = 0; init[j].ptr; j++) { @@ -728,7 +725,7 @@ gld_${EMULATION_NAME}_set_symbols (void) image_base_statement = rv; } /* Restore the pointer. */ - stat_ptr = save; + pop_stat_ptr (); if (pep.FileAlignment > pep.SectionAlignment) { diff --git a/ld/emultempl/spuelf.em b/ld/emultempl/spuelf.em index 376889a..396fe80 100644 --- a/ld/emultempl/spuelf.em +++ b/ld/emultempl/spuelf.em @@ -160,12 +160,11 @@ spu_place_special_section (asection *s, asection *o, const char *output_name) /* Pad this stub section so that it finishes at the end of the icache line. */ etree_type *e_size; - lang_statement_list_type *save = stat_ptr; - stat_ptr = &os->children; + push_stat_ptr (&os->children); e_size = exp_intop (params.line_size - s->size); lang_add_assignment (exp_assop ('=', ".", e_size)); - stat_ptr = save; + pop_stat_ptr (); } lang_add_section (&os->children, s, os); } @@ -558,7 +557,7 @@ embedded_spu_file (lang_input_statement_type *entry, const char *flags) if (lang_add_input_file (oname, lang_input_file_is_file_enum, NULL) == NULL) return FALSE; - /* lang_add_input_file put the new list entry at the end of the statement + /* lang_add_input_file puts the new list entry at the end of the statement and input file lists. Move it to just after the current entry. */ new_ent = *old_stat_tail; *old_stat_tail = NULL; diff --git a/ld/emultempl/xtensaelf.em b/ld/emultempl/xtensaelf.em index 6651a50..acc3290 100644 --- a/ld/emultempl/xtensaelf.em +++ b/ld/emultempl/xtensaelf.em @@ -1,5 +1,5 @@ # This shell script emits a C file. -*- C -*- -# Copyright 2003, 2004, 2005, 2006, 2007, 2008 +# Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 # Free Software Foundation, Inc. # # This file is part of the GNU Binutils. @@ -1951,20 +1951,17 @@ ld_xtensa_insert_page_offsets (bfd_vma dot, lang_assignment_statement_type *assign_stmt; lang_statement_union_type *assign_union; lang_statement_list_type tmplist; - lang_statement_list_type *old_stat_ptr = stat_ptr; /* There is hidden state in "lang_add_assignment". It appends the new assignment statement to the stat_ptr list. Thus, we swap it before and after the call. */ - tmplist.head = NULL; - tmplist.tail = &tmplist.head; - - stat_ptr = &tmplist; + lang_list_init (&tmplist); + push_stat_ptr (&tmplist); /* Warning: side effect; statement appended to stat_ptr. */ assign_stmt = lang_add_assignment (assign_op); assign_union = (lang_statement_union_type *) assign_stmt; - stat_ptr = old_stat_ptr; + pop_stat_ptr (); assign_union->header.next = l; *(*stack_p)->iterloc.loc = assign_union; |