[Skiboot] [PATCH 2/4] build/lds: place debug sections according to defaults

Nicholas Piggin npiggin at gmail.com
Sun Apr 14 22:50:39 AEST 2019


Place debug orphan linker sections according to default script
as described by `ld --verbose`.

Signed-off-by: Nicholas Piggin <npiggin at gmail.com>
---
 skiboot.lds.S | 45 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 45 insertions(+)

diff --git a/skiboot.lds.S b/skiboot.lds.S
index 6f6f77155..967fdbf3e 100644
--- a/skiboot.lds.S
+++ b/skiboot.lds.S
@@ -17,6 +17,49 @@
 #include <config.h>
 #include <mem-map.h>
 
+/* Debug sections from binutils `ld --verbose` */
+
+#define DEBUG_SECTIONS							\
+  /* Stabs debugging sections.  */					\
+  .stab          0 : { *(.stab) }					\
+  .stabstr       0 : { *(.stabstr) }					\
+  .stab.excl     0 : { *(.stab.excl) }					\
+  .stab.exclstr  0 : { *(.stab.exclstr) }				\
+  .stab.index    0 : { *(.stab.index) }					\
+  .stab.indexstr 0 : { *(.stab.indexstr) }				\
+  .comment       0 : { *(.comment) }					\
+  /* DWARF debug sections.						\
+     Symbols in the DWARF debugging sections are relative to the beginning \
+     of the section so we begin them at 0.  */				\
+  /* DWARF 1 */								\
+  .debug          0 : { *(.debug) }					\
+  .line           0 : { *(.line) }					\
+  /* GNU DWARF 1 extensions */						\
+  .debug_srcinfo  0 : { *(.debug_srcinfo) }				\
+  .debug_sfnames  0 : { *(.debug_sfnames) }				\
+  /* DWARF 1.1 and DWARF 2 */						\
+  .debug_aranges  0 : { *(.debug_aranges) }				\
+  .debug_pubnames 0 : { *(.debug_pubnames) }				\
+  /* DWARF 2 */								\
+  .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.*) }		\
+  .debug_abbrev   0 : { *(.debug_abbrev) }				\
+  .debug_line     0 : { *(.debug_line .debug_line.* .debug_line_end ) }	\
+  .debug_frame    0 : { *(.debug_frame) }				\
+  .debug_str      0 : { *(.debug_str) }					\
+  .debug_loc      0 : { *(.debug_loc) }					\
+  .debug_macinfo  0 : { *(.debug_macinfo) }				\
+  /* SGI/MIPS DWARF 2 extensions */					\
+  .debug_weaknames 0 : { *(.debug_weaknames) }				\
+  .debug_funcnames 0 : { *(.debug_funcnames) }				\
+  .debug_typenames 0 : { *(.debug_typenames) }				\
+  .debug_varnames  0 : { *(.debug_varnames) }				\
+  /* DWARF 3 */								\
+  .debug_pubtypes 0 : { *(.debug_pubtypes) }				\
+  .debug_ranges   0 : { *(.debug_ranges) }				\
+  /* DWARF Extension.  */						\
+  .debug_macro    0 : { *(.debug_macro) }				\
+  .debug_addr     0 : { *(.debug_addr) }
+
 ENTRY(boot_entry);
 SECTIONS
 {
@@ -164,6 +207,8 @@ SECTIONS
 	_ebss = .;
 	_end = .;
 
+	DEBUG_SECTIONS
+
 	/* Optional kernel image */
        . = ALIGN(0x10000);
        .builtin_kernel : {
-- 
2.20.1



More information about the Skiboot mailing list