From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 65305 invoked by alias); 1 Dec 2017 01:58:33 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 65208 invoked by uid 89); 1 Dec 2017 01:58:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,KB_WAM_FROM_NAME_SINGLEWORD,SPF_PASS autolearn=no version=3.3.2 spammy= X-HELO: 9pmail.ess.barracuda.com Date: Fri, 01 Dec 2017 01:58:00 -0000 From: "Maciej W. Rozycki" To: "H.J. Lu" CC: GNU C Library Subject: Re: PING^N: [PATCH] Add --enable-static-pie to build static PIE [BZ #19574] In-Reply-To: Message-ID: References: <5A12C781.3030700@arm.com> <5A18196C.90208@arm.com> <02278c7c-ade4-c8f2-c978-e66f77a101bd@redhat.com> User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-BESS-ID: 1512093505-637138-2169-213424-2 X-BESS-VER: 2017.14-r1710272128 X-BESS-Apparent-Source-IP: 12.201.5.28 X-BESS-Outbound-Spam-Score: 0.20 X-BESS-Outbound-Spam-Report: Code version 3.2, rules version 3.2.2.187485 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------- 0.00 BSF_BESS_OUTBOUND META: BESS Outbound 0.20 PR0N_SUBJECT META: Subject has letters around special characters (pr0n) X-BESS-Outbound-Spam-Status: SCORE=0.20 using account:ESS59374 scores of KILL_LEVEL=7.0 tests=BSF_BESS_OUTBOUND, PR0N_SUBJECT X-BESS-BRTS-Status:1 X-SW-Source: 2017-12/txt/msg00006.txt.bz2 On Thu, 30 Nov 2017, H.J. Lu wrote: > > However overall all these MIPS relocations are strictly non-PIC ones, so > > clearly this code has not been correctly built. > > That is MIPS specific issue. It could be bfd_link_pic vs bfd_link_executable > in MIPS linker backend. Well, these relocations are produced by GAS, which obviously has nothing to do with linking. You need to find a way for them not to be produced in the first place, as they are not valid in a PIE executable link. > > AFAICT you need to pass -DPIC to GCC when assembling sysdeps/mips/start.S > > to get a position-independent intermediate object. The same applies to > > our other MIPS assembly sources. > > Everything is compiled with -fPIE -DPIC: > > +ifeq (yes,$(enable-static-pie)) > +pic-default = -DPIC > +pie-default = $(pie-ccflag) > +ifeq (yes,$(have-static-pie)) > +default-pie-ldflag = -static-pie > +else > +default-pie-ldflag = -Wl,-pie,--no-dynamic-linker,--eh-frame-hdr,-z,text > +endif > +endif Well, that doesn't prove that these options actually make it to the GCC invocation line for say rcrt1.o. Quoting the actual line for rcrt1.o from a build log would be more useful. Maciej