From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23926 invoked by alias); 21 Jan 2016 10:58:47 -0000 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 Received: (qmail 23908 invoked by uid 89); 21 Jan 2016 10:58:47 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=559, SECTION, vma, rel X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 21 Jan 2016 10:58:46 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 9039AC0ED40A; Thu, 21 Jan 2016 10:58:44 +0000 (UTC) Received: from littlehelper.redhat.com (vpn1-6-56.ams2.redhat.com [10.36.6.56]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u0LAwg18009509 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 21 Jan 2016 05:58:43 -0500 From: Nick Clifton To: Cupertino.Miranda@synopsys.com, Claudiu.Zissulescu@synopsys.com Cc: binutils@sourceware.org Subject: ARC: Build failure Date: Thu, 21 Jan 2016 10:58:00 -0000 Message-ID: <87lh7jw65a.fsf@redhat.com> MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2016-01/txt/msg00237.txt.bz2 Hi Miranda, Hi Zissulescu, I have just started encountering a build failure when building an all-targets toolchain configured for a 32-bit host: bfd/elf32-arc.c: In function 'elf_arc_finish_dynamic_symbol': bfd/elf32-arc.c:2248:21: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] bfd_vma loc = (bfd_vma) srelbss->contents ^ bfd/elf32-arc.c:2257:52: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] bfd_elf32_swap_reloca_out (output_bfd, &rel, (bfd_byte *) loc); ^ There are several more failures like this. I am not sure why you are using a bfd_vma to hold the location value, but a patch like the one below fixes the build problem for me. Do you have any objections to my applying it ? Cheers Nick diff --git a/bfd/elf32-arc.c b/bfd/elf32-arc.c index 0931c4e..8a46a2c 100644 --- a/bfd/elf32-arc.c +++ b/bfd/elf32-arc.c @@ -55,9 +55,9 @@ name_for_global_symbol (struct elf_link_hash_entry *h) { \ struct elf_link_hash_table *_htab = elf_hash_table (info); \ Elf_Internal_Rela _rel; \ - bfd_vma _loc; \ + bfd_byte * _loc; \ \ - _loc = (bfd_vma) _htab->srel##SECTION->contents \ + _loc = _htab->srel##SECTION->contents \ + ((_htab->srel##SECTION->reloc_count) \ * sizeof (Elf32_External_Rela)); \ _htab->srel##SECTION->reloc_count++; \ @@ -65,7 +65,7 @@ name_for_global_symbol (struct elf_link_hash_entry *h) _rel.r_offset = (_htab->s##SECTION)->output_section->vma \ + (_htab->s##SECTION)->output_offset + OFFSET; \ _rel.r_info = ELF32_R_INFO (SYM_IDX, TYPE); \ - bfd_elf32_swap_reloca_out (BFD, &_rel, (bfd_byte *) _loc); \ + bfd_elf32_swap_reloca_out (BFD, &_rel, _loc); \ } struct arc_local_data @@ -2245,8 +2245,8 @@ GOT_OFFSET = 0x%x, GOT_VMA = 0x%x, INDEX = %d, ADDEND = 0x%x\n", bfd_get_section_by_name (h->root.u.def.section->owner, ".rela.bss"); - bfd_vma loc = (bfd_vma) srelbss->contents - + (srelbss->reloc_count * sizeof (Elf32_External_Rela)); + bfd_byte * loc = srelbss->contents + + (srelbss->reloc_count * sizeof (Elf32_External_Rela)); srelbss->reloc_count++; Elf_Internal_Rela rel; @@ -2254,7 +2254,7 @@ GOT_OFFSET = 0x%x, GOT_VMA = 0x%x, INDEX = %d, ADDEND = 0x%x\n", rel.r_offset = rel_offset; rel.r_info = ELF32_R_INFO (h->dynindx, R_ARC_COPY); - bfd_elf32_swap_reloca_out (output_bfd, &rel, (bfd_byte *) loc); + bfd_elf32_swap_reloca_out (output_bfd, &rel, loc); } /* Mark _DYNAMIC and _GLOBAL_OFFSET_TABLE_ as absolute. */