From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32186 invoked by alias); 8 Jun 2011 03:54:03 -0000 Received: (qmail 32177 invoked by uid 22791); 8 Jun 2011 03:54:01 -0000 X-SWARE-Spam-Status: No, hits=0.6 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,KAM_STOCKGEN,SPF_HELO_PASS,T_RP_MATCHES_RCVD,URIBL_BLACK X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (74.125.121.67) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 08 Jun 2011 03:53:47 +0000 Received: from kpbe16.cbf.corp.google.com (kpbe16.cbf.corp.google.com [172.25.105.80]) by smtp-out.google.com with ESMTP id p583rj3m025857 for ; Tue, 7 Jun 2011 20:53:46 -0700 Received: from gyb11 (gyb11.prod.google.com [10.243.49.75]) by kpbe16.cbf.corp.google.com with ESMTP id p583rhDV023396 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Tue, 7 Jun 2011 20:53:44 -0700 Received: by gyb11 with SMTP id 11so72835gyb.1 for ; Tue, 07 Jun 2011 20:53:43 -0700 (PDT) MIME-Version: 1.0 Received: by 10.101.218.19 with SMTP id v19mr5584268anq.152.1307505223619; Tue, 07 Jun 2011 20:53:43 -0700 (PDT) Received: by 10.100.131.8 with HTTP; Tue, 7 Jun 2011 20:53:43 -0700 (PDT) In-Reply-To: References: Date: Wed, 08 Jun 2011 03:54:00 -0000 Message-ID: Subject: Re: [gold patch] Incremental 17/22: COPY relocations From: Cary Coutant To: Ian Lance Taylor Cc: Binutils Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-System-Of-Record: true 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: 2011-06/txt/msg00082.txt.bz2 >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (sym->source() =3D=3D Symbol::FROM_OBJECT >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 && sym->object() =3D=3D obj >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 && sym->is_defined()) >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 def_flag =3D 1U << 31; >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 def_flag =3D 2U << 30; >> + =A0 =A0 =A0 =A0 =A0 =A0 else if (sym->is_copied_from_dynobj() >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0&& this->symtab_->get_copy_= source(sym) =3D=3D dynobj) >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 def_flag =3D 3U << 30; > > Let's give some names to 1U, 2U, 3U, and 30. Done. I added these: * incremental.h (enum Incremental_shlib_symbol_flags): New type. (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant. >> - =A0 =A0 =A0*is_def =3D (output_symndx & (1U << 31)) !=3D 0; >> - =A0 =A0 =A0return output_symndx & ((1U << 31) - 1); >> + =A0 =A0 =A0*is_def =3D (output_symndx >> 31) =3D=3D 1; >> + =A0 =A0 =A0*is_copy =3D (output_symndx >> 30) =3D=3D 3; >> + =A0 =A0 =A0return output_symndx & ((1U << 30) - 1); > > This is kind of tricky considering how the bits are set; better to use a > switch on output_symndx >> 30, I think. Done. > This is OK with those changes. Thanks, committed. Updated ChangeLog below. >> (I split a couple of patches and added a couple, so the total patch >> count is now up to 22.) > > Don't think I didn't notice that you're up to 25 now. Heh, heh. I'll stop numbering them now. -cary * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc instead of emit_copy_reloc. (Copy_relocs::emit_copy_reloc): Refactor. (Copy_relocs::make_copy_reloc): New function. (Copy_relocs::add_copy_reloc): Remove. * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public section. (Copy_relocs::make_copy_reloc): New function. (Copy_relocs::add_copy_reloc): Remove. * gold.cc (queue_middle_tasks): Emit old COPY relocations from unchanged input files. * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag. * incremental.cc (Sized_incremental_binary::do_reserve_layout): Reserve BSS space for COPY relocations. (Sized_incremental_binary::do_emit_copy_relocs): New function. (Output_section_incremental_inputs::write_info_blocks): Record whether a symbol is copied from a shared object. (Sized_incr_dynobj::do_add_symbols): Record COPY relocations. * incremental.h (enum Incremental_shlib_symbol_flags): New type. (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant. (Incremental_input_entry_reader::get_output_symbol_index): Add is_copy parameter. (Incremental_binary::emit_copy_relocs): New function. (Incremental_binary::do_emit_copy_relocs): New function. (Sized_incremental_binary::Sized_incremental_binary): Initialize new data member. (Sized_incremental_binary::add_copy_reloc): New function. (Sized_incremental_binary::do_emit_copy_relocs): New function. (Sized_incremental_binary::Copy_reloc): New struct. (Sized_incremental_binary::Copy_relocs): New typedef. (Sized_incremental_binary::copy_relocs_): New data member. * symtab.cc (Symbol_table::add_from_incrobj): Change return type. * symtab.h (Symbol_table::add_from_incrobj): Change return type. * target.h (Sized_target::emit_copy_reloc): New function. * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.