From owner-svn-src-head@freebsd.org Mon Oct 15 09:43:49 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96B2E10D5368; Mon, 15 Oct 2018 09:43:49 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: from mail-it1-f169.google.com (mail-it1-f169.google.com [209.85.166.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 431A38CA97; Mon, 15 Oct 2018 09:43:49 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: by mail-it1-f169.google.com with SMTP id c85-v6so4477068itd.1; Mon, 15 Oct 2018 02:43:49 -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=qZNaS7RMmRA5ohud4FjdpVP/A7U4LK9ORU4B88MKtjc=; b=dcQG6BiErWL3IWXEtZloGFwxXPCAYouxd5E/XpIMjoFuHTBXLKyikVs2b0RX+3Wpcl Mb6dY7J3q5Xf1pqjQmkdQg5A8fB1Eiq8q1gucpZG2IXdMw/bRRj0bX7abQxcQuOUW/4T UtZVoHBbkhHK0Ga0xECbfPl79xTCfIaKyadMM6sVAQZkPTdZu8D9p6TnWlQJteJtZM/v uS/FPRq4cZBkkmKjcpqSnfksB6YNLdI23SgY85RzGcsiJoZouo6YIzplorGM8su1JhSz N9WljjoBeYh/16+OjHU4+h9dq+BH/IwhpgvPhCJWQIvyFfpF1MbYwBGZ3Ud0U0IhdoCa f23Q== X-Gm-Message-State: ABuFfoi25gEiqg9ZGu16dnFA/8WQS2JhKczl+iic9cP6jz1SQ+rYIMvf GsyNL9sa7+VDVuPhrckSPjC8EaTDO6Zlc/mTDCZnBRif X-Google-Smtp-Source: ACcGV60S9B3rI8cRJ8FYL0uGklkTMkqd/MN2iooxnp8QaOXwHOBcDXFaJGJWlljtSegCpAdkgz6NsNMz+YMxx0DU5/Y= X-Received: by 2002:a24:fe86:: with SMTP id w128-v6mr9106482ith.84.1539596288854; Mon, 15 Oct 2018 02:38:08 -0700 (PDT) MIME-Version: 1.0 References: <201810132126.w9DLQ73C022496@repo.freebsd.org> In-Reply-To: <201810132126.w9DLQ73C022496@repo.freebsd.org> From: Antoine Brodin Date: Mon, 15 Oct 2018 11:37:57 +0200 Message-ID: Subject: Re: svn commit: r339350 - head/contrib/elftoolchain/elfcopy To: Ed Maste , re Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Oct 2018 09:43:49 -0000 On Sat, Oct 13, 2018 at 11:26 PM Ed Maste wrote: > > Author: emaste > Date: Sat Oct 13 21:26:07 2018 > New Revision: 339350 > URL: https://svnweb.freebsd.org/changeset/base/339350 > > Log: > elfcopy: delete filter_reloc, it is broken and unnecessary > > elfcopy contained logic to filter individual relocations in STRIP_ALL > mode. However, this is not valid; relocations emitted by the linker are > required, unless they apply to an entire section being removed (which is > handled by other logic in elfcopy). > > Note that filter_reloc was also buggy: for RELA relocation sections it > operated on uninitialized rel.r_info resulting in invalid operation. > > The logic most likely needs to be inverted: instead of removing > relocations because their associated symbols are being removed, we must > keep symbols referenced by relocations. That said, in practice we do > not encounter this code path today: objects being stripped are either > dynamically linked binaries which retain .dynsym, or static binaries > with no relocations. > > Just remove filter_reloc. This fixes certain cases including statically > linked binaries containing ifuncs. Stripping binaries with relocations > referencing removed symbols was already broken, and after this change > may still be broken in a different way. > > PR: 232176 > Reviewed by: kaiw, kib, markj > Approved by: re (rgrimes) > MFC after: 1 month > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D17519 > > Modified: > head/contrib/elftoolchain/elfcopy/sections.c Hi, This commit broke lang/gcc* : http://gohan2.ysv.freebsd.org/data/head-amd64-default-baseline/p482125_s339356/logs/errors/gcc48-4.8.5_9.log http://gohan2.ysv.freebsd.org/data/head-amd64-default-baseline/p482125_s339356/logs/errors/gcc49-4.9.4_8.log http://gohan2.ysv.freebsd.org/data/head-amd64-default-baseline/p482125_s339356/logs/errors/gcc5-5.5.0_5.log http://gohan2.ysv.freebsd.org/data/head-amd64-default-baseline/p482125_s339356/logs/errors/gcc7-7.3.0_5.log http://gohan2.ysv.freebsd.org/data/head-amd64-default-baseline/p482125_s339356/logs/errors/gcc8-8.2.0_1.log etc. Antoine