From patchwork Fri Sep 29 21:35:38 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: 23253 Received: (qmail 83861 invoked by alias); 29 Sep 2017 21:35:50 -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 83684 invoked by uid 89); 29 Sep 2017 21:35:49 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.3 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= X-HELO: mail-io0-f169.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=okLXPYXDi6ce2gqdcuNDutBQRTUEmdBxwl9HJ9mKR/o=; b=QQQNwTLRVXnAwZ4BAfHgK7QKf/jmKtUcaveL+8wajhG/6Y6xef+ezYjY68mW6R4fQW i7Tfjh1A5vT2hoBRh6tQ0M/F8CfNAoF3L4Xbiv/hJvDTqySvfAYEn2T05AfRGuRFL4mW IHvg4IBKZf+XxiZMZqUhiT4kI1fJcEX/SATgYZk9XcqdEaoZXj8E+uo9bgvVNwtDzJzG hQXVo83xyO2njG2MDFmJGzVnR5wgRx/+EWvdlAX4XCl+TQh43i6p2lC9c9ukZQ3cEbjH SGEg2laMuIOCykxBkng5xCSa7wntmbVqzYQgHEJXdwfo1ixREBKV3mJ1W4kfc1lTMLxD J1fA== X-Gm-Message-State: AMCzsaVvg/nf1KffsdVk/yYiqfEA395ydfXQ7vcMTzVjrt+sGTAk+yrp qvDa9laY8e3DEhqUQ1ZhcG9nAGtY X-Google-Smtp-Source: AOwi7QAKBbtO0kaloBhSxcAkoOhgJYh/6gcGmd2t8RZzDl2wKWxvodCcU2I+m61Uyjy1VJnO7uUPig== X-Received: by 10.107.167.129 with SMTP id q123mr13133834ioe.90.1506720946324; Fri, 29 Sep 2017 14:35:46 -0700 (PDT) Date: Fri, 29 Sep 2017 14:35:38 -0700 From: "H.J. Lu" To: GNU C Library Subject: [PATCH] ia64: Update elf_machine_load_address for static PIE Message-ID: <20170929213538.GQ2482@gmail.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.9.0 (2017-09-02) ia64 uses a local label 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/ia64/dl-machine.h (elf_machine_dynamic): Return 0 if _DYNAMIC is undefined for static executable. --- sysdeps/ia64/dl-machine.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sysdeps/ia64/dl-machine.h b/sysdeps/ia64/dl-machine.h index b56f1c8194..76675e2dc5 100644 --- a/sysdeps/ia64/dl-machine.h +++ b/sysdeps/ia64/dl-machine.h @@ -79,6 +79,11 @@ elf_machine_dynamic (void) static inline Elf64_Addr __attribute__ ((unused)) elf_machine_load_address (void) { +#ifndef SHARED + extern Elf64_Dyn _DYNAMIC[] __attribute__((weak, visibility ("hidden"))); + if (!_DYNAMIC) + return 0; +#endif Elf64_Addr ip; int *p;