Skip to contentSkip to conversation

MIPS: u-boot.lds: add back the .deadcode section

PATCH New Gabor Juhos 1 participant 1 message Feb 11, 2013 MIPS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 MIPS: u-boot.lds: add back the .deadcode section

---
 arch/mips/cpu/u-boot.lds |   18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
arch/mips/cpu/u-boot.lds +18 -0
index cea9533..10513ab 100644
@@ -76,6 +76,24 @@ SECTIONS
 		__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);
+	}
+
 	.dynsym : {
 		*(.dynsym)
 	}
Signature · 4 lines
1.7.10


--------------040006050306000504020501--