From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott Wood Date: Thu, 26 Apr 2012 16:26:52 -0500 Subject: [U-Boot] [PATCH] PowerPC: Change -fpic flag to -fPIC flag in the config.mk In-Reply-To: References: <1334719161-3500-1-git-send-email-Chunhe.Lan@freescale.com> <20120418060356.4F9D9200229@gemini.denx.de> <4F8E6E06.3060101@freescale.com> <4F9849EC.1070307@freescale.com> Message-ID: <4F99BD9C.8070104@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 On 04/26/2012 01:53 AM, Joakim Tjernlund wrote: > Scott Wood wrote on 2012/04/25 21:01:00: >> >> On 04/18/2012 05:07 AM, Joakim Tjernlund wrote: >>> Your linker file is buggy I think. I found u-boot-nand_spl.lds, is that the one? >> >> That's the one for the SPL part. > > OK, good. > >> >>> Check out that files reloc part: >>> .reloc : { >>> _GOT2_TABLE_ = .; >>> KEEP(*(.got2)) >>> _FIXUP_TABLE_ = .; >>> KEEP(*(.fixup)) >>> } >>> __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2; >>> __fixup_entries = (. - _FIXUP_TABLE_) >> 2; >>> >>> Compare that with(from u-boot.lds): >>> .reloc : >>> { >>> _GOT2_TABLE_ = .; >>> KEEP(*(.got2)) >>> KEEP(*(.got)) >>> PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4); >>> _FIXUP_TABLE_ = .; >>> KEEP(*(.fixup)) >>> } >>> __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1; >>> __fixup_entries = (. - _FIXUP_TABLE_) >> 2; >> >> I notice a difference between u-boot.lds and u-boot-nand.lds -- the >> latter (used for the main part of U-Boot when loaded from SPL) has: >> >>> .reloc : >>> { >>> KEEP(*(.got)) >>> _GOT2_TABLE_ = .; >>> KEEP(*(.got2)) >>> _FIXUP_TABLE_ = .; >>> KEEP(*(.fixup)) >>> } >>> __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2; >>> __fixup_entries = (. - _FIXUP_TABLE_) >> 2; >> >> Is this wrong as well? > > Yes, I think so. This one does not care about the .got entries at all so I suspect > never gcc's wont work. Thanks. I'm not entirely sure about the _GLOBAL_OFFSET_TABLE_ stuff, though -- what's wrong with the simpler version that uses _FIXUP_TABLE_? -Scott