Comments
Patch
@@ -70,11 +70,36 @@ SECTIONS
uboot_end_data = .;
. = ALIGN(4);
+ .rel.dyn : {
+ __rel_dyn_start = .;
+ *(.rel*)
+ __rel_dyn_end = .;
+ }
+
+ .deadcode : {
+ /*
+ * Workaround for a binutils feature (or bug?).
+ *
+ * The GNU ld from binutils puts the dynamic relocation
+ * entries into the .rel.dyn section. Sometimes it
+ * allocates more dynamic relocation entries than it needs
+ * and the unused slots are set to R_MIPS_NONE entries.
+ *
+ * However the size of the .rel.dyn section in the ELF
+ * section header does not cover the unused entries, so
+ * objcopy removes those during stripping.
+ *
+ * Create a small section here to avoid that.
+ */
+ LONG(0xffffffff);
+ }
+
+ . = ALIGN(4);
.sbss : {
*(.sbss*)
}
- .bss : {
+ .bss __rel_dyn_start (OVERLAY) : {
*(.bss*)
. = ALIGN(4);
}
This section contain the table needed for dynamic relocation. Also provide symbols for the relocation code to access the table. Signed-off-by: Gabor Juhos <juhosg@openwrt.org> Cc: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com> --- arch/mips/cpu/u-boot.lds | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-)