Commit ee0270dff748213bd009fad566c913110fbd89f9

Authored by Joakim Tjernlund
Committed by Wolfgang Denk
1 parent 337f5f50f5

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 <Joakim.Tjernlund@transmode.se>
Acked-by: Scott Wood <scottwood@freescale.com>
Acked-by: Kim Phillips <kim.phillips@freescale.com>

Showing 3 changed files with 9 additions and 3 deletions Side-by-side Diff

nand_spl/board/freescale/mpc8313erdb/u-boot.lds
... ... @@ -39,8 +39,10 @@
39 39 *(.sdata*)
40 40 _GOT2_TABLE_ = .;
41 41 KEEP(*(.got2))
42   - __got2_entries = (. - _GOT2_TABLE_) >> 2;
  42 + KEEP(*(.got))
  43 + PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
43 44 }
  45 + __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
44 46  
45 47 . = ALIGN(8);
46 48 __bss_start = .;
nand_spl/board/freescale/mpc8315erdb/u-boot.lds
... ... @@ -39,8 +39,10 @@
39 39 *(.sdata*)
40 40 _GOT2_TABLE_ = .;
41 41 KEEP(*(.got2))
42   - __got2_entries = (. - _GOT2_TABLE_) >> 2;
  42 + KEEP(*(.got))
  43 + PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
43 44 }
  45 + __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
44 46  
45 47 . = ALIGN(8);
46 48 __bss_start = .;
nand_spl/board/sheldon/simpc8313/u-boot.lds
... ... @@ -40,8 +40,10 @@
40 40 *(.sdata*)
41 41 _GOT2_TABLE_ = .;
42 42 *(.got2)
43   - __got2_entries = (. - _GOT2_TABLE_) >> 2;
  43 + KEEP(*(.got))
  44 + PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
44 45 }
  46 + __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
45 47  
46 48 . = ALIGN(8);
47 49 __bss_start = .;