From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6436 invoked by alias); 17 Dec 2010 19:55:56 -0000 Received: (qmail 6428 invoked by uid 22791); 17 Dec 2010 19:55:55 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from dns1.mips.com (HELO dns1.mips.com) (12.201.5.69) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 17 Dec 2010 19:55:51 +0000 Received: from exchdb01.mips.com (exchhub01.mips.com [192.168.36.84]) by dns1.mips.com (8.13.8/8.13.8) with ESMTP id oBHJtjre004761; Fri, 17 Dec 2010 11:55:45 -0800 Received: from EXCHDB02.MIPS.com ([fe80::98e8:2134:3c1d:2c76]) by exchhub01.mips.com ([::1]) with mapi; Fri, 17 Dec 2010 11:54:59 -0800 From: "Fu, Chao-Ying" To: "Maciej W. Rozycki" , Richard Sandiford , "Garbacea, Ilie" , Joseph Myers CC: "binutils@sourceware.org" , "Fuhler, Rich" , "Lau, David" , "Mills, Kevin" , Catherine Moore , Nathan Sidwell , Nathan Froyd Subject: RE: [PATCH] MIPS: microMIPS ASE support Date: Fri, 17 Dec 2010 20:56:00 -0000 Message-ID: <7C6479EB2BF52547AC332FD6034646DA3018F765@exchdb02.mips.com> References: <87y6fa9u3t.fsf@firetop.home> <876302kqvu.fsf@firetop.home> <871v5n9m7e.fsf@firetop.home> In-Reply-To: x-ems-proccessed: 6LP3oGfGVdcdb8o1aBnt6w== x-ems-stamp: SUr5y37dEg6yADgcoRmHGw== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-IsSubscribed: yes Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org X-SW-Source: 2010-12/txt/msg00531.txt.bz2 > Hello, >=20 > Ilie, Joseph: I have some questions for you below, please respond. Ilie is on vacations. > > > + /* Now adjust the global symbols defined in this section. */ > > > + symcount =3D (symtab_hdr->sh_size / sizeof (Elf32_External_Sym) > > > + - symtab_hdr->sh_info); > > > + sym_hashes =3D start_hashes =3D elf_sym_hashes (abfd); > > > + end_hashes =3D sym_hashes + symcount; > > > + > > > + for (; sym_hashes < end_hashes; sym_hashes++) > > > + { > > > + struct elf_link_hash_entry *sym_hash =3D *sym_hashes; > > > + > > > + if ((sym_hash->root.type =3D=3D bfd_link_hash_defined > > > + || sym_hash->root.type =3D=3D bfd_link_hash_defweak) > > > + && sym_hash->root.u.def.section =3D=3D sec > > > + && sym_hash->root.u.def.value > addr > > > + && sym_hash->root.u.def.value < toaddr) > > > + sym_hash->root.u.def.value -=3D count; > > > + } > >=20 > > ...if we're willing to extend the upper bound in this way, I wonder > > whether there's really any point having an upper bound at all. > >=20 > > Then again, why doesn't the standard range (used by most targets) > > include toaddr? If you define an end marker: > >=20 > > end_of_section: > > # nothing after this > >=20 > > then wouldn't end_of_section =3D=3D toaddr, and shouldn't it be=20 > included? >=20 > Ilie, I'm told you were responsible for this piece of code=20 > -- would you=20 > please respond to these questions? I think we should include "end_of_section =3D=3D toaddr". Ex: && sym_hash->root.u.def.value <=3D toaddr) > > > +static unsigned long > > > +find_match (unsigned long opcode, const struct=20 > opcode_descriptor insn[]) > > > +{ > > > + unsigned long indx; > > > + > > > + /* First opcode_table[] entry is ignored. */ > > > + for (indx =3D 1; insn[indx].mask !=3D 0; indx++) > > > + if (MATCH (opcode, insn[indx])) > > > + return indx; > > > + > > > + return 0; > > > +} > >=20 > > But _why_ is the first entry ignored? >=20 > There must be a reason, Ilie? I guess Ilie tries to avoid passing a single-entry table into find_match(= ). But if we do pass a single-entry table into find_match(),=20 find_match() may not find the end marker and it will be wrong anyway. Maybe we just delete all the { 1, 1 } entry in opcode_descriptor [] tables,= and find_match() doesn't ignore the first entry. And we make sure that each table has end marker at the end. Thanks! Regards, Chao-ying