From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 79068 invoked by alias); 26 Feb 2018 20:38:42 -0000 Mailing-List: contact crossgcc-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: crossgcc-owner@sourceware.org Received: (qmail 78959 invoked by uid 89); 26 Feb 2018 20:38:41 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.8 required=5.0 tests=AWL,BAYES_00,HTML_MESSAGE,KAM_LAZY_DOMAIN_SECURITY,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=rw, HX-HELO:sk:server., H*RU:sk:server., Hx-spam-relays-external:sk:server. X-HELO: server.obj-sys.com Received: from server.obj-sys.com (HELO server.obj-sys.com) (74.50.121.244) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 26 Feb 2018 20:38:39 +0000 Received: from 75-147-126-222-philadelphia.hfc.comcastbusiness.net ([75.147.126.222]:53265 helo=[10.0.0.202]) by server.obj-sys.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.89_1) (envelope-from ) id 1eqPXi-0002i8-03 for crossgcc@sourceware.org; Mon, 26 Feb 2018 15:38:38 -0500 From: Douglas Coup Subject: Question about ELF program headers To: crossgcc@sourceware.org Message-ID: <2c033694-18e1-312b-4bb9-90d2d353989c@obj-sys.com> Date: Mon, 26 Feb 2018 20:38:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 X-Get-Message-Sender-Via: server.obj-sys.com: authenticated_id: dcoup@obj-sys.com Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2018-02/txt/msg00017.txt.bz2 Hello all. I'm using a cross compiler produced by Crosstools-NG v1.20.0.  The cross compiler runs in a 64-bit Intel-based Linux environment, and it produces 32-bit PowerPC code.  The cross compiler uses gcc v4.4.7. If I do a "readelf -a" command against the shared object (.so) files produced by this cross compiler, I see something like this: Program Headers:   Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align   LOAD           0x000000 0x00000000 0x00000000 0x9a87c 0x9a87c R E 0x10000   LOAD           0x09a87c 0x000aa87c 0x000aa87c 0x01344 0x03230 RWE 0x10000   DYNAMIC        0x09ba84 0x000aba84 0x000aba84 0x000d0 0x000d0 RW  0x4   GNU_EH_FRAME   0x09a7bc 0x0009a7bc 0x0009a7bc 0x0002c 0x0002c R   0x4   GNU_STACK      0x000000 0x00000000 0x00000000 0x00000 0x00000 RW  0x4 The problem is that header that's flagged as RWE.  A potential customer evaluating some of our software can't use the shared libraries because of this. I tried adding --secure-plt to the gcc commands, but that didn't seem to work; the RWE header is still there. Is there a way to get the cross compiler to stop producing this RWE header?  Failing that, is there a way to (safely) modify an already produced .so file to change the RWE setting to RW? I'm kind of new to this world of cross compilers and ELF headers, so I'm not sure how best to deal with this. Regards, Douglas Coup -- Objective Systems, Inc. REAL WORLD ASN.1 AND XML SOLUTIONS Tel: +1 (484) 875-9841 Fax: +1 (484) 875-9830 Toll-free: (877) 307-6855 (USA only) http://www.obj-sys.com