From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-x531.google.com (mail-pg1-x531.google.com [IPv6:2607:f8b0:4864:20::531]) by sourceware.org (Postfix) with ESMTPS id 24A913858415 for ; Sat, 5 Feb 2022 15:32:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 24A913858415 Received: by mail-pg1-x531.google.com with SMTP id 132so7654447pga.5 for ; Sat, 05 Feb 2022 07:32:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=LX1waua4mrAMjlgxmccGzx6LbVWxPzjmZJF4N+VVcb8=; b=emvRFsV6yGcM7N+A6VfHYfdTSzflWlHKaiyE4dmmXGkjiK4VhZXnxnmG+/gOfg4/x1 xMEcP2BIsf+cdiUyg0rEaa/JlzAOknX1eGnr2oKPAfyeNy7xF0jUW49nK8LIqqcQNrjg 0tczaOtDeQbhRVZvfrvquGYjzxpxAdGB5ZzuOo0cEfpnq5/G2Y5b7jrcfLEY6iQr8Fp9 cJjJHiP5NnxYp/UUMWIuL1vVHWECxuAmiMAbj6EsZeJhwOV1hkqf6UHMZ9KUythY7y+l JwVR2Hrrc9m0FXiwIanYK0tzjjNHqJ1kpSyMAwybcANtQ5Pd8JXHTSJ1SRaA9UP+flFl 13IA== X-Gm-Message-State: AOAM5303Ev7f4jtYcGzTVST5ZLjsKYdTiJ+AXSObxrvGEqLogiykf1a1 HC6yx7AXlEBwef6gJya53hw= X-Google-Smtp-Source: ABdhPJzZaL4SL2pH8IzTeV0yvZnQJnrBcWogK7uF6X51TWLpGDu6OHZWJtNVS/mlM3Yhe/8mNgfOag== X-Received: by 2002:a05:6a00:2cf:: with SMTP id b15mr8196510pft.0.1644075156092; Sat, 05 Feb 2022 07:32:36 -0800 (PST) Received: from gnu-tgl-3.localdomain ([172.58.38.240]) by smtp.gmail.com with ESMTPSA id y13sm6233670pfi.2.2022.02.05.07.32.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Feb 2022 07:32:35 -0800 (PST) Received: by gnu-tgl-3.localdomain (Postfix, from userid 1000) id 547F4C08CC; Sat, 5 Feb 2022 07:32:34 -0800 (PST) Date: Sat, 5 Feb 2022 07:32:34 -0800 From: "H.J. Lu" To: binutils@sourceware.org Subject: [PATCH] x86: Skip undefined symbol when finishing DT_RELR Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-3029.8 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.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Sat, 05 Feb 2022 15:32:38 -0000 I am checking this and backporting it to 2.38 branch. H.J. --- Don't abort for undefined symbol when finishing DT_RELR. Instead, skip undefined symbol. Undefined symbol will be reported by relocate_section. * elfxx-x86.c (elf_x86_size_or_finish_relative_reloc): Skip undefined symbol in finishing phase. --- bfd/elfxx-x86.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bfd/elfxx-x86.c b/bfd/elfxx-x86.c index da8a488db36..f58a0a1ac3c 100644 --- a/bfd/elfxx-x86.c +++ b/bfd/elfxx-x86.c @@ -1484,11 +1484,13 @@ elf_x86_size_or_finish_relative_reloc } else { - /* Allow undefined symbol only at the sizing phase. */ + /* Allow undefined symbol only at the sizing phase. + Otherwise skip undefined symbol here. Undefined + symbol will be reported by relocate_section. */ if (outrel == NULL) relocation = 0; else - abort (); + continue; } } else -- 2.34.1