Index: trunk/src/backend/dwarf.c
===================================================================
--- trunk/src/backend/dwarf.c	(revision 466)
+++ trunk/src/backend/dwarf.c	(working copy)
@@ -309,6 +309,28 @@
 
 void dwarf_initfile(const char *filename)
 {
+#if MACHOBJ
+    const char* debug_frame = "__debug_frame";
+    const char* debug_str = "__debug_str";
+    const char* debug_ranges = "__debug_ranges";
+    const char* debug_loc = "__debug_loc";
+    const char* debug_line = "__debug_line";
+    const char* debug_abbrev = "__debug_abbrev";
+    const char* debug_info = "__debug_info";
+    const char* debug_pubnames = "__debug_pubnames";
+    const char* debug_aranges = "__debug_aranges";
+#elif ELFOBJ
+    const char* debug_frame = ".debug_frame";
+    const char* debug_str = ".debug_str";
+    const char* debug_ranges = ".debug_ranges";
+    const char* debug_loc = ".debug_loc";
+    const char* debug_line = ".debug_line";
+    const char* debug_abbrev = ".debug_abbrev";
+    const char* debug_info = ".debug_info";
+    const char* debug_pubnames = ".debug_pubnames";
+    const char* debug_aranges = ".debug_aranges";
+#endif
+
     // Set debug_frame_secidx
     Outbuffer *debug_frame_buf;
     int seg;
@@ -342,7 +364,7 @@
       }
     };
 
-    seg = dwarf_getsegment(".debug_frame", 1);
+    seg = dwarf_getsegment(debug_frame, 1);
     debug_frame_secidx = SegData[seg]->SDshtidx;
     debug_frame_buf = SegData[seg]->SDbuf;
     debug_frame_buf->reserve(1000);
@@ -350,28 +372,28 @@
 
     /* ======================================== */
 
-    seg = dwarf_getsegment(".debug_str", 0);
+    seg = dwarf_getsegment(debug_str, 0);
     debug_str_secidx = SegData[seg]->SDshtidx;
     debug_str_buf = SegData[seg]->SDbuf;
     debug_str_buf->reserve(1000);
 
     /* ======================================== */
 
-    debug_ranges_seg = dwarf_getsegment(".debug_ranges", 0);
+    debug_ranges_seg = dwarf_getsegment(debug_ranges, 0);
     debug_ranges_secidx = SegData[debug_ranges_seg]->SDshtidx;
     debug_ranges_buf = SegData[debug_ranges_seg]->SDbuf;
     debug_ranges_buf->reserve(1000);
 
     /* ======================================== */
 
-    debug_loc_seg = dwarf_getsegment(".debug_loc", 0);
+    debug_loc_seg = dwarf_getsegment(debug_loc, 0);
     debug_loc_secidx = SegData[debug_loc_seg]->SDshtidx;
     debug_loc_buf = SegData[debug_loc_seg]->SDbuf;
     debug_loc_buf->reserve(1000);
 
     /* ======================================== */
 
-    lineseg = dwarf_getsegment(".debug_line", 0);
+    lineseg = dwarf_getsegment(debug_line, 0);
     linebuf = SegData[lineseg]->SDbuf;
 
     debugline = debugline_init;
@@ -405,7 +427,7 @@
 
     /* ======================================== */
 
-    abbrevseg = dwarf_getsegment(".debug_abbrev", 0);
+    abbrevseg = dwarf_getsegment(debug_abbrev, 0);
     abbrevbuf = SegData[abbrevseg]->SDbuf;
     abbrevcode = 1;
 
@@ -435,7 +457,7 @@
 
     /* ======================================== */
 
-    infoseg = dwarf_getsegment(".debug_info", 0);
+    infoseg = dwarf_getsegment(debug_info, 0);
     infobuf = SegData[infoseg]->SDbuf;
 
     debuginfo = debuginfo_init;
@@ -501,7 +523,7 @@
 
     /* ======================================== */
 
-    seg = dwarf_getsegment(".debug_pubnames", 0);
+    seg = dwarf_getsegment(debug_pubnames, 0);
     debug_pubnames_secidx = SegData[seg]->SDshtidx;
     debug_pubnames_buf = SegData[seg]->SDbuf;
     debug_pubnames_buf->reserve(1000);
@@ -514,7 +536,7 @@
 
     /* ======================================== */
 
-    debug_aranges_seg = dwarf_getsegment(".debug_aranges", 0);
+    debug_aranges_seg = dwarf_getsegment(debug_aranges, 0);
     debug_aranges_secidx = SegData[debug_aranges_seg]->SDshtidx;
     debug_aranges_buf = SegData[debug_aranges_seg]->SDbuf;
     debug_aranges_buf->reserve(1000);
@@ -811,7 +833,7 @@
     //debugFrameFDE.initial_location = sfunc->Soffset;
 
     IDXSEC dfseg;
-    dfseg = dwarf_getsegment(".debug_frame", 1);
+    dfseg = dwarf_getsegment(debug_frame, 1);
     debug_frame_secidx = SegData[dfseg]->SDshtidx;
     debug_frame_buf = SegData[dfseg]->SDbuf;
     debug_frame_buf_offset = debug_frame_buf->p - debug_frame_buf->buf;
Index: branches/dmd-1.x/src/backend/dwarf.c
===================================================================
--- branches/dmd-1.x/src/backend/dwarf.c	(revision 466)
+++ branches/dmd-1.x/src/backend/dwarf.c	(working copy)
@@ -309,6 +309,28 @@
 
 void dwarf_initfile(const char *filename)
 {
+#if MACHOBJ
+    const char* debug_frame = "__debug_frame";
+    const char* debug_str = "__debug_str";
+    const char* debug_ranges = "__debug_ranges";
+    const char* debug_loc = "__debug_loc";
+    const char* debug_line = "__debug_line";
+    const char* debug_abbrev = "__debug_abbrev";
+    const char* debug_info = "__debug_info";
+    const char* debug_pubnames = "__debug_pubnames";
+    const char* debug_aranges = "__debug_aranges";
+#elif ELFOBJ
+    const char* debug_frame = ".debug_frame";
+    const char* debug_str = ".debug_str";
+    const char* debug_ranges = ".debug_ranges";
+    const char* debug_loc = ".debug_loc";
+    const char* debug_line = ".debug_line";
+    const char* debug_abbrev = ".debug_abbrev";
+    const char* debug_info = ".debug_info";
+    const char* debug_pubnames = ".debug_pubnames";
+    const char* debug_aranges = ".debug_aranges";
+#endif
+    
     // Set debug_frame_secidx
     Outbuffer *debug_frame_buf;
     int seg;
@@ -342,7 +364,7 @@
       }
     };
 
-    seg = dwarf_getsegment(".debug_frame", 1);
+    seg = dwarf_getsegment(debug_frame, 1);
     debug_frame_secidx = SegData[seg]->SDshtidx;
     debug_frame_buf = SegData[seg]->SDbuf;
     debug_frame_buf->reserve(1000);
@@ -350,28 +372,28 @@
 
     /* ======================================== */
 
-    seg = dwarf_getsegment(".debug_str", 0);
+    seg = dwarf_getsegment(debug_str, 0);
     debug_str_secidx = SegData[seg]->SDshtidx;
     debug_str_buf = SegData[seg]->SDbuf;
     debug_str_buf->reserve(1000);
 
     /* ======================================== */
 
-    debug_ranges_seg = dwarf_getsegment(".debug_ranges", 0);
+    debug_ranges_seg = dwarf_getsegment(debug_ranges, 0);
     debug_ranges_secidx = SegData[debug_ranges_seg]->SDshtidx;
     debug_ranges_buf = SegData[debug_ranges_seg]->SDbuf;
     debug_ranges_buf->reserve(1000);
 
     /* ======================================== */
 
-    debug_loc_seg = dwarf_getsegment(".debug_loc", 0);
+    debug_loc_seg = dwarf_getsegment(debug_loc, 0);
     debug_loc_secidx = SegData[debug_loc_seg]->SDshtidx;
     debug_loc_buf = SegData[debug_loc_seg]->SDbuf;
     debug_loc_buf->reserve(1000);
 
     /* ======================================== */
 
-    lineseg = dwarf_getsegment(".debug_line", 0);
+    lineseg = dwarf_getsegment(debug_line, 0);
     linebuf = SegData[lineseg]->SDbuf;
 
     debugline = debugline_init;
@@ -405,7 +427,7 @@
 
     /* ======================================== */
 
-    abbrevseg = dwarf_getsegment(".debug_abbrev", 0);
+    abbrevseg = dwarf_getsegment(debug_abbrev, 0);
     abbrevbuf = SegData[abbrevseg]->SDbuf;
     abbrevcode = 1;
 
@@ -435,7 +457,7 @@
 
     /* ======================================== */
 
-    infoseg = dwarf_getsegment(".debug_info", 0);
+    infoseg = dwarf_getsegment(debug_info, 0);
     infobuf = SegData[infoseg]->SDbuf;
 
     debuginfo = debuginfo_init;
@@ -501,7 +523,7 @@
 
     /* ======================================== */
 
-    seg = dwarf_getsegment(".debug_pubnames", 0);
+    seg = dwarf_getsegment(debug_pubnames, 0);
     debug_pubnames_secidx = SegData[seg]->SDshtidx;
     debug_pubnames_buf = SegData[seg]->SDbuf;
     debug_pubnames_buf->reserve(1000);
@@ -514,7 +536,7 @@
 
     /* ======================================== */
 
-    debug_aranges_seg = dwarf_getsegment(".debug_aranges", 0);
+    debug_aranges_seg = dwarf_getsegment(debug_aranges, 0);
     debug_aranges_secidx = SegData[debug_aranges_seg]->SDshtidx;
     debug_aranges_buf = SegData[debug_aranges_seg]->SDbuf;
     debug_aranges_buf->reserve(1000);
