From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4753 invoked by alias); 14 Jun 2011 04:04:24 -0000 Received: (qmail 4714 invoked by uid 22791); 14 Jun 2011 04:04:22 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,TW_FX,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from mail-iw0-f169.google.com (HELO mail-iw0-f169.google.com) (209.85.214.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 14 Jun 2011 04:04:03 +0000 Received: by iwg8 with SMTP id 8so6059823iwg.0 for ; Mon, 13 Jun 2011 21:04:02 -0700 (PDT) Received: by 10.42.165.67 with SMTP id j3mr7443782icy.368.1308024242377; Mon, 13 Jun 2011 21:04:02 -0700 (PDT) Received: from bubble.grove.modra.org ([115.187.252.19]) by mx.google.com with ESMTPS id vn4sm5363727icb.7.2011.06.13.21.03.59 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 13 Jun 2011 21:04:01 -0700 (PDT) Received: by bubble.grove.modra.org (Postfix, from userid 1000) id CE49B170C1B4; Tue, 14 Jun 2011 13:33:54 +0930 (CST) Date: Tue, 14 Jun 2011 04:04:00 -0000 From: Alan Modra To: binutils@sourceware.org Cc: Walter Lee Subject: Re: new port for TILEPro and TILE-Gx processors (toplevel files) Message-ID: <20110614040354.GG22863@bubble.grove.modra.org> Mail-Followup-To: binutils@sourceware.org, Walter Lee References: <4DE95335.7040302@tilera.com> <4DF1B3C0.3040206@tilera.com> <4DF1B48F.5090502@tilera.com> <4DF62DA7.0@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4DF62DA7.0@redhat.com> User-Agent: Mutt/1.5.20 (2009-06-14) 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/msg00177.txt.bz2 Committed. * elf32-tilepro.c (tilepro_elf_size_dynamic_sections): Don't use PTR. (allocate_dynrelocs, readonly_dynrelocs): Replace PTR with void *. Don't handle warning symbols here. * elfxx-tilegx.c (tilegx_elf_size_dynamic_sections): As above. (allocate_dynrelocs, readonly_dynrelocs): As above. Index: bfd/elf32-tilepro.c =================================================================== RCS file: /cvs/src/src/bfd/elf32-tilepro.c,v retrieving revision 1.2 diff -u -p -r1.2 elf32-tilepro.c --- bfd/elf32-tilepro.c 13 Jun 2011 15:57:19 -0000 1.2 +++ bfd/elf32-tilepro.c 14 Jun 2011 03:54:45 -0000 @@ -1969,7 +1969,7 @@ tilepro_elf_adjust_dynamic_symbol (struc dynamic relocs. */ static bfd_boolean -allocate_dynrelocs (struct elf_link_hash_entry *h, PTR inf) +allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf) { struct bfd_link_info *info; struct tilepro_elf_link_hash_table *htab; @@ -1979,12 +1979,6 @@ allocate_dynrelocs (struct elf_link_hash if (h->root.type == bfd_link_hash_indirect) return TRUE; - if (h->root.type == bfd_link_hash_warning) - /* When warning symbols are created, they **replace** the "real" - entry in the hash table, thus we never get to see the real - symbol in a hash traversal. So look at it now. */ - h = (struct elf_link_hash_entry *) h->root.u.i.link; - info = (struct bfd_link_info *) inf; htab = tilepro_elf_hash_table (info); BFD_ASSERT (htab != NULL); @@ -2170,14 +2164,11 @@ allocate_dynrelocs (struct elf_link_hash /* Find any dynamic relocs that apply to read-only sections. */ static bfd_boolean -readonly_dynrelocs (struct elf_link_hash_entry *h, PTR inf) +readonly_dynrelocs (struct elf_link_hash_entry *h, void *inf) { struct tilepro_elf_link_hash_entry *eh; struct tilepro_elf_dyn_relocs *p; - if (h->root.type == bfd_link_hash_warning) - h = (struct elf_link_hash_entry *) h->root.u.i.link; - eh = (struct tilepro_elf_link_hash_entry *) h; for (p = eh->dyn_relocs; p != NULL; p = p->next) { @@ -2313,7 +2304,7 @@ tilepro_elf_size_dynamic_sections (bfd * /* Allocate global sym .plt and .got entries, and space for global sym dynamic relocs. */ - elf_link_hash_traverse (&htab->elf, allocate_dynrelocs, (PTR) info); + elf_link_hash_traverse (&htab->elf, allocate_dynrelocs, info); if (elf_hash_table (info)->dynamic_sections_created) { @@ -2436,8 +2427,7 @@ tilepro_elf_size_dynamic_sections (bfd * /* If any dynamic relocs apply to a read-only section, then we need a DT_TEXTREL entry. */ if ((info->flags & DF_TEXTREL) == 0) - elf_link_hash_traverse (&htab->elf, readonly_dynrelocs, - (PTR) info); + elf_link_hash_traverse (&htab->elf, readonly_dynrelocs, info); if (info->flags & DF_TEXTREL) { Index: bfd/elfxx-tilegx.c =================================================================== RCS file: /cvs/src/src/bfd/elfxx-tilegx.c,v retrieving revision 1.2 diff -u -p -r1.2 elfxx-tilegx.c --- bfd/elfxx-tilegx.c 13 Jun 2011 15:57:19 -0000 1.2 +++ bfd/elfxx-tilegx.c 14 Jun 2011 03:54:46 -0000 @@ -2290,7 +2290,7 @@ tilegx_elf_adjust_dynamic_symbol (struct dynamic relocs. */ static bfd_boolean -allocate_dynrelocs (struct elf_link_hash_entry *h, PTR inf) +allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf) { struct bfd_link_info *info; struct tilegx_elf_link_hash_table *htab; @@ -2300,12 +2300,6 @@ allocate_dynrelocs (struct elf_link_hash if (h->root.type == bfd_link_hash_indirect) return TRUE; - if (h->root.type == bfd_link_hash_warning) - /* When warning symbols are created, they **replace** the "real" - entry in the hash table, thus we never get to see the real - symbol in a hash traversal. So look at it now. */ - h = (struct elf_link_hash_entry *) h->root.u.i.link; - info = (struct bfd_link_info *) inf; htab = tilegx_elf_hash_table (info); BFD_ASSERT (htab != NULL); @@ -2490,14 +2484,11 @@ allocate_dynrelocs (struct elf_link_hash /* Find any dynamic relocs that apply to read-only sections. */ static bfd_boolean -readonly_dynrelocs (struct elf_link_hash_entry *h, PTR inf) +readonly_dynrelocs (struct elf_link_hash_entry *h, void *inf) { struct tilegx_elf_link_hash_entry *eh; struct tilegx_elf_dyn_relocs *p; - if (h->root.type == bfd_link_hash_warning) - h = (struct elf_link_hash_entry *) h->root.u.i.link; - eh = (struct tilegx_elf_link_hash_entry *) h; for (p = eh->dyn_relocs; p != NULL; p = p->next) { @@ -2627,7 +2618,7 @@ tilegx_elf_size_dynamic_sections (bfd *o /* Allocate global sym .plt and .got entries, and space for global sym dynamic relocs. */ - elf_link_hash_traverse (&htab->elf, allocate_dynrelocs, (PTR) info); + elf_link_hash_traverse (&htab->elf, allocate_dynrelocs, info); if (elf_hash_table (info)->dynamic_sections_created) { @@ -2750,8 +2741,7 @@ tilegx_elf_size_dynamic_sections (bfd *o /* If any dynamic relocs apply to a read-only section, then we need a DT_TEXTREL entry. */ if ((info->flags & DF_TEXTREL) == 0) - elf_link_hash_traverse (&htab->elf, readonly_dynrelocs, - (PTR) info); + elf_link_hash_traverse (&htab->elf, readonly_dynrelocs, info); if (info->flags & DF_TEXTREL) { -- Alan Modra Australia Development Lab, IBM