@@ -29,12 +29,10 @@
.text : {
_start = .;
*(.start)
- *(.text)
- *(.text.*)
+ *(.text .text.*)
*(.fixup)
*(.gnu.warning)
- *(.rodata)
- *(.rodata.*)
+ *(.rodata .rodata.*)
*(.glue_7)
*(.glue_7t)
*(.piggydata)
This is one example where the patch only does layout changes.
@@ -95,8 +95,7 @@
*(.fixup)
#endif
*(.gnu.warning)
- *(.rodata)
- *(.rodata.*)
+ *(.rodata .rodata.*)
*(.glue_7)
*(.glue_7t)
Likewise...
@@ -114,7 +114,7 @@
.sbss : { *(.sbss .sbss.*) }
.bss : { *(.bss .bss.*) }
- .bss..stack : { *(.bss) }
+ .bss..stack : { *(.bss) } /* BUG??? we already absorbed it into .bss */
As the comments says the last line is redundant - remove it.
@@ -140,9 +140,21 @@
#define TRACE_SYSCALLS()
#endif
+/* .data.foo are generated by gcc itself with -fdata-sections,
+ * whereas double-dot sections (like .data..percpu) are generated
+ * by kernel's magic macros.
+ *
+ * arch/.../vmlinux.lds.S decides where to place various double-dot sections
+ * as needed by its arch, here DATA_DATA needs to be careful and collect
+ * only .data and .data.foo sections, skipping .data..foo
+ *
+ * Same goes for .text, .bss and .rodata. In case of .rodata, various
+ * .rodata.foo sections are generated by gcc even without -fdata-sections
+ */
+
/* .data section */
#define DATA_DATA \
- *(.data) \
+ *(.data .data.[A-Za-z0-9_$^]*) \
*(.ref.data) \
DEV_KEEP(init.data) \
DEV_KEEP(exit.data) \
@@ -202,7 +214,7 @@
. = ALIGN((align)); \
.rodata : AT(ADDR(.rodata) - LOAD_OFFSET) { \
VMLINUX_SYMBOL(__start_rodata) = .; \
- *(.rodata) *(.rodata.*) \
+ *(.rodata .rodata.[A-Za-z0-9_$^]*) \
.rodata deserve same comment as .data