From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io1-xd41.google.com (mail-io1-xd41.google.com [IPv6:2607:f8b0:4864:20::d41]) by sourceware.org (Postfix) with ESMTPS id A4F73386F803 for ; Thu, 30 Jul 2020 11:52:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org A4F73386F803 Received: by mail-io1-xd41.google.com with SMTP id z6so27940475iow.6 for ; Thu, 30 Jul 2020 04:52:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=zLu32gkZFCn7Sfdt+IDLbYgWRItxOh4xTYZ9YbmOL9M=; b=tM25FsRqHX+6kaTgO7f0U6IemRbApyfxCQQV1oCDhm2+M19VdZyAxQbE4IPEcclOTq ipDacMhGuRfD60FQJgkwNXQ7qWMLJp0Jp+fZCtUJW8FDdKsePYlUKS3Y7ZZznPwCzElA E5IZCVYVyM16uG6WuONuveKoTAhLXbLZqf/Er06+rqqMAEuqy/eo7CJaWzY1ooxtOpI1 i6rx7n+dRwsD52TQ/IO9LPXAQ5OFRiS/bekHndPeT3zvhFhpAoKPBRHhaTMQSstKjjTn ZG6L3Q5/3c8xPYRTbiXU6SBlZiiCL7OSJLE2kpZwd5tiXCyuz76FI+r9ogMJVNmL2N1V CWpA== X-Gm-Message-State: AOAM531ZEedB+dZD4leXlaUF8onmpf4seyMO3JB4iwJkxM3ByXRIXRnJ tYNIFJyvE0g3+ABc46tzXvIdOV8+/jLMOtAaVke1ImElxU8= X-Google-Smtp-Source: ABdhPJzxO43WCklHkmhLO/+eIVS1x+D5a0Xjt8ulDnc0pKDVAY+WIhDNyShb9DgErvas/0sm/W1lClG7uhdX+d/IS8c= X-Received: by 2002:a6b:8b86:: with SMTP id n128mr37948989iod.202.1596109931074; Thu, 30 Jul 2020 04:52:11 -0700 (PDT) MIME-Version: 1.0 References: <20200729222258.3016925-1-hjl.tools@gmail.com> <20200730093214.GT9601@bubble.grove.modra.org> In-Reply-To: <20200730093214.GT9601@bubble.grove.modra.org> From: "H.J. Lu" Date: Thu, 30 Jul 2020 04:51:35 -0700 Message-ID: Subject: Re: [PATCH] LTO: Ignore undefined symbols without relocation To: Alan Modra Cc: Binutils Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, 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: Thu, 30 Jul 2020 11:52:12 -0000 On Thu, Jul 30, 2020 at 2:32 AM Alan Modra wrote: > > On Wed, Jul 29, 2020 at 03:22:58PM -0700, H.J. Lu via Binutils wrote: > > Normally an undefined symbol is treated as a reference. Linker will > > try to satisfy the reference. This feature is used to bring a symbol > > definition into output without explicit relocation. If there is no > > definition nor relocation, linker will remove undefined symbol from > > symbol table in output (PR ld/4317). But GCC 10 LTO may generate > > separate debug info files which contain undefined symbols without > > relocations: > > Surely this is just a gcc bug? We search libraries again after > loading the LTO output, so one would expect that undefined symbols > satisfied by an archive (or as-needed shared library) would lead to > extra files being linked. > > I'd like to better understand just how this problem occurs though. As > it is, I suspect there might be something else going on here, for > example, ranlib being run without a plugin when building the archives. A testcase is on pr96385 branch at: https://gitlab.com/x86-gcc/gcc-bugs -- H.J.