[PATCH] [lld][ELF] Fix debug info handling.

Shankar Kalpathi Easwaran shankarke at gmail.com
Fri Sep 13 14:38:48 PDT 2013


  question : do the atoms contain the appropriate relocations too associated with them.

  .rela.debug_aranges, .rela.debug_info, .rela.debug_line ?


================
Comment at: include/lld/Core/DefinedAtom.h:152
@@ -151,2 +151,3 @@
     typeRWNote,             // Identifies readwrite note sections [ELF]
+    typeDebug,
   };
----------------
add a comment 

================
Comment at: lib/ReaderWriter/ELF/Atoms.h:272-273
@@ -271,1 +271,4 @@
 
+    if (_sectionName.startswith(".debug"))
+      return _contentType = typeDebug;
+
----------------
if (_sectionName.startwith(".debug") && !(_section->sh_flags & SHF_ALLOC)


================
Comment at: lib/ReaderWriter/ELF/Atoms.h:409
@@ -405,1 +408,3 @@
 
+    if (_sectionName.startswith(".debug"))
+      return _permissions = perm___;
----------------
similiar to above comment.

================
Comment at: lib/ReaderWriter/ELF/DefaultLayout.h:365-366
@@ -363,2 +364,4 @@
     return ORDER_TBSS;
+  case DefinedAtom::typeDebug:
+    return ORDER_DEBUG;
   default:
----------------
In addition to this, can we add ORDER_DEBUG in hasOutputSegment to return false too ?


http://llvm-reviews.chandlerc.com/D1680



More information about the llvm-commits mailing list