From: amodra Date: Tue, 11 Jul 2000 03:42:41 +0000 (+0000) Subject: Remove some forward declarations in ldemul.h and ldfile.h, and X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=56715557c706bd9c39734021945078de9cb28041;p=pf3gnuchains%2Fpf3gnuchains3x.git Remove some forward declarations in ldemul.h and ldfile.h, and re-arrange header include order. Fix shadowing warnings in ldlang.h Fix compile errors in mpw-elfmips.c --- diff --git a/ld/ChangeLog b/ld/ChangeLog index 44b124dea3..0ddfe75372 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,47 @@ +2000-07-10 Alan Modra + + * ldemul.h (struct lang_input_statement_struct): Remove forward + declaration. + (struct search_dirs): Likewise. + * ldfile.h (struct lang_input_statement_struct): Likewise. + Protect file from multiple inclusion. + * ldlang.h (LANG_FOR_EACH_INPUT_STATEMENT): Move file_chain + declaration from macro to file scope. + + * ldemul.c: ldexp.h,ldlang.h,ldfile.h,ldemul.h go in this order. + * ldgram.y: Likewise here. + * ldlang.c: And here. + * ldmain.c: And here. + * mpw-elfmips.c: And here. + * mpw-eppcmac.c: And here. + * emultempl/aix.em: And here. + * emultempl/armcoff.em: And here. + * emultempl/armelf.em: And here. + * emultempl/armelf_oabi.em: And here. + * emultempl/beos.em: And here. + * emultempl/elf32.em: And here. + * emultempl/hppaelf.em: And here. + * emultempl/linux.em: And here. + * emultempl/lnk960.em: And here. + * emultempl/pe.em: And here. + * emultempl/sunos.em: And here. + * mpw-esh.c: And here. Include ldexp.h and ldlang.h too. + * mpw-idtmips.c: Ditto. + * emultempl/generic.em: Ditto. + * emultempl/gld960.em: Ditto. + * emultempl/gld960c.em: Ditto. + * emultempl/mipsecoff.em: Ditto. + * emultempl/ticoff.em: Ditto. + * emultempl/vanilla.em: Ditto. + + * pe-dll.c: Include ldfile.h + * ldver.c: Include ldexp.h, ldlang.h, ldfile.h + + * mpw-elfmips.c: (gldelf32ebmip_before_allocation): Add missing + arguments to bfd_elf32_size_dynamic_sections call. + (gldelf32ebmip_place_orphan): Add missing arguments to + lang_leave_output_section_statement call. + 2000-07-10 H.J. Lu * emultempl/pe.em (pe_enable_stdcall_fixup): Protect with diff --git a/ld/emultempl/aix.em b/ld/emultempl/aix.em index dd81b5f744..c07ddef9d8 100644 --- a/ld/emultempl/aix.em +++ b/ld/emultempl/aix.em @@ -4,7 +4,8 @@ cat >e${EMULATION_NAME}.c < AIX support by Ian Lance Taylor @@ -37,11 +38,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "ld.h" #include "ldmain.h" -#include "ldemul.h" -#include "ldfile.h" #include "ldmisc.h" #include "ldexp.h" #include "ldlang.h" +#include "ldfile.h" +#include "ldemul.h" #include "ldctor.h" #include "ldgram.h" diff --git a/ld/emultempl/armcoff.em b/ld/emultempl/armcoff.em index d73b3d172f..936da13a63 100644 --- a/ld/emultempl/armcoff.em +++ b/ld/emultempl/armcoff.em @@ -4,7 +4,8 @@ cat >e${EMULATION_NAME}.c <e${EMULATION_NAME}.c <e${EMULATION_NAME}.c <e${EMULATION_NAME}.c <e${EMULATION_NAME}.c < ELF support by Ian Lance Taylor @@ -39,11 +39,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "ld.h" #include "ldmain.h" -#include "ldemul.h" -#include "ldfile.h" #include "ldmisc.h" #include "ldexp.h" #include "ldlang.h" +#include "ldfile.h" +#include "ldemul.h" #include "ldgram.h" static void gld${EMULATION_NAME}_before_parse PARAMS ((void)); diff --git a/ld/emultempl/generic.em b/ld/emultempl/generic.em index 6635e09e20..f96323e211 100644 --- a/ld/emultempl/generic.em +++ b/ld/emultempl/generic.em @@ -4,7 +4,8 @@ cat >e${EMULATION_NAME}.c <e${EMULATION_NAME}.c <e${EMULATION_NAME}.c <e${EMULATION_NAME}.c < Linux support by Eric Youngdale @@ -32,11 +33,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "ld.h" #include "ldmain.h" -#include "ldemul.h" -#include "ldfile.h" #include "ldmisc.h" #include "ldexp.h" #include "ldlang.h" +#include "ldfile.h" +#include "ldemul.h" static void gld${EMULATION_NAME}_before_parse PARAMS ((void)); static boolean gld${EMULATION_NAME}_open_dynamic_archive diff --git a/ld/emultempl/lnk960.em b/ld/emultempl/lnk960.em index a4c32579ee..6fedf333be 100644 --- a/ld/emultempl/lnk960.em +++ b/ld/emultempl/lnk960.em @@ -2,7 +2,8 @@ # It does some substitutions. cat >e${EMULATION_NAME}.c <e${EMULATION_NAME}.c < based on generic.em. This file is part of GLD, the Gnu Linker. @@ -31,10 +31,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "ld.h" #include "ldmain.h" -#include "ldemul.h" -#include "ldfile.h" #include "ldmisc.h" +#include "ldexp.h" +#include "ldlang.h" +#include "ldfile.h" +#include "ldemul.h" + static void gld${EMULATION_NAME}_before_parse PARAMS ((void)); static void gld${EMULATION_NAME}_after_open PARAMS ((void)); static void check_sections PARAMS ((bfd *, asection *, PTR)); diff --git a/ld/emultempl/pe.em b/ld/emultempl/pe.em index ee213ae1a2..582d541895 100644 --- a/ld/emultempl/pe.em +++ b/ld/emultempl/pe.em @@ -37,11 +37,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "ldgram.h" #include "ldexp.h" #include "ldlang.h" +#include "ldfile.h" #include "ldemul.h" #include "ldlex.h" #include "ldmisc.h" #include "ldctor.h" -#include "ldfile.h" #include "coff/internal.h" /* FIXME: This is a BFD internal header file, and we should not be diff --git a/ld/emultempl/sunos.em b/ld/emultempl/sunos.em index a571b6b3b7..23fa285906 100644 --- a/ld/emultempl/sunos.em +++ b/ld/emultempl/sunos.em @@ -4,7 +4,7 @@ cat >e${EMULATION_NAME}.c < SunOS shared library support by Ian Lance Taylor @@ -36,11 +36,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "ld.h" #include "ldmain.h" -#include "ldemul.h" -#include "ldfile.h" #include "ldmisc.h" #include "ldexp.h" #include "ldlang.h" +#include "ldfile.h" +#include "ldemul.h" #ifdef HAVE_DIRENT_H # include diff --git a/ld/emultempl/ticoff.em b/ld/emultempl/ticoff.em index 21bd35d5e5..7cab15db5f 100644 --- a/ld/emultempl/ticoff.em +++ b/ld/emultempl/ticoff.em @@ -30,10 +30,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "ld.h" #include "ldmain.h" -#include "ldemul.h" -#include "ldfile.h" #include "ldmisc.h" +#include "ldexp.h" +#include "ldlang.h" +#include "ldfile.h" +#include "ldemul.h" + #include "getopt.h" static int coff_version; diff --git a/ld/emultempl/vanilla.em b/ld/emultempl/vanilla.em index 0a74abd0e0..c91d6cac1e 100644 --- a/ld/emultempl/vanilla.em +++ b/ld/emultempl/vanilla.em @@ -2,7 +2,7 @@ # It does some substitutions. cat >e${EMULATION_NAME}.c < ELF support by Ian Lance Taylor @@ -32,12 +33,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "ld.h" #include "ldmain.h" -#include "ldemul.h" -#include "ldfile.h" #include "ldmisc.h" #include "ldexp.h" #include "ldlang.h" #include "ldgram.h" +#include "ldfile.h" +#include "ldemul.h" static void gldelf32ebmip_before_parse PARAMS ((void)); static boolean gldelf32ebmip_open_dynamic_archive @@ -442,12 +443,11 @@ gldelf32ebmip_before_allocation () rpath = command_line.rpath; if (rpath == NULL) rpath = (const char *) getenv ("LD_RUN_PATH"); - if (! bfd_elf32_size_dynamic_sections (output_bfd, - command_line.soname, - rpath, - command_line.export_dynamic, - &link_info, - &sinterp)) + if (! (bfd_elf32_size_dynamic_sections + (output_bfd, command_line.soname, rpath, + command_line.export_dynamic, command_line.filter_shlib, + (const char * const *) command_line.auxiliary_filters, + &link_info, &sinterp, lang_elf_version_info))) einfo (_("%P%F: failed to set dynamic section sizes: %E\n")); /* Let the user override the dynamic linker we are using. */ @@ -694,7 +694,9 @@ gldelf32ebmip_place_orphan (file, s) os = lang_output_section_statement_lookup (secname); wild_doit (&os->children, s, os, file); - lang_leave_output_section_statement ((bfd_vma) 0, "*default*"); + lang_leave_output_section_statement + ((bfd_vma) 0, "*default*", + (struct lang_output_section_phdr_list *) NULL, "*default*"); stat_ptr = &add; if (*ps == '\0' && config.build_constructors) diff --git a/ld/mpw-eppcmac.c b/ld/mpw-eppcmac.c index ba09a410df..713f0815e4 100644 --- a/ld/mpw-eppcmac.c +++ b/ld/mpw-eppcmac.c @@ -1,7 +1,7 @@ /* This file is is generated by a shell script. DO NOT EDIT! */ /* AIX emulation code for ppcmacos - Copyright (C) 1991, 1993, 1995, 1998 Free Software Foundation, Inc. + Copyright (C) 1991, 93, 95, 98, 2000 Free Software Foundation, Inc. Written by Steve Chamberlain AIX support by Ian Lance Taylor @@ -33,13 +33,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "ld.h" #include "ldmain.h" -#include "ldemul.h" -#include "ldfile.h" #include "ldmisc.h" #include "ldexp.h" #include "ldlang.h" #include "ldctor.h" #include "ldgram.h" +#include "ldfile.h" +#include "ldemul.h" static void gldppcmacos_before_parse PARAMS ((void)); static int gldppcmacos_parse_args PARAMS ((int, char **)); diff --git a/ld/mpw-esh.c b/ld/mpw-esh.c index 93bc5f54c7..6af2c0f2b7 100644 --- a/ld/mpw-esh.c +++ b/ld/mpw-esh.c @@ -1,7 +1,7 @@ /* This file is is generated by a shell script. DO NOT EDIT! */ /* emulate the original gld for the given sh - Copyright (C) 1991, 1993 Free Software Foundation, Inc. + Copyright (C) 1991, 1993, 2000 Free Software Foundation, Inc. Written by Steve Chamberlain steve@cygnus.com This file is part of GLD, the Gnu Linker. @@ -29,10 +29,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "ld.h" #include "ldmain.h" -#include "ldemul.h" -#include "ldfile.h" #include "ldmisc.h" +#include "ldexp.h" +#include "ldlang.h" +#include "ldfile.h" +#include "ldemul.h" + static void gldsh_before_parse PARAMS ((void)); static char *gldsh_get_script PARAMS ((int *isfile)); diff --git a/ld/mpw-idtmips.c b/ld/mpw-idtmips.c index 08ddc70393..69b91ac3b9 100644 --- a/ld/mpw-idtmips.c +++ b/ld/mpw-idtmips.c @@ -1,7 +1,7 @@ /* This file is is generated by a shell script. DO NOT EDIT! */ /* Handle embedded relocs for MIPS. - Copyright 1994 Free Software Foundation, Inc. + Copyright 1994, 2000 Free Software Foundation, Inc. Written by Ian Lance Taylor based on generic.em. This file is part of GLD, the Gnu Linker. @@ -29,10 +29,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "ld.h" #include "ldmain.h" -#include "ldemul.h" -#include "ldfile.h" #include "ldmisc.h" +#include "ldexp.h" +#include "ldlang.h" +#include "ldfile.h" +#include "ldemul.h" + static void gldmipsidt_before_parse PARAMS ((void)); static void gldmipsidt_after_open PARAMS ((void)); static void check_sections PARAMS ((bfd *, asection *, PTR)); diff --git a/ld/pe-dll.c b/ld/pe-dll.c index 6b8b1af007..d028fd1765 100644 --- a/ld/pe-dll.c +++ b/ld/pe-dll.c @@ -34,6 +34,7 @@ #include "ldmisc.h" #include "ldgram.h" #include "ldmain.h" +#include "ldfile.h" #include "ldemul.h" #include "coff/internal.h" #include "../bfd/libcoff.h"