From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 99955 invoked by alias); 3 Mar 2020 06:17:20 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 99948 invoked by uid 89); 3 Mar 2020 06:17:20 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=no version=3.3.1 spammy=dep, H*i:sk:m-4UG_2, H*r:a0c, H*f:sk:m-4UG_2 X-HELO: mail-qv1-f53.google.com Received: from mail-qv1-f53.google.com (HELO mail-qv1-f53.google.com) (209.85.219.53) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 03 Mar 2020 06:17:18 +0000 Received: by mail-qv1-f53.google.com with SMTP id o18so1188728qvf.1 for ; Mon, 02 Mar 2020 22:17:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=9m7RpLvUTN0FeZxdO+Cg17L88yUOB0XnzOywXWMUDJ4=; b=jRTg5DXNCrUy9U3Wy9wp8VH5p/YoCkP+DNtNLmNFsWDalIYfmxV8PrNSt9e1yNzWny xaaKZ0/V6IujERi3K/mT0jy5VxAFRp+DXi28AgwV+qcVpr5oE0vKuwmejk6qhPEQzLUY GSOHwaOFkKPoW0B+Fk83K0urMz6+HBEwCu44YtSEEfyRAdkCUpO/YITYeFO+wBrWyIfl LX0VcwvhE7C3eqaOMDmS3kucKq4isI/t6HMA8PK6hfPP0ASziLe6GvtVYc/KG59qpl2b RIGybpssThQ4HtNyL40oiPdz4v67vhJiL3n6BRyLk55KXdelosaKVYicwWFtTd9qThS2 zREw== MIME-Version: 1.0 Received: by 2002:a0c:e9cc:0:0:0:0:0 with HTTP; Mon, 2 Mar 2020 22:17:15 -0800 (PST) In-Reply-To: References: From: Lee Date: Tue, 03 Mar 2020 06:17:00 -0000 Message-ID: Subject: Re: ASLR revisited To: cygwin@cygwin.com Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2020-03/txt/msg00034.txt On 3/2/20, John Selbie wrote: > And I just discovered that recompiling with this added to the g++ command > line: > > -Xlinker --dynamicbase > > Seems to work. Or at the least, triggers the process to show up in Process > Explorer as ASLR? > > Good idea to continue with this? I haven't looked at this in ages, but for gcc I use LDFLAGS="${LDFLAGS} -Wl,--nxcompat" # https://en.wikipedia.org/wiki/Data_Execution_Prevention # Enable DEP with -Wl,--nxcompat LDFLAGS="${LDFLAGS} -Wl,--dynamicbase,--export-all-symbols" # https://en.wikipedia.org/wiki/Address_space_layout_randomization # https://stackoverflow.com/questions/24283918/how-can-i-enable-aslr-dep-and-safeseh-on-an-exe-in-codeblocks-using-mingw # ASLR with gcc has a problem: -Wl,--dynamicbase doesn't emit the necessary relocation table. # As a workaround, you can pass -Wl,--dynamicbase,--export-all-symbols Regards, Lee -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple