From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chunhe Lan Date: Wed, 18 Apr 2012 15:32:22 +0800 Subject: [U-Boot] [PATCH] PowerPC: Change -fpic flag to -fPIC flag in the config.mk In-Reply-To: <20120418060356.4F9D9200229@gemini.denx.de> References: <1334719161-3500-1-git-send-email-Chunhe.Lan@freescale.com> <20120418060356.4F9D9200229@gemini.denx.de> Message-ID: <4F8E6E06.3060101@freescale.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Wolfgang Denk wrote: > Dear Chunhe Lan, > > In message <1334719161-3500-1-git-send-email-Chunhe.Lan@freescale.com> > you wrote: >> The -fPIC/-fpic flag belongs with -mrelocatable. The -fpic flag can >> limit the size of the GOT and produce smaller binaries, so it causes >> some GOT entries to be lost in the gcc 4.6 version. But -fPIC flag >> allows the maximum possible size of the GOT entries. >> >> However, currently -mrelocatable promotes -fpic flag to -fPIC flag. >> >> This reverts that portion of the >> commit 33ee4c92339ee386662c0ee2d221098c5cc8b07e. > > As you state yourself, your modification has the negative impact of > increasing the image size. What would be the benefits of it? > > Are you trying to fix any specific problem? Which one? I am not aware > of any related isses for any of the mainline PowerPC systems... Yes, I have fixed the booting issue of nand u-boot of P1010/P1022/P1023/P2020 with this patch. When use gcc 4.5 version, produce the size of u-boot-nand.bin to be same with -fpic or -fPIC. The u-boot-nand.bin is OK. But when use gcc 4.6 version, produce the size of u-boot-nand.bin to be different with -fpic or -fPIC. The some GOT entries of u-boot-nand.bin are lost with -fpic(because limit the size), so u-boot-nand.bin hangs when booting. But use -fPIC, the u-boot-nand.bin is OK. And this patch reverts that portion of the commit 33ee4c92339ee386662c0ee2d221098c5cc8b07e. Thanks, Chunhe > > Best regards, > > Wolfgang Denk >