X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type; q=dns; s=default; b=qE5/q6l wU47BsZR+Q6VhDqVZ4QUXrSVjcKkEOdd+J0kO7hZ1GouS/Fu+vTNyLRlAp4IkiYn ngvJJl22p6LTL/SjxBHZWOFT5bux+dxUZrrQunttvfUZhN5JPqzVoSuzqZguInpn 5bBvb4NDlP41+TFw2re9VBZEFMmL052Wywbg= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type; s=default; bh=PO7t+8ckMFwdJ HCfPFSuI7vhVnE=; b=Lbhfm7G/3+ci2WbcD0Pwsaunh7N3jeasPWQrOAuToRxty NX1AfI7JglUr3rgvXW/mWcvZUkHVEkRKXXYhPzcsjglaZk3BlmAP9oplgSqZwZBZ l37fMR7UBpO1a8eG5vaghTTiO+ZgZe94ojEfmTI2z3cGfxrOpwwy3TkuYHRe4c= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com 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 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 In-Reply-To: References: From: Lee Date: Tue, 3 Mar 2020 01:17:15 -0500 Message-ID: Subject: Re: ASLR revisited To: cygwin AT cygwin DOT com Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes 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