From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) by sourceware.org (Postfix) with ESMTPS id 218693858022 for ; Mon, 22 Feb 2021 04:57:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 218693858022 Received: by mail-pl1-x62e.google.com with SMTP id f8so6992067plg.5 for ; Sun, 21 Feb 2021 20:57:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=j5AJHHNNK/2oS719Ow5ZyCCzU8NKp5t1f0CNY+Y1vio=; b=iu2e87GyBgmMs/+ueMDF6ZoALtraX8R334EgKu8if7GlfzZVRYtzQTmgC/0x1AFKTn oHEu/00ZEG6Dk9JMrcDXJm4NeddO87Z/zgvdg47nGCXnISf+asEJTJ5p8E/0TEJdZDGi wkI/3og0ZZ1ayW1ZGciUAhf9/3H1Nt6CVYQc5b/Eq+5wPz6bakWNKBSegd8pxhGLVAG/ 1W+sCe856+Pw830LdzEEWYDHSWLsiLZ1QldGuh6lxEGCU167LanrMh4EE9WM+DB1oXxS bjk+CT+tIh/3+VurJuek8rRDvG3TnzrtatdPD6JeDn+X1DzSE+Q3zh/6jY4ON2lVyVOL WzfQ== X-Gm-Message-State: AOAM530LVK6Vp21np1TOop9+M3tT9/DOumDfgsM4DehcBgY53X/dfwWu E6LipZuOL8RQJj06KsVa4Ww= X-Google-Smtp-Source: ABdhPJySVxzos2+K9s9HXKhKhH4jDaRXC+lb8eEHW3R8u1HycqXu5G3WrMqFID7zA3DqLAbNqPfoTA== X-Received: by 2002:a17:902:d901:b029:e3:8f73:e759 with SMTP id c1-20020a170902d901b02900e38f73e759mr20959478plz.63.1613969869281; Sun, 21 Feb 2021 20:57:49 -0800 (PST) Received: from bubble.grove.modra.org (158.106.96.58.static.exetel.com.au. [58.96.106.158]) by smtp.gmail.com with ESMTPSA id e1sm13208072pjm.12.2021.02.21.20.57.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Feb 2021 20:57:48 -0800 (PST) Received: by bubble.grove.modra.org (Postfix, from userid 1000) id 4F6CD41E08; Mon, 22 Feb 2021 15:27:44 +1030 (ACDT) Date: Mon, 22 Feb 2021 15:27:44 +1030 From: Alan Modra To: "CHIGOT, CLEMENT" Cc: "binutils@sourceware.org" Subject: Re: [PATCH] bfd: add missing smclass when creating csect for xcoff64 Message-ID: <20210222045744.GA6042@bubble.grove.modra.org> References: <20210216021423.GO5348@bubble.grove.modra.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-Spam-Status: No, score=-3040.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Feb 2021 04:57:51 -0000 On Tue, Feb 16, 2021 at 09:31:08AM +0000, CHIGOT, CLEMENT wrote: > Hi Alan, > > > > This one is pretty simple, so I know that it won't change anyway. > > > > Maybe too simple.  You've added new sections without handling them at > > all in aix.sc, and in the case of .tl and .ul I'm fairly sure you will > > need to add quite a lot of code for thread-local support.  It is fine > > to have small patches in a series, but this patch in isolation is > > obviously incomplete. > > > > So I'd like to see a little more before committing the patch. > > Yes indeed, I've 6 patches coming up aiming to enable both TLS and large TOC > (not -bbigtoc from AIX ld, but the TOC generated when -mcmodel=large is passed > to gcc, making use of R_TOCU and R_TOCL relocations). > > I'll send them as a series. OK, so the next question is whether you have a copyright assignment agreement with the FSF for the binutils project? That is needed for non-trivial contributions to binutils. Also, I see +FAIL: XCOFF TOC reloc test 1 +FAIL: PowerPC Test 1, 32 bit XCOFF in the gas testsuite and +FAIL: Object for --just-symbols test in the ld testsuite with your patches applied. The last one, a segmentation fault in your new code, is easy to fix. Didn't you run the testsuite? The first two are related to a change I made with commit 3b8b57a949, selecting the reloc type earlier during insn parsing rather than later in md_apply_reloc. Unfortunately that affected the powerpc xcoff support with BFD_RELOC_16 not being changed to BFD_RELOC_PPC_TOC16 and then _bfd_xcoff_reloc_type_lookup failing. That's the origin of this code case BFD_RELOC_16: /* Note that this relocation is only internally used by gas. */ return &xcoff_howto_table[0xc]; which is wrong with your change to the howtos. However, git commit 0e2779e98dc means that handling BFD_RELOC_16 in reloc_type_lookup is no longer needed. I'm going to apply the following patch which will mean you don't need to worry about those gas fails. * coff-rs6000.c (_bfd_xcoff_reloc_type_lookup): Remove BFD_RELOC_16. * coff64-rs6000.c (xcoff64_reloc_type_lookup): Likewise. diff --git a/bfd/coff-rs6000.c b/bfd/coff-rs6000.c index fbc1aed311..54fbf58e3a 100644 --- a/bfd/coff-rs6000.c +++ b/bfd/coff-rs6000.c @@ -1092,9 +1092,6 @@ _bfd_xcoff_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, return &xcoff_howto_table[8]; case BFD_RELOC_PPC_TOC16: return &xcoff_howto_table[3]; - case BFD_RELOC_16: - /* Note that this relocation is only internally used by gas. */ - return &xcoff_howto_table[0xc]; case BFD_RELOC_PPC_B16: return &xcoff_howto_table[0x1d]; case BFD_RELOC_32: diff --git a/bfd/coff64-rs6000.c b/bfd/coff64-rs6000.c index 9aa0304ec9..98b0066822 100644 --- a/bfd/coff64-rs6000.c +++ b/bfd/coff64-rs6000.c @@ -1814,9 +1814,6 @@ xcoff64_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, return &xcoff64_howto_table[8]; case BFD_RELOC_PPC_TOC16: return &xcoff64_howto_table[3]; - case BFD_RELOC_16: - /* Note that this relocation is only internally used by gas. */ - return &xcoff64_howto_table[0xc]; case BFD_RELOC_PPC_B16: return &xcoff64_howto_table[0x1e]; case BFD_RELOC_32: -- Alan Modra Australia Development Lab, IBM