[U-Boot] [PATCH] PowerPC: Change -fpic flag to -fPIC flag in the config.mk

Chunhe Lan b25806 at freescale.com
Wed Apr 18 09:32:22 CEST 2012



Wolfgang Denk wrote:
> Dear Chunhe Lan,
>
> In message <1334719161-3500-1-git-send-email-Chunhe.Lan at 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
>



More information about the U-Boot mailing list