From owner-freebsd-ppc@freebsd.org Thu Jan 26 01:27:53 2017 Return-Path: Delivered-To: freebsd-ppc@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3AFCCC1E5E for ; Thu, 26 Jan 2017 01:27:53 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-12.reflexion.net [208.70.210.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8773CDCC for ; Thu, 26 Jan 2017 01:27:52 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 15174 invoked from network); 26 Jan 2017 01:28:15 -0000 Received: from unknown (HELO mail-cs-01.app.dca.reflexion.local) (10.81.19.1) by 0 (rfx-qmail) with SMTP; 26 Jan 2017 01:28:15 -0000 Received: by mail-cs-01.app.dca.reflexion.local (Reflexion email security v8.20.1) with SMTP; Wed, 25 Jan 2017 20:27:46 -0500 (EST) Received: (qmail 28178 invoked from network); 26 Jan 2017 01:27:45 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 26 Jan 2017 01:27:45 -0000 Received: from [192.168.1.111] (c-67-170-167-181.hsd1.or.comcast.net [67.170.167.181]) by iron2.pdx.net (Postfix) with ESMTPSA id 3131CEC8255; Wed, 25 Jan 2017 17:27:45 -0800 (PST) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 10.2 \(3259\)) Subject: Re: 3.9.1's lld and powerpc64 for -pie use: can't create dynamic relocation R_PPC64_REL24 against readonly segment Date: Wed, 25 Jan 2017 17:27:44 -0800 References: <5FF1F3C4-E169-4967-9B08-F97A52B33E6F@dsl-only.net> To: FreeBSD Toolchain , FreeBSD PowerPC ML In-Reply-To: <5FF1F3C4-E169-4967-9B08-F97A52B33E6F@dsl-only.net> Message-Id: <2C07C1E1-4549-43CC-BF23-A83CEE090448@dsl-only.net> X-Mailer: Apple Mail (2.3259) X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2017 01:27:53 -0000 On 2017-Jan-21, at 2:16 PM, Mark Millard wrote: > For: >=20 > # more main.c = = static volatile = char big_area[67001] =3D "This is a test"; >=20 > int main () > { > big_area[67000] =3D '9'; > } >=20 > I get (the -fPIE is not required for the behavior): >=20 > # clang -fuse-ld=3Dlld -Wl,-t -pie -fPIE main.c > /usr/lib/Scrt1.o > /usr/lib/crti.o > /usr/lib/crtbeginS.o > /tmp/main-c6f752.o > /usr/lib/libgcc_s.so > /lib/libc.so.7 > /usr/lib/libgcc_s.so > /usr/lib/crtendS.o > /usr/lib/crtn.o > can't create dynamic relocation R_PPC64_REL24 against readonly segment > can't create dynamic relocation R_PPC64_REL24 against readonly segment > can't create dynamic relocation R_PPC64_REL24 against readonly segment > can't create dynamic relocation R_PPC64_REL24 against readonly segment > can't create dynamic relocation R_PPC64_REL24 against readonly segment > can't create dynamic relocation R_PPC64_REL24 against readonly segment > clang: error: linker command failed with exit code 1 (use -v to see = invocation) >=20 > (This is difficult to study because it does not leave even a > partial a.out and it does not report the specifics of what > segment or what symbol or the like.) >=20 > Even an empty source produces that, but also including the > expected: >=20 > undefined symbol: main in /usr/lib/Scrt1.o >=20 > It appears that the R_PPC64_REL24's are some subset of. . . >=20 > /usr/lib/Scrt1.o : >=20 > 00000000000000cc R_PPC64_REL24 atexit > 00000000000000d8 R_PPC64_REL24 _init_tls > 00000000000000f8 R_PPC64_REL24 atexit > 00000000000001b4 R_PPC64_REL24 _init > 0000000000000240 R_PPC64_REL24 main > 0000000000000248 R_PPC64_REL24 exit > 00000000000002fc R_PPC64_REL24 _fini >=20 > (That would be 6 by ignoring main, matching > the message count.) >=20 > /usr/lib/crtbeginS.o : >=20 > 0000000000000040 R_PPC64_REL24 __cxa_finalize > 0000000000000000 R_PPC64_REL24 .opd > 0000000000000000 R_PPC64_REL24 .opd+0x0000000000000018 >=20 > /usr/lib/crtendS.o : >=20 > 0000000000000000 R_PPC64_REL24 .opd >=20 > main.o , if I have it produced, does not have R_PPC64_REL24 > in it. I have submitted this as llvm bugzilla 31762 and added it to llvm bugzilla 25780's Depends On list (the meta submittal for using clang and [its toolchain] as the FreeBSD powerpc and powerpc64 system compiler [and toolchain]). =3D=3D=3D Mark Millard markmi at dsl-only.net