From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8678 invoked by alias); 31 Jan 2005 15:14:23 -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 7266 invoked from network); 31 Jan 2005 15:12:56 -0000 Received: from unknown (HELO iris1.csv.ica.uni-stuttgart.de) (129.69.118.2) by sourceware.org with SMTP; 31 Jan 2005 15:12:56 -0000 Received: from rembrandt.csv.ica.uni-stuttgart.de ([129.69.118.42]) by iris1.csv.ica.uni-stuttgart.de with esmtp id 1CvdEM-0002Zt-00; Mon, 31 Jan 2005 16:12:46 +0100 Received: from ica2_ts by rembrandt.csv.ica.uni-stuttgart.de with local (Exim 3.35 #1 (Debian)) id 1CvdEK-0004vx-00; Mon, 31 Jan 2005 16:12:44 +0100 Date: Mon, 31 Jan 2005 15:14:00 -0000 To: Ben Elliston Cc: binutils@sources.redhat.com, Richard Sandiford Subject: Re: bfd cleanups Message-ID: <20050131151244.GG15265@rembrandt.csv.ica.uni-stuttgart.de> References: <20050131052731.GA16841@namadgi> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="6Vw0j8UKbyX0bfpA" Content-Disposition: inline In-Reply-To: <20050131052731.GA16841@namadgi> User-Agent: Mutt/1.5.6+20040907i From: Thiemo Seufer X-SW-Source: 2005-01/txt/msg00550.txt.bz2 --6Vw0j8UKbyX0bfpA Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 4975 Ben Elliston wrote: > Here's a whole raft of cleanups. Again, please speak up if anything > should be kept! Tested with a binutils --enable-targets=3Dall build. [snip] > Index: elf64-mips.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/bfd/elf64-mips.c,v > retrieving revision 1.62 > diff -u -p -u -r1.62 elf64-mips.c > --- elf64-mips.c 7 Oct 2004 19:15:28 -0000 1.62 > +++ elf64-mips.c 31 Jan 2005 05:25:08 -0000 > @@ -1367,9 +1367,6 @@ mips_elf64_be_swap_reloc_out (bfd *abfd, >=20=20 > mirel.r_offset =3D src[0].r_offset; > BFD_ASSERT(src[0].r_offset =3D=3D src[1].r_offset); > -#if 0 > - BFD_ASSERT(src[0].r_offset =3D=3D src[2].r_offset); > -#endif This looks wrong, the r_offset has to be the same for all three. I wonder why it is ifdef'ed out. [snip] > Index: elfxx-mips.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/bfd/elfxx-mips.c,v > retrieving revision 1.117 > diff -u -p -u -r1.117 elfxx-mips.c > --- elfxx-mips.c 14 Dec 2004 09:48:10 -0000 1.117 > +++ elfxx-mips.c 31 Jan 2005 05:25:08 -0000 [snip] > @@ -4617,10 +4582,6 @@ _bfd_mips_elf_fake_sections (bfd *abfd,=20 > { > if (SGI_COMPAT (abfd)) > hdr->sh_entsize =3D 0; > -#if 0 > - /* This isn't how the IRIX6 linker behaves. */ > - hdr->sh_info =3D SIZEOF_MIPS_DYNSYM_SECNAMES; > -#endif This should be retained (and probably changed for !IRIX ?). [snip] > @@ -7521,41 +7466,6 @@ _bfd_mips_elf_gc_sweep_hook (bfd *abfd A > asection *sec ATTRIBUTE_UNUSED, > const Elf_Internal_Rela *relocs ATTRIBUTE_UNUSED) > { > -#if 0 > - Elf_Internal_Shdr *symtab_hdr; > - struct elf_link_hash_entry **sym_hashes; > - bfd_signed_vma *local_got_refcounts; > - const Elf_Internal_Rela *rel, *relend; > - unsigned long r_symndx; > - struct elf_link_hash_entry *h; > - > - symtab_hdr =3D &elf_tdata (abfd)->symtab_hdr; > - sym_hashes =3D elf_sym_hashes (abfd); > - local_got_refcounts =3D elf_local_got_refcounts (abfd); > - > - relend =3D relocs + sec->reloc_count; > - for (rel =3D relocs; rel < relend; rel++) > - switch (ELF_R_TYPE (abfd, rel->r_info)) > - { > - case R_MIPS_GOT16: > - case R_MIPS_CALL16: > - case R_MIPS_CALL_HI16: > - case R_MIPS_CALL_LO16: > - case R_MIPS_GOT_HI16: > - case R_MIPS_GOT_LO16: > - case R_MIPS_GOT_DISP: > - case R_MIPS_GOT_PAGE: > - case R_MIPS_GOT_OFST: > - /* ??? It would seem that the existing MIPS code does no sort > - of reference counting or whatnot on its GOT and PLT entries, > - so it is not possible to garbage collect them at this time. */ > - break; > - > - default: > - break; > - } > -#endif > - This should also stay, (and still waits for implementation... ). [snip] > @@ -8187,47 +8092,6 @@ _bfd_mips_elf_final_link (bfd *abfd, str > - g->global_gotsym->dynindx) > <=3D g->global_gotno); > } > - > -#if 0 > - /* We want to set the GP value for ld -r. */ > - /* On IRIX5, we omit the .options section. On IRIX6, however, we > - include it, even though we don't process it quite right. (Some > - entries are supposed to be merged.) Empirically, we seem to be > - better off including it then not. */ > - if (IRIX_COMPAT (abfd) =3D=3D ict_irix5 || IRIX_COMPAT (abfd) =3D=3D i= ct_none) > - for (secpp =3D &abfd->sections; *secpp !=3D NULL; secpp =3D &(*secpp= )->next) > - { > - if (strcmp ((*secpp)->name, MIPS_ELF_OPTIONS_SECTION_NAME (abfd)) =3D= =3D 0) > - { > - for (p =3D (*secpp)->link_order_head; p !=3D NULL; p =3D p->next) > - if (p->type =3D=3D bfd_indirect_link_order) > - p->u.indirect.section->flags &=3D ~SEC_HAS_CONTENTS; > - (*secpp)->link_order_head =3D NULL; > - bfd_section_list_remove (abfd, secpp); > - --abfd->section_count; > - > - break; > - } > - } > - > - /* We include .MIPS.options, even though we don't process it quite rig= ht. > - (Some entries are supposed to be merged.) At IRIX6 empirically we = seem > - to be better off including it than not. */ > - for (secpp =3D &abfd->sections; *secpp !=3D NULL; secpp =3D &(*secpp)-= >next) > - { > - if (strcmp ((*secpp)->name, ".MIPS.options") =3D=3D 0) > - { > - for (p =3D (*secpp)->link_order_head; p !=3D NULL; p =3D p->next) > - if (p->type =3D=3D bfd_indirect_link_order) > - p->u.indirect.section->flags &=3D~ SEC_HAS_CONTENTS; > - (*secpp)->link_order_head =3D NULL; > - bfd_section_list_remove (abfd, secpp); > - --abfd->section_count; > - > - break; > - } > - } > -#endif Richard, is this code obsolete for IRIX? Thiemo --6Vw0j8UKbyX0bfpA Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline Content-length: 240 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iEYEARECAAYFAkH+SuwACgkQXNuq0tFCNaA8/wCdEoSv3y3NjBZFHRky1prgZD6b eRsAoMazP8YIvvsTfKHTzquox+Ho9vEM =iMvo -----END PGP SIGNATURE----- --6Vw0j8UKbyX0bfpA--