From e3dc8847695c8f91bff0067d38e08969d482611f Mon Sep 17 00:00:00 2001 From: Hans-Peter Nilsson Date: Tue, 5 Feb 2002 06:52:17 +0000 Subject: * ldlang.c (lang_reset_memory_regions): Rename from reset_memory_regions. Change all callers. Make public. * ldlang.h (lang_reset_memory_regions): Prototype. * emultempl/elf32.em (gld${EMULATION_NAME}_finish): Call lang_reset_memory_regions before lang_size_sections. --- ld/ChangeLog | 8 ++++++++ ld/emultempl/elf32.em | 6 ++++-- ld/ldlang.c | 7 +++---- ld/ldlang.h | 5 +++-- 4 files changed, 18 insertions(+), 8 deletions(-) (limited to 'ld') diff --git a/ld/ChangeLog b/ld/ChangeLog index baee989..ea076bc 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,11 @@ +2002-02-05 Hans-Peter Nilsson + + * ldlang.c (lang_reset_memory_regions): Rename from + reset_memory_regions. Change all callers. Make public. + * ldlang.h (lang_reset_memory_regions): Prototype. + * emultempl/elf32.em (gld${EMULATION_NAME}_finish): Call + lang_reset_memory_regions before lang_size_sections. + 2002-02-04 Hans-Peter Nilsson * emultempl/mmix-elfnmmo.em (mmix_after_allocation): Use signed diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em index b2fd969..c62727d 100644 --- a/ld/emultempl/elf32.em +++ b/ld/emultempl/elf32.em @@ -12,8 +12,8 @@ cat >e${EMULATION_NAME}.c < ELF support by Ian Lance Taylor @@ -1330,6 +1330,8 @@ gld${EMULATION_NAME}_finish () { if (bfd_elf${ELFSIZE}_discard_info (output_bfd, &link_info)) { + lang_reset_memory_regions (); + /* Resize the sections. */ lang_size_sections (stat_ptr->head, abs_output_section, &stat_ptr->head, 0, (bfd_vma) 0, NULL); diff --git a/ld/ldlang.c b/ld/ldlang.c index a7b53dd..456bc7f 100644 --- a/ld/ldlang.c +++ b/ld/ldlang.c @@ -132,7 +132,6 @@ static boolean lang_one_common PARAMS ((struct bfd_link_hash_entry *, PTR)); static void lang_place_orphans PARAMS ((void)); static int topower PARAMS ((int)); static void lang_set_startof PARAMS ((void)); -static void reset_memory_regions PARAMS ((void)); static void gc_section_callback PARAMS ((lang_wild_statement_type *, struct wildcard_list *, asection *, lang_input_statement_type *, PTR)); @@ -3972,8 +3971,8 @@ lang_final () /* Reset the current counters in the regions. */ -static void -reset_memory_regions () +void +lang_reset_memory_regions () { lang_memory_region_type *p = lang_memory_region_list; asection *o; @@ -4160,7 +4159,7 @@ lang_process () do { - reset_memory_regions (); + lang_reset_memory_regions (); relax_again = false; diff --git a/ld/ldlang.h b/ld/ldlang.h index 983d34c..7641992 100644 --- a/ld/ldlang.h +++ b/ld/ldlang.h @@ -1,13 +1,13 @@ /* ldlang.h - linker command language support Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001 + 2001, 2002 Free Software Foundation, Inc. This file is part of GLD, the Gnu Linker. GLD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 1, or (at your option) + the Free Software Foundation; either version 2, or (at your option) any later version. GLD is distributed in the hope that it will be useful, @@ -402,6 +402,7 @@ extern void lang_for_each_input_file PARAMS ((void (*dothis) (lang_input_statement_type *))); extern void lang_for_each_file PARAMS ((void (*dothis) (lang_input_statement_type *))); +extern void lang_reset_memory_regions PARAMS ((void)); extern bfd_vma lang_do_assignments PARAMS ((lang_statement_union_type * s, lang_output_section_statement_type *output_section_statement, -- cgit v1.1