From: Joakim Tjernlund Date: Fri, 3 Dec 2010 16:30:38 +0000 (+0100) Subject: PowerPC, nand_spl: Add relocation support for -fpic X-Git-Tag: v2011.03-rc1~55^2~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;ds=sidebyside;h=ee0270dff748213bd009fad566c913110fbd89f9;p=platform%2Fkernel%2Fu-boot.git PowerPC, nand_spl: Add relocation support for -fpic By rearranging the linker script we get support for relocation of -fpic for free. Move __got2_entries outside _GOT2_TABLE_ defining scope matching the rest of PowerPC Signed-off-by: Joakim Tjernlund Acked-by: Scott Wood Acked-by: Kim Phillips --- diff --git a/nand_spl/board/freescale/mpc8313erdb/u-boot.lds b/nand_spl/board/freescale/mpc8313erdb/u-boot.lds index 138e427..f1649f8 100644 --- a/nand_spl/board/freescale/mpc8313erdb/u-boot.lds +++ b/nand_spl/board/freescale/mpc8313erdb/u-boot.lds @@ -39,8 +39,10 @@ SECTIONS *(.sdata*) _GOT2_TABLE_ = .; KEEP(*(.got2)) - __got2_entries = (. - _GOT2_TABLE_) >> 2; + KEEP(*(.got)) + PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4); } + __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1; . = ALIGN(8); __bss_start = .; diff --git a/nand_spl/board/freescale/mpc8315erdb/u-boot.lds b/nand_spl/board/freescale/mpc8315erdb/u-boot.lds index 138e427..f1649f8 100644 --- a/nand_spl/board/freescale/mpc8315erdb/u-boot.lds +++ b/nand_spl/board/freescale/mpc8315erdb/u-boot.lds @@ -39,8 +39,10 @@ SECTIONS *(.sdata*) _GOT2_TABLE_ = .; KEEP(*(.got2)) - __got2_entries = (. - _GOT2_TABLE_) >> 2; + KEEP(*(.got)) + PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4); } + __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1; . = ALIGN(8); __bss_start = .; diff --git a/nand_spl/board/sheldon/simpc8313/u-boot.lds b/nand_spl/board/sheldon/simpc8313/u-boot.lds index ad82589..1da4287 100644 --- a/nand_spl/board/sheldon/simpc8313/u-boot.lds +++ b/nand_spl/board/sheldon/simpc8313/u-boot.lds @@ -40,8 +40,10 @@ SECTIONS *(.sdata*) _GOT2_TABLE_ = .; *(.got2) - __got2_entries = (. - _GOT2_TABLE_) >> 2; + KEEP(*(.got)) + PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4); } + __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1; . = ALIGN(8); __bss_start = .;