From d7dde66c50543d891eb2dcdde9e439b9b033e799 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Fri, 15 Feb 2008 03:35:53 +0000 Subject: include/ * bfdlink.h (struct bfd_link_hash_table): Delete creator field. (struct bfd_link_info): Add output_bfd. bfd/ * elflink.c: Replace all accesses to hash->creator field with output_bfd->xvec. * cofflink.c: Likewise. * coff-h8300.c: Likewise. * ecoff.c: Likewise. * elf32-m68hc1x.c: Likewise. * elf32-ppc.c: Likewise. * elf64-alpha.c: Likewise. * elf64-ppc.c: Likewise. * elf64-sparc.c: Likewise. * elfxx-mips.c: Likewise. * i386linux.c: Likewise. * m68klinux.c: Likewise. * sparclinux.c: Likewise. * sunos.c: Likewise. * xcofflink.c: Likewise. * linker.c: Likewise. (_bfd_link_hash_table_init): Don't store creator. ld/ * ldmain.h (output_bfd): Delete. * ldmain.c (output_bfd): Delete. Replace all occurrences of output_bfd with link_info.output_bfd. * ldcref.c: Likewise. * ldctor.c: Likewise. * ldemul.c: Likewise. * ldexp.c: Likewise. * ldfile.c: Likewise. * ldlang.c: Likewise. * ldmisc.c: Likewise. * ldwrite.c: Likewise. * pe-dll.c: Likewise. * emultempl/aix.em: Likewise. * emultempl/alphaelf.em: Likewise. * emultempl/armcoff.em: Likewise. * emultempl/armelf.em: Likewise. * emultempl/avrelf.em: Likewise. * emultempl/beos.em: Likewise. * emultempl/elf-generic.em: Likewise. * emultempl/elf32.em: Likewise. * emultempl/gld960.em: Likewise. * emultempl/hppaelf.em: Likewise. * emultempl/irix.em: Likewise. * emultempl/linux.em: Likewise. * emultempl/lnk960.em: Likewise. * emultempl/m68hc1xelf.em: Likewise. * emultempl/mmix-elfnmmo.em: Likewise. * emultempl/mmo.em: Likewise. * emultempl/pe.em: Likewise. * emultempl/pep.em: Likewise. * emultempl/ppc32elf.em: Likewise. * emultempl/ppc64elf.em: Likewise. * emultempl/scoreelf.em: Likewise. * emultempl/sh64elf.em: Likewise. * emultempl/spuelf.em: Likewise. * emultempl/sunos.em: Likewise. * emultempl/vanilla.em: Likewise. * emultempl/vxworks.em: Likewise. * emultempl/xtensaelf.em: Likewise. * emultempl/z80.em: Likewise. * ldlang.c (open_output): Don't return output, instead write link_info_output_bfd directly. * emultempl/alphaelf.em: Replace occurrences of link_info.hash->creator with link_info.output_bfd->xvec. * emultempl/hppaelf.em: Likewise. * emultempl/ppc32elf.em: Likewise. * emultempl/ppc64elf.em: Likewise. * emultempl/spuelf.em: Likewise. --- ld/ldmain.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'ld/ldmain.c') diff --git a/ld/ldmain.c b/ld/ldmain.c index a9af255a39..dd7b7fe171 100644 --- a/ld/ldmain.c +++ b/ld/ldmain.c @@ -1,6 +1,6 @@ /* Main program of GNU linker. Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, - 2002, 2003, 2004, 2005, 2006, 2007 + 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. Written by Steve Chamberlain steve@cygnus.com @@ -77,9 +77,6 @@ const char *ld_sysroot; char * ld_canon_sysroot; int ld_canon_sysroot_len; -/* The file that we're creating. */ -bfd *output_bfd = 0; - /* Set by -G argument, for MIPS ECOFF target. */ int g_switch_value = 8; @@ -177,8 +174,8 @@ remove_output (void) { if (output_filename) { - if (output_bfd) - bfd_cache_close (output_bfd); + if (link_info.output_bfd) + bfd_cache_close (link_info.output_bfd); if (delete_output_file_on_failure) unlink_if_ordinary (output_filename); } @@ -463,9 +460,9 @@ main (int argc, char **argv) /* Print error messages for any missing symbols, for any warning symbols, and possibly multiple definitions. */ if (link_info.relocatable) - output_bfd->flags &= ~EXEC_P; + link_info.output_bfd->flags &= ~EXEC_P; else - output_bfd->flags |= EXEC_P; + link_info.output_bfd->flags |= EXEC_P; ldwrite (); @@ -492,8 +489,8 @@ main (int argc, char **argv) } else { - if (! bfd_close (output_bfd)) - einfo (_("%F%B: final close failed: %E\n"), output_bfd); + if (! bfd_close (link_info.output_bfd)) + einfo (_("%F%B: final close failed: %E\n"), link_info.output_bfd); /* If the --force-exe-suffix is enabled, and we're making an executable file and it doesn't end in .exe, copy it to one @@ -1151,7 +1148,7 @@ constructor_callback (struct bfd_link_info *info, /* Ensure that BFD_RELOC_CTOR exists now, so that we can give a useful error message. */ - if (bfd_reloc_type_lookup (output_bfd, BFD_RELOC_CTOR) == NULL + if (bfd_reloc_type_lookup (link_info.output_bfd, BFD_RELOC_CTOR) == NULL && (info->relocatable || bfd_reloc_type_lookup (abfd, BFD_RELOC_CTOR) == NULL)) einfo (_("%P%F: BFD backend error: BFD_RELOC_CTOR unsupported\n")); @@ -1457,7 +1454,7 @@ reloc_overflow (struct bfd_link_info *info ATTRIBUTE_UNUSED, reloc_name, entry->root.string, entry->u.def.section, entry->u.def.section == bfd_abs_section_ptr - ? output_bfd : entry->u.def.section->owner); + ? link_info.output_bfd : entry->u.def.section->owner); break; default: abort (); -- cgit v1.2.1