kbuild: allow archs to select link dead code/data elimination
[cascardo/linux.git] / arch / Kconfig
index 6842154..3f948c4 100644 (file)
@@ -467,6 +467,19 @@ config THIN_ARCHIVES
          Select this if the architecture wants to use thin archives
          instead of ld -r to create the built-in.o files.
 
+config LD_DEAD_CODE_DATA_ELIMINATION
+       bool
+       help
+         Select this if the architecture wants to do dead code and
+         data elimination with the linker by compiling with
+         -ffunction-sections -fdata-sections and linking with
+         --gc-sections.
+
+         This requires that the arch annotates or otherwise protects
+         its external entry points from being discarded. Linker scripts
+         must also merge .text.*, .data.*, and .bss.* correctly into
+         output sections.
+
 config HAVE_CONTEXT_TRACKING
        bool
        help