PageRenderTime 43ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/bootloader/u-boot-2009.08/patches/0557-ENGR00218282-MX6Q-fix-linker-error-when-more-configu.patch

https://github.com/red-root/PortingARMLinux
Patch | 126 lines | 104 code | 22 blank | 0 comment | 0 complexity | 587a7cd63e5715ed58cfe9b2d5e3f737 MD5 | raw file
Possible License(s): AGPL-1.0
  1. From 2dbfc63a4a0206d31e419d9e595828e6408dce48 Mon Sep 17 00:00:00 2001
  2. From: Zhang Jiejing <jiejing.zhang@freescale.com>
  3. Date: Wed, 25 Jul 2012 11:35:11 +0800
  4. Subject: [PATCH 557/678] ENGR00218282 MX6Q: fix linker error when more
  5. configure enabled.
  6. This commit fix the linker error when enable more function(like CONFIG_NAND,
  7. CONFIG_SPASHSCREEN,etc) in uboot ARM2 board, and a possable linker error for
  8. other MX6 boards:
  9. /home/lambert/share/SATA2/R13.3/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/
  10. bin/arm-eabi-ld: section .bss [27831000 -> 278666e7] overlaps section
  11. .rodata [2782387c -> 278609eb]
  12. /home/lambert/share/SATA2/R13.3/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/
  13. bin/arm-eabi-ld: section .rodata.str1.1 [278609ec -> 27867803] overlaps
  14. section .bss [27831000 -> 278666e7]
  15. One issue here is:
  16. A recent gcc added a new unaligned rodata section called '.rodata.str1.1',
  17. which needs to be added the the linker script. Instead of just adding this
  18. one section, we use a wildcard ".rodata*" to get all rodata linker section
  19. gcc has now and might add in the future.
  20. Another issue is:
  21. The secure boot feature require __hab_data section in uboot linker script,
  22. but it's have a hard coding magic number, but if we enable more code, cause
  23. .text section bigger, it will cross the line, so it report the
  24. first linker error.
  25. This commit disable SECURE_BOOT feature by default for android,
  26. and comments if user want to use this feature, it needs change the
  27. .lds by there configure.
  28. Also, enlarge the magic number that this feature needs to cover
  29. if more code is build in.
  30. Signed-off-by: Zhang Jiejing <jiejing.zhang@freescale.com>
  31. ---
  32. board/freescale/mx6q_arm2/u-boot.lds | 6 +++---
  33. board/freescale/mx6q_sabreauto/u-boot.lds | 2 +-
  34. board/freescale/mx6q_sabrelite/u-boot.lds | 2 +-
  35. board/freescale/mx6q_sabresd/u-boot.lds | 2 +-
  36. include/configs/mx6q_arm2_android.h | 4 ++++
  37. 5 files changed, 10 insertions(+), 6 deletions(-)
  38. diff --git a/board/freescale/mx6q_arm2/u-boot.lds b/board/freescale/mx6q_arm2/u-boot.lds
  39. index 5bd58bb..a6bcebb 100644
  40. --- a/board/freescale/mx6q_arm2/u-boot.lds
  41. +++ b/board/freescale/mx6q_arm2/u-boot.lds
  42. @@ -53,7 +53,7 @@ SECTIONS
  43. }
  44. . = ALIGN(4);
  45. - .rodata : { *(.rodata) }
  46. + .rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) }
  47. . = ALIGN(4);
  48. .data : { *(.data) }
  49. @@ -69,8 +69,8 @@ SECTIONS
  50. . = ALIGN(4);
  51. _end_of_copy = .; /* end_of ROM copy code when HAB is not enabled */
  52. - /* Original Size is 0x27..., enlarge to 0x2F000 */
  53. - . = TEXT_BASE + 0x2F000;
  54. + /* Original Size is 0x27..., enlarge to 0x3F000 */
  55. + . = TEXT_BASE + 0x3F000;
  56. __hab_data = .;
  57. . = . + 0x2000;
  58. __hab_data_end = .;
  59. diff --git a/board/freescale/mx6q_sabreauto/u-boot.lds b/board/freescale/mx6q_sabreauto/u-boot.lds
  60. index f3ebb48..8ef52ce 100644
  61. --- a/board/freescale/mx6q_sabreauto/u-boot.lds
  62. +++ b/board/freescale/mx6q_sabreauto/u-boot.lds
  63. @@ -53,7 +53,7 @@ SECTIONS
  64. }
  65. . = ALIGN(4);
  66. - .rodata : { *(.rodata) }
  67. + .rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) }
  68. . = ALIGN(4);
  69. .data : { *(.data) }
  70. diff --git a/board/freescale/mx6q_sabrelite/u-boot.lds b/board/freescale/mx6q_sabrelite/u-boot.lds
  71. index fe40969..dceb877 100644
  72. --- a/board/freescale/mx6q_sabrelite/u-boot.lds
  73. +++ b/board/freescale/mx6q_sabrelite/u-boot.lds
  74. @@ -53,7 +53,7 @@ SECTIONS
  75. }
  76. . = ALIGN(4);
  77. - .rodata : { *(.rodata) }
  78. + .rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) }
  79. . = ALIGN(4);
  80. .data : { *(.data) }
  81. diff --git a/board/freescale/mx6q_sabresd/u-boot.lds b/board/freescale/mx6q_sabresd/u-boot.lds
  82. index 1473ea9..9b678da 100644
  83. --- a/board/freescale/mx6q_sabresd/u-boot.lds
  84. +++ b/board/freescale/mx6q_sabresd/u-boot.lds
  85. @@ -53,7 +53,7 @@ SECTIONS
  86. }
  87. . = ALIGN(4);
  88. - .rodata : { *(.rodata) }
  89. + .rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) }
  90. . = ALIGN(4);
  91. .data : { *(.data) }
  92. diff --git a/include/configs/mx6q_arm2_android.h b/include/configs/mx6q_arm2_android.h
  93. index 264d85b..361a720 100644
  94. --- a/include/configs/mx6q_arm2_android.h
  95. +++ b/include/configs/mx6q_arm2_android.h
  96. @@ -24,6 +24,10 @@
  97. #include "mx6q_arm2.h"
  98. +/* Disable secure boot feature in default, if you want to enable this
  99. + * feature, please carefully read related documents, you may needs to
  100. + * change u-boot.lds */
  101. +#undef CONFIG_SECURE_BOOT
  102. /* Disable fastboot and recovery to pass build.
  103. --
  104. 1.7.7.4