diff -ur .\old\compiler\i386/ag386nsm.pas .\new\compiler/i386/ag386nsm.pas
--- .\old\compiler\i386/ag386nsm.pas	Mon Sep  5 20:44:32 2005
+++ .\new\compiler/i386/ag386nsm.pas	Thu Dec 28 17:40:56 2006
@@ -355,7 +355,8 @@
     procedure T386NasmAssembler.WriteSection(atype:tasmsectiontype;const aname:string);
       const
         secnames : array[tasmsectiontype] of string[12] = ('',
-          '.text','.data','.rodata','.bss',
+          { the .rodata is not supported }
+          '.text','.data','.data','.bss',
           'common',
           '.note',
           '.stab','.stabstr',
@@ -488,8 +489,8 @@
            ait_section :
              begin
                if tai_section(hp).sectype<>sec_none then
-                 WriteSection(tai_section(hp).sectype,tai_section(hp).name^);
-               LasTSecType:=tai_section(hp).sectype;
+                 WriteSection(tai_section(hp).sectype,tai_section(hp).name^)
+               else LasTSecType:=sec_none;
              end;
 
            ait_align :
@@ -568,6 +569,8 @@
              { separate lines in different parts }
                if tai_string(hp).len > 0 then
                 Begin
+             { do you really need to split long lines? }
+(*
                   for j := 0 to lines-1 do
                    begin
                      AsmWrite(#9#9'DB'#9);
@@ -602,12 +605,19 @@
                        AsmWrite(target_info.newline);
                      inc(counter,line_length);
                   end; { end for j:=0 ... }
+*)
                 { do last line of lines }
                 if counter<tai_string(hp).len then
                   AsmWrite(#9#9'DB'#9);
                 quoted:=false;
                 for i:=counter to tai_string(hp).len-1 do
                   begin
+                    if i=counter then
+                        begin
+                          AsmWrite(tostr(ord(tai_string(hp).str[i]){+2})+',"');
+                          quoted:=true;
+                        end
+                    else
                     { it is an ascii character. }
                     if (ord(tai_string(hp).str[i])>31) and
                        (ord(tai_string(hp).str[i])<128) and
@@ -641,7 +651,14 @@
            ait_label :
              begin
                if tai_label(hp).l.is_used then
-                AsmWriteLn(tai_label(hp).l.name+':');
+                begin
+                  if lastsectype=sec_rodata then
+                   begin
+                     AsmWrite(#9'GLOBAL ');
+                     AsmWriteLn(tai_label(hp).l.name);
+                   end;
+                  AsmWriteLn(tai_label(hp).l.name+':');
+                end;
              end;
 
            ait_direct :
@@ -738,14 +755,15 @@
                   AsmCreate(tai_cutobject(hp).place);
                 end;
              { avoid empty files }
-               while assigned(hp.next) and (tai(hp.next).typ in [ait_cutobject,ait_section,ait_comment]) do
+               while assigned(hp.next) and (tai(hp.next).typ in [ait_cutobject,ait_comment]) do
+                 hp:=tai(hp.next);
+               if tai(hp.next).typ=ait_section then
                 begin
-                  if tai(hp.next).typ=ait_section then
-                    lasTSectype:=tai_section(hp.next).sectype;
                   hp:=tai(hp.next);
+                  if tai_section(hp).sectype<>sec_none then
+                    WriteSection(tai_section(hp).sectype,tai_section(hp).name^)
+                  else lasTSectype:=sec_none;
                 end;
-               if lasTSectype<>sec_none then
-                 WriteSection(tai_section(hp).sectype,tai_section(hp).name^);
                AsmStartSize:=AsmSize;
              end;
 
