From patchwork Thu Aug 31 10:52:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 22435 Received: (qmail 11288 invoked by alias); 31 Aug 2017 10:52:17 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 11275 invoked by uid 89); 31 Aug 2017 10:52:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-pg0-f49.google.com 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:subject:message-id:mime-version :content-disposition:user-agent; bh=/6L/1gGcF4EleTa9XQSsnqJQRoEUHJLDsXo37SUfi1E=; b=kTiU/bsmb+RTxdUL78DNcDW2rbM81LH8x4iLH3N9PSLO9xpOtzG9kDBP12P42DWpoB fBeQVVaVeeAt3qbSZiNKDBJoPB9QOqB96t8eu1oLdgWG0QFAKm4u/Zm3Irh2V/XskFuB 6+IbrPz61aEVw1l7fT2/vq8fzme9Q6jVBkq3K5a1uoGBS7jAvkynmhgsrNihWo3rQ0nz yYdF8wzcAC54cZzpnmPwYQAxY46Q1THjLpSHRrH4a6/+sC1P3qdytGvgSB6KNgdhkob4 8uLzXMktj2EtFsOA1uc+O0zwnk1FogcLSKRXspsva2bcVnNUTl87kyQZP33Q4UmMurLA jYMg== X-Gm-Message-State: AHYfb5j+zf0miLo8rwCH4e7ddfyFm2mM7Jlx5TNjMZ2DZymyldOiKfi7 ZmTxMtOJSs526osj X-Google-Smtp-Source: ADKCNb7a1DNMPD3G80wxUGMB2PPC2fnlCsh4HqIZuIFD2IRYwjl/v+1HiWOeCP/1zoGhGxYapVtSkw== X-Received: by 10.84.236.3 with SMTP id q3mr2146683plk.259.1504176724362; Thu, 31 Aug 2017 03:52:04 -0700 (PDT) Date: Thu, 31 Aug 2017 03:52:03 -0700 From: "H.J. Lu" To: GNU C Library Subject: [PATCH] Place $(elf-objpfx)sofini.os the last [BZ #22051] Message-ID: <20170831105203.GA18773@gmail.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.8.3 (2017-05-23) Since sofini.os terminates .eh_frame section, it should be placed the last. Tested on x86-64. OK for master? H.J. --- [BZ #22051] * Makerules (build-module-helper-objlist): Filter out $(elf-objpfx)sofini.os. (build-shlib-objlist): Append $(elf-objpfx)sofini.os if it is needed. --- Makerules | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Makerules b/Makerules index 8f1324d8e9..76f3c84ad4 100644 --- a/Makerules +++ b/Makerules @@ -686,14 +686,17 @@ $(build-module-helper) -o $@ $(shlib-lds-flags) \ $(call after-link,$@) endef +# sofini.os must be the last since it terminates .eh_frame section. build-module-helper-objlist = \ $(patsubst %_pic.a,$(whole-archive) %_pic.a $(no-whole-archive),\ $(filter-out %.lds $(map-file) $(+preinit) $(+postinit) \ + $(elf-objpfx)sofini.os \ $(link-libc-deps),$^)) build-module-objlist = $(build-module-helper-objlist) $(LDLIBS-$(@F:%.so=%).so) build-shlib-objlist = $(build-module-helper-objlist) \ - $(LDLIBS-$(@F:lib%.so=%).so) + $(LDLIBS-$(@F:lib%.so=%).so) \ + $(filter $(elf-objpfx)sofini.os,$^) # Don't try to use -lc when making libc.so itself. # Also omits crti.o and crtn.o, which we do not want