From patchwork Fri Sep 29 21:32:31 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: 23244 Received: (qmail 28650 invoked by alias); 29 Sep 2017 21:32:44 -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 21523 invoked by uid 89); 29 Sep 2017 21:32:40 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.1 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, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:861 X-HELO: mail-io0-f181.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=Pn1+rWdbw4+QfFadNDMMkjDiYgyZaLNFOT24uMgXMzg=; b=TqF9cFP1GU0yb8h2fRTJ7vIckGhrTpHwZJuiiHADO9oQNaQrSue8wHskIYVGQN+E1d D/JxKjUg99EBefClzbuIw+PdRR+6hLgrvQ1QC49nf3N3LAfabzxYltXoLizL3WfGSzAU hf2LyrY8idNMvotSF+ebtC/7mNflL1WCvgvEbv2z3b407YrTTldlXcODx7HHKkHA3Nd7 HlWDDU/rkmGl+jT22LCNLPFLgj3uTQQS+DQp3GVrBA92yUEJkjBdZhVDX8SIvge9nW9Y WspQOdNWLU7Vg/cxEiq+SO6nZeST1FBgc5youQYFNGBwmlbH6IC/at6TP0sSal3SpdnH qJvg== X-Gm-Message-State: AHPjjUj9rJHh/3LSWpFbJzdcQMN8ze9v7MBUPVoU0Z1DnkjWOFgHdOx5 cHgQ/lwlBf5rLS/Y38mf222sGLwp X-Google-Smtp-Source: AOwi7QCv0WfEWmZDXwxvWNKZHJSWL5rd6uutk2e3VyB+jLR8eCmvyKcwucllE3V2NaY/1fuN1aEE7Q== X-Received: by 10.107.168.98 with SMTP id r95mr14201423ioe.158.1506720757577; Fri, 29 Sep 2017 14:32:37 -0700 (PDT) Date: Fri, 29 Sep 2017 14:32:31 -0700 From: "H.J. Lu" To: GNU C Library Subject: [PATCH] tile: Update elf_machine_load_address for static PIE Message-ID: <20170929213231.GH2482@gmail.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.9.0 (2017-09-02) tile uses _DYNAMIC to compute load address, which works with static PIE. We just need to return 0 if _DYNAMIC is undefined for static executable. OK for master? * sysdeps/tile/dl-machine.h (elf_machine_load_address): Return 0 if _DYNAMIC is undefined for static executable. --- sysdeps/tile/dl-machine.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sysdeps/tile/dl-machine.h b/sysdeps/tile/dl-machine.h index f7af7c3848..86011471c1 100644 --- a/sysdeps/tile/dl-machine.h +++ b/sysdeps/tile/dl-machine.h @@ -84,6 +84,11 @@ elf_machine_dynamic (void) static inline ElfW(Addr) elf_machine_load_address (void) { +#ifndef SHARED + extern ElfW(Dyn) _DYNAMIC[] __attribute__((weak, visibility ("hidden"))); + if (!_DYNAMIC) + return 0; +#endif ElfW(Addr) *got; ElfW(Addr) dynamic;