From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6077 invoked by alias); 21 Jan 2005 00:11:33 -0000 Mailing-List: contact binutils-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sources.redhat.com Received: (qmail 4985 invoked from network); 21 Jan 2005 00:10:55 -0000 Received: from unknown (HELO ausmtp02.au.ibm.com) (202.81.18.187) by sourceware.org with SMTP; 21 Jan 2005 00:10:55 -0000 Received: from sd0112e0.au.ibm.com (d23rh903.au.ibm.com [202.81.18.201]) by ausmtp02.au.ibm.com (8.12.10/8.12.10) with ESMTP id j0L08IIM144388 for ; Fri, 21 Jan 2005 11:08:18 +1100 Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.250.244]) by sd0112e0.au.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id j0L0D06w145212 for ; Fri, 21 Jan 2005 11:13:00 +1100 Received: from d23av03.au.ibm.com (loopback [127.0.0.1]) by d23av03.au.ibm.com (8.12.11/8.12.11) with ESMTP id j0L0Ar6w015426 for ; Fri, 21 Jan 2005 11:10:53 +1100 Received: from ozlabs.au.ibm.com (haven.au.ibm.com [9.190.164.82]) by d23av03.au.ibm.com (8.12.11/8.12.11) with ESMTP id j0L0AquD015419 for ; Fri, 21 Jan 2005 11:10:53 +1100 Received: from namadgi.ozlabs.ibm.com (localhost [127.0.0.1]) by ozlabs.au.ibm.com (Postfix) with SMTP id CE3E617DDF for ; Fri, 21 Jan 2005 11:10:51 +1100 (EST) Received: by namadgi.ozlabs.ibm.com (sSMTP sendmail emulation); Fri, 21 Jan 2005 11:12:33 +1100 From: "Ben Elliston" Date: Fri, 21 Jan 2005 00:11:00 -0000 To: binutils@sources.redhat.com Subject: ld cleanups Message-ID: <20050121001233.GA16062@namadgi> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="2oS5YaxWCcQjTEyO" Content-Disposition: inline User-Agent: Mutt/1.5.6+20040907i X-SW-Source: 2005-01/txt/msg00315.txt.bz2 --2oS5YaxWCcQjTEyO Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 12213 This patch removes all #if 0 chunks from the ld directory. Anything here that should be kept? 2005-01-21 Ben Elliston * ldexp.c (exp_assop): Remove #if 0'd code. (exp_print_tree): Likewise. * ldlang.c (lang_memory_region_lookup): Likewise. (open_output): Likewise. (open_input_bfds): Likewise. (lang_do_assignments_1): Likewise. (lang_place_orphans): Likewise. (lang_enter_output_section_statement): Likewise. * ldlang.h (struct lang_input_statement_struct): Likewise. * mri.c (mri_draw_tree): Likewise. (mri_load): Likewise. * pe-dll.c (generate_reloc): Likewise. (make_import_fixup_entry): Likewise. (pe_as16): Likewise. * emultempl/beos.em (set_pe_subsystem): Likewise. * emultempl/hppaelf.em (hppaelf_after_parse): Likewise. * emultempl/pe.em: Likewise. * emultempl/xtensaelf.em (xtensa_colocate_literals): Likewise. Index: ldexp.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/bje/src-cvs/src/ld/ldexp.c,v retrieving revision 1.41 diff -u -p -r1.41 ldexp.c --- ldexp.c 17 Dec 2004 15:50:02 -0000 1.41 +++ ldexp.c 21 Jan 2005 00:09:19 -0000 @@ -935,10 +935,6 @@ exp_assop (int code, const char *dst, et value.assign.dst =3D dst; value.assign.type.node_class =3D etree_assign; =20 -#if 0 - if (exp_fold_tree_no_dot (&value, &result)) - return exp_intop (result); -#endif new =3D stat_alloc (sizeof (new->assign)); memcpy (new, &value, sizeof (new->assign)); return new; @@ -997,13 +993,6 @@ exp_print_tree (etree_type *tree) minfo ("%s+0x%v", tree->rel.section->name, tree->rel.value); return; case etree_assign: -#if 0 - if (tree->assign.dst->sdefs !=3D NULL) - fprintf (config.map_file, "%s (%x) ", tree->assign.dst->name, - tree->assign.dst->sdefs->value); - else - fprintf (config.map_file, "%s (UNDEFINED)", tree->assign.dst->name); -#endif fprintf (config.map_file, "%s", tree->assign.dst); exp_print_token (tree->type.node_code, TRUE); exp_print_tree (tree->assign.src); Index: ldlang.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/bje/src-cvs/src/ld/ldlang.c,v retrieving revision 1.170 diff -u -p -r1.170 ldlang.c --- ldlang.c 18 Jan 2005 08:51:54 -0000 1.170 +++ ldlang.c 21 Jan 2005 00:09:19 -0000 @@ -553,20 +553,6 @@ lang_memory_region_lookup (const char *c return p; } =20 -#if 0 - /* This code used to always use the first region in the list as the - default region. I changed it to instead use a region - encompassing all of memory as the default region. This permits - NOLOAD sections to work reasonably without requiring a region. - People should specify what region they mean, if they really want - a region. */ - if (strcmp (name, DEFAULT_MEMORY_REGION) =3D=3D 0) - { - if (lang_memory_region_list !=3D NULL) - return lang_memory_region_list; - } -#endif - if (!create && strcmp (name, DEFAULT_MEMORY_REGION)) einfo (_("%P:%S: warning: memory region %s not declared\n"), name); =20 @@ -2157,10 +2143,6 @@ open_output (const char *name) =20 delete_output_file_on_failure =3D TRUE; =20 -#if 0 - output->flags |=3D D_PAGED; -#endif - if (! bfd_set_format (output, bfd_object)) einfo (_("%P%F:%s: can not make object file: %E\n"), name); if (! bfd_set_arch_mach (output, @@ -2314,23 +2296,6 @@ open_input_bfds (lang_statement_union_ty static void lang_reasonable_defaults (void) { -#if 0 - lang_output_section_statement_lookup (".text"); - lang_output_section_statement_lookup (".data"); - - default_common_section =3D lang_output_section_statement_lookup (".bss"); - - if (!placed_commons) - { - lang_wild_statement_type *new =3D - new_stat (lang_wild_statement, - &default_common_section->children); - - new->section_name =3D "COMMON"; - new->filename =3D NULL; - lang_list_init (&new->children); - } -#endif } =20 /* Add a symbol to a hash of symbols used in DEFINED (NAME) expressions. = */ @@ -3987,9 +3952,6 @@ lang_do_assignments_1 case lang_object_symbols_statement_enum: case lang_output_statement_enum: case lang_target_statement_enum: -#if 0 - case lang_common_statement_enum: -#endif break; case lang_data_statement_enum: { @@ -4455,13 +4417,6 @@ lang_place_orphans (void) { if (default_common_section =3D=3D NULL) { -#if 0 - /* This message happens when using the - svr3.ifile linker script, so I have - disabled it. */ - info_msg (_("%P: no [COMMON] command," - " defaulting to .bss\n")); -#endif default_common_section =3D lang_output_section_statement_lookup (".bss"); =20 @@ -4630,11 +4585,6 @@ lang_enter_output_section_statement (con lang_output_section_statement_lookup_1 (output_section_statement_name, constraint); =20 - /* Add this statement to tree. */ -#if 0 - add_statement (lang_output_section_statement_enum, - output_section_statement); -#endif /* Make next things chain into subchain of this. */ =20 if (os->addr_tree =3D=3D NULL) Index: ldlang.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/bje/src-cvs/src/ld/ldlang.h,v retrieving revision 1.42 diff -u -p -r1.42 ldlang.h --- ldlang.h 26 Oct 2004 18:41:51 -0000 1.42 +++ ldlang.h 21 Jan 2005 00:09:19 -0000 @@ -279,9 +279,6 @@ typedef struct lang_input_statement_stru =20 bfd_boolean loaded; =20 -#if 0 - unsigned int globals_in_this_file; -#endif const char *target; bfd_boolean real; } lang_input_statement_type; Index: mri.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/bje/src-cvs/src/ld/mri.c,v retrieving revision 1.16 diff -u -p -r1.16 mri.c --- mri.c 4 Oct 2004 16:45:51 -0000 1.16 +++ mri.c 21 Jan 2005 00:09:19 -0000 @@ -120,19 +120,6 @@ mri_draw_tree (void) if (done_tree) return; =20 -#if 0 /* We don't bother with memory regions. */ - /* Create the regions. */ - { - lang_memory_region_type *r; - - r =3D lang_memory_region_lookup("long"); - r->current =3D r->origin =3D exp_get_vma (base, (bfd_vma)0, "origin", - lang_first_phase_enum); - r->length =3D (bfd_size_type) exp_get_vma (0, ~(bfd_vma) 0, "length", - lang_first_phase_enum); - } -#endif - /* Now build the statements for the ldlang machine. */ =20 /* Attach the addresses of any which have addresses, @@ -255,9 +242,6 @@ mri_load (const char *name) { base =3D 0; lang_add_input_file (name, lang_input_file_is_file_enum, NULL); -#if 0 - lang_leave_output_section_statement (0, "*default*"); -#endif } =20 void Index: pe-dll.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/bje/src-cvs/src/ld/pe-dll.c,v retrieving revision 1.74 diff -u -p -r1.74 pe-dll.c --- pe-dll.c 24 Oct 2004 01:00:12 -0000 1.74 +++ pe-dll.c 21 Jan 2005 00:09:19 -0000 @@ -1178,9 +1178,6 @@ generate_reloc (bfd *abfd, struct bfd_li free (relocs); /* Warning: the allocated symbols are remembered in BFD and reused later, so don't free them! */ -#if 0 - free (symbol); -#endif } } =20 @@ -2037,9 +2034,6 @@ make_import_fixup_entry (const char *nam symtab =3D xmalloc (6 * sizeof (asymbol *)); id3 =3D quick_section (abfd, ".idata$3", SEC_HAS_CONTENTS, 2); =20 -#if 0 - quick_symbol (abfd, U ("_head_"), dll_symname, "", id2, BSF_GLOBAL, 0); -#endif quick_symbol (abfd, U ("_nm_thnk_"), name, "", UNDSEC, BSF_GLOBAL, 0); quick_symbol (abfd, U (""), dll_symname, "_iname", UNDSEC, BSF_GLOBAL, 0= ); quick_symbol (abfd, "", fixup_name, "", UNDSEC, BSF_GLOBAL, 0); @@ -2417,18 +2411,6 @@ pe_get32 (bfd *abfd, int where) bfd_bread (b, (bfd_size_type) 4, abfd); return b[0] + (b[1] << 8) + (b[2] << 16) + (b[3] << 24); } - -#if 0 /* This is not currently used. */ - -static unsigned int -pe_as16 (void *ptr) -{ - unsigned char *b =3D ptr; - - return b[0] + (b[1] << 8); -} - -#endif =20 static unsigned int pe_as32 (void *ptr) Index: emultempl/beos.em =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/bje/src-cvs/src/ld/emultempl/beos.em,v retrieving revision 1.25 diff -u -p -r1.25 beos.em --- emultempl/beos.em 3 Jan 2004 11:09:07 -0000 1.25 +++ emultempl/beos.em 21 Jan 2005 00:09:43 -0000 @@ -187,10 +187,6 @@ set_pe_subsystem (void) { "wwindows", 2, "_wWinMainCRTStartup" }, { "console", 3, "_mainCRTStartup" }, { "wconsole", 3, "_wmainCRTStartup" }, -#if 0 - /* The Microsoft linker does not recognize this. */ - { "os2", 5, "" }, -#endif { "posix", 7, "___PosixProcessStartup"}, { 0, 0, 0 } }; Index: emultempl/hppaelf.em =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/bje/src-cvs/src/ld/emultempl/hppaelf.em,v retrieving revision 1.34 diff -u -p -r1.34 hppaelf.em --- emultempl/hppaelf.em 20 Jan 2005 07:47:49 -0000 1.34 +++ emultempl/hppaelf.em 21 Jan 2005 00:09:43 -0000 @@ -52,12 +52,6 @@ hppaelf_after_parse (void) { if (link_info.relocatable) lang_add_unique (".text"); -#if 0 /* Enable this once we split millicode stuff from libgcc. */ - else - lang_add_input_file ("milli", - lang_input_file_is_l_enum, - NULL); -#endif } =20 /* This is called before the input files are opened. We create a new Index: emultempl/pe.em =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/bje/src-cvs/src/ld/emultempl/pe.em,v retrieving revision 1.101 diff -u -p -r1.101 pe.em --- emultempl/pe.em 29 Dec 2004 05:59:29 -0000 1.101 +++ emultempl/pe.em 21 Jan 2005 00:09:43 -0000 @@ -1362,14 +1362,6 @@ gld_${EMULATION_NAME}_unrecognized_file=20 exp_assop ('=3D', "__image_base__", exp_intop (pe.ImageBase)); } =20 -#if 0 - /* Not sure if these *should* be set. */ - if (pe_def_file->version_major !=3D -1) - { - pe.MajorImageVersion =3D pe_def_file->version_major; - pe.MinorImageVersion =3D pe_def_file->version_minor; - } -#endif if (pe_def_file->stack_reserve !=3D -1 && ! saw_option ("__size_of_stack_reserve__")) { Index: emultempl/xtensaelf.em =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/bje/src-cvs/src/ld/emultempl/xtensaelf.em,v retrieving revision 1.6 diff -u -p -r1.6 xtensaelf.em --- emultempl/xtensaelf.em 12 Oct 2004 18:33:16 -0000 1.6 +++ emultempl/xtensaelf.em 21 Jan 2005 00:09:43 -0000 @@ -873,16 +873,6 @@ xtensa_colocate_literals (reloc_deps_gra if (deps->count =3D=3D 0) return; =20 -#if 0 - ld_assign_relative_paged_dot (0x100000, statement, deps, - xtensa_use_literal_pages); - - if (!ld_local_file_relocations_fit (statement, deps)) - fprintf (stderr, "initial relocation placement does not fit\n"); - - lang_for_each_statement_worker (xtensa_ldlang_clear_addresses, statement= ); -#endif - iter_stack_create (stack_p, statement); =20 while (!iter_stack_empty (stack_p)) --2oS5YaxWCcQjTEyO Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline Content-length: 189 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (GNU/Linux) iD8DBQFB8EjxMGpskFPkywkRAuz6AJ9wPlK3DK8lFMd8BBiCLdAGXD5FrwCfSp9k Jwj90fcy9DBRI4CLq1rgGeY= =rJrv -----END PGP SIGNATURE----- --2oS5YaxWCcQjTEyO--