From patchwork Fri Feb 9 02:26:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Modra X-Patchwork-Id: 198720 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp586517dyd; Thu, 8 Feb 2024 18:27:14 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUqZcPaiIFt3WhYRi97wE9VsfYRmIR8ZdACxhzJfgSkD0Il6xFEtRAtCZSDMVtdOuJlSpaSXE6p7IVcozgG2z6cHBhnbA== X-Google-Smtp-Source: AGHT+IH1ABelYFq4zH0Mf8fTBFqsgbLmlp76xs+JC16q6G3JM5g4yc1KxuUVjzeaeSzAs8y6iMWU X-Received: by 2002:a25:cec3:0:b0:dc2:349d:10cf with SMTP id x186-20020a25cec3000000b00dc2349d10cfmr191311ybe.53.1707445634307; Thu, 08 Feb 2024 18:27:14 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707445634; cv=pass; d=google.com; s=arc-20160816; b=F/EPXDRhxJuVpMco35mva8IvX3x/zYT785SIptFXhb+A9rKATmrpDYWSFGFprVMuiF JM1xfpmLxbriZ6fubDTYnaXgUi0+SIwbOKItnWHuG/f/xrk2fS3zQ6XDxUii0+5sKLYl zlH9iOeO32Yqef3eZRjBrQuo2BKo4UcgFyQtp5j1cDookZLty4LIqlLXNDXn0fDi7XIr Ac7ivwecp+ANlG+obNFVLMtmjQDVX/+DlLdEGZ5KkoNiIQkCA6sULXWWJv4pvCpLkHP0 WXQDpi6iUv8ouaDRmEpTaXShC7zrDtK0ZshOvCxpIV6WEXvYaaPXClybr/JOO8fqjyDa 7VLA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-disposition :mime-version:message-id:subject:to:from:date:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=ZJtVmm0igCahsQD7WMvpPctRCGkblVBR5l858bYNio0=; fh=rS9MBx0a2ub2CrlqoeY272BjTRi/MTSY20mCikmzRhs=; b=e3PoF3dfhsfe/9S0oerEUErzs+lnVZqIcezkrU1xIendeCGrDsGuWtz/F/iH0/xi/q PEAl3MoHrQfrrhoZCjBS/1WVOFL+PJw4AmLLrSXQj+uJ6OP5vAo4foizurzH3zYXOCZa bwVWHfdyjEDvVIg76nacRe99a68JweRkm2oyPsLleNCauvU+BudlPLphPV9AsPnVM8jp LWsAk1y/G/VVVHIY9kf23n8fhuDGgThHQga8nt8jxt3dV/hXhuI2xyzdfqNE52qNuhMQ SGGTU2B+g8M8FRPQwTVJCes3ErR0iy78jahy5aHtxYyKpc5blNbrtaSFBOal0zd6COh3 5YIQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=b+IQMouQ; arc=pass (i=1); spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com X-Forwarded-Encrypted: i=2; AJvYcCVIQaTVhI7iz/UvRDoKfg9cF3oGyo+NfukZkOEjvAhZUHB9INz08o8Swxn+QtT+EjwGylQiet4+CqIL9XO+2NasUeRHsA== Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id jl9-20020ad45e89000000b0068cc3b0f199si969526qvb.388.2024.02.08.18.27.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 18:27:14 -0800 (PST) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=b+IQMouQ; arc=pass (i=1); spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C2C1D3858407 for ; Fri, 9 Feb 2024 02:27:13 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by sourceware.org (Postfix) with ESMTPS id E0E393858C60 for ; Fri, 9 Feb 2024 02:27:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E0E393858C60 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org E0E393858C60 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::630 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707445626; cv=none; b=BGvB9vjJ2uO59Kl132gGbC5ASrM5mYwZpuhYekRyfYltnYUScd3QWdQw9VKQVmzX7hCk3TX+RweOz2aJkOCnAwJGhrR53RcSX9NWo9nblkEFRGQv2YuAYcyFe1/MpTdZij5wnj9sV3hxb65YAWfVgsTrK3t3YAPrEvK4CZzrSzg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707445626; c=relaxed/simple; bh=4zfxsebmRMyeygBo0t2ZFyAoU3H7QFI2xNedNpxqEx0=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=F4hG9oVRfedzHYqhV2QBXka+x33jiBCvprtRLCwUKDhIL9YWd9YIw1Y8k1lLgHi1vsf8ap/VCiw5+SrJZWjAiv3c56WgrQaSJpYfzF1GwheQVpwNwrjhfOn9CWhLLwfKJZR5nu5+lyguAre44ZnJyCPY5jzAwMVJ2QXd8Bgp9JM= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-1d780a392fdso3544695ad.3 for ; Thu, 08 Feb 2024 18:27:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707445622; x=1708050422; darn=sourceware.org; h=content-disposition:mime-version:message-id:subject:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=ZJtVmm0igCahsQD7WMvpPctRCGkblVBR5l858bYNio0=; b=b+IQMouQ7r3WSCarZ/LnbqqrzBRUZ7tGsk30VA0Szs4iG3Ds5FsSTjgqc1M4gSrqDp ngZd29d0haAhgYbcLi7I6mDzDT0E2jvJJ/V20N3tCo2EcKQMOQZR5SYh4PLEpalSHyNF VnRwn/XamM0U19rDV496nxxUWVNq4KbAWj8KKon+equQ3EtbKXqwZprrCNXzqjqEBvw3 Z/WFI38ALGVuv6JSm+puUjsdjml6eE2FLgwXhTpP4ZMJtGCmoncEuD5SISu9q2j9bhgu 13Pv+e9oN9tKBN2r9C4DxMhIPZLzTqC982uvjJujnrx6BjRW+m1HTPCDiwkdA2SgNa4o HUmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707445622; x=1708050422; h=content-disposition:mime-version:message-id:subject:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ZJtVmm0igCahsQD7WMvpPctRCGkblVBR5l858bYNio0=; b=OJNSgrJPIfMJf2nYDHQODj2kne6wn/gFq3jBdg3h1cZ6XXqAu7J9IQiGnG8v6QJ6rF m64frASLFs/GYJeWTL2Z+m794HT0JPlgUNzY8ECp19ZCm7sRzB42RxcLTuyHfd2dE5BE gSWcJBQ1pP1Z/+TzigHKL8Daq9nA0sK/H8OSNJHz87eb9j+lA7bqS7RTZRF46h3r1B3K IcnZC+4+MMZqSkYM9HfEVIdti4ASGcN+uyjfpCKQ/2xqiDJO/znVWihxPa4hlCPiEBlm NNF0wpd90jjhgi3qwvbvktxpV4aXvxgfV6Drq+ffq5dvH693jeLs7ObZ2dRSTcKyuP9I /Lwg== X-Gm-Message-State: AOJu0YwEhdFRxXJhr61SxlH0pMhheg3hfA0SBQEwwSgdMZuSGk68pGia AbY7+oIy5Sie7TisMdwP2egnQQS+7NJP9/BN3APbFu7esTRRnRWUWS/QiWFv X-Received: by 2002:a17:903:28d:b0:1d9:373a:6124 with SMTP id j13-20020a170903028d00b001d9373a6124mr275507plr.22.1707445621907; Thu, 08 Feb 2024 18:27:01 -0800 (PST) Received: from squeak.grove.modra.org ([2406:3400:51d:8cc0:5ce3:35a0:6e76:55d9]) by smtp.gmail.com with ESMTPSA id b3-20020a170903228300b001d9176f56f2sm450038plh.71.2024.02.08.18.27.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 18:27:01 -0800 (PST) Received: by squeak.grove.modra.org (Postfix, from userid 1000) id E6F5311409D6; Fri, 9 Feb 2024 12:56:56 +1030 (ACDT) Date: Fri, 9 Feb 2024 12:56:56 +1030 From: Alan Modra To: binutils@sourceware.org Subject: PR 14962 testcase xcoff failure Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-3033.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790386513441764265 X-GMAIL-MSGID: 1790386513441764265 Like https://sourceware.org/pipermail/binutils/2002-August/021279.html but for symbols defined in an xcoff object but then made absolute by a linker script. * xcofflink.c (xcoff_link_input_bfd): Set n_scnum correctly for symbols made absolute by a linker script. diff --git a/bfd/xcofflink.c b/bfd/xcofflink.c index 6ef9abcd883..49ac8efd1e8 100644 --- a/bfd/xcofflink.c +++ b/bfd/xcofflink.c @@ -5482,7 +5482,13 @@ xcoff_link_input_bfd (struct xcoff_final_link_info *flinfo, && isym.n_sclass != C_DECL && isym.n_scnum > 0) { - isym.n_scnum = (*csectpp)->output_section->target_index; + if (*sym_hash != NULL + && ((*sym_hash)->root.type == bfd_link_hash_defined + || (*sym_hash)->root.type == bfd_link_hash_defweak) + && (*sym_hash)->root.u.def.section == bfd_abs_section_ptr) + isym.n_scnum = N_ABS; + else + isym.n_scnum = (*csectpp)->output_section->target_index; isym.n_value += ((*csectpp)->output_section->vma + (*csectpp)->output_offset - (*csectpp)->vma);