ag386bin.pas 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721
  1. {
  2. $Id$
  3. Copyright (c) 1996-98 by the FPC development team
  4. This unit implements an binary assembler output class
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  16. ****************************************************************************
  17. }
  18. {$ifdef TP}
  19. {$N+,E+}
  20. {$endif}
  21. unit ag386bin;
  22. {$define MULTIPASS}
  23. {$define EXTERNALBSS}
  24. interface
  25. uses
  26. i386base,
  27. cobjects,aasm,files,assemble;
  28. type
  29. togtype=(og_none,og_dbg,og_coff,og_pecoff);
  30. pi386binasmlist=^ti386binasmlist;
  31. ti386binasmlist=object
  32. constructor init(t:togtype);
  33. destructor done;
  34. procedure WriteBin;
  35. private
  36. {$ifdef GDB}
  37. n_line : byte; { different types of source lines }
  38. linecount,
  39. includecount : longint;
  40. funcname : pasmsymbol;
  41. stabslastfileinfo : tfileposinfo;
  42. procedure convertstabs(p:pchar);
  43. procedure emitsymbolstabs(s : string;nidx,nother,line : longint;firstasm,secondasm : pasmsymbol);
  44. procedure emitlineinfostabs(nidx,line : longint);
  45. procedure emitstabs(s:string);
  46. procedure WriteFileLineInfo(var fileinfo : tfileposinfo;pass : longint);
  47. procedure StartFileLineInfo(pass:longint);
  48. {$endif}
  49. function TreePass1(hp:pai;optimize:boolean):pai;
  50. function TreePass2(hp:pai):pai;
  51. procedure writetree(p:paasmoutput);
  52. end;
  53. implementation
  54. uses
  55. strings,verbose,
  56. globtype,globals,
  57. i386asm,systems,
  58. {$ifdef GDB}
  59. gdb,
  60. {$endif}
  61. og386,og386dbg,og386cff;
  62. {$ifdef GDB}
  63. procedure ti386binasmlist.convertstabs(p:pchar);
  64. var
  65. ofs,
  66. nidx,nother,i,line,j : longint;
  67. code : word;
  68. hp : pchar;
  69. reloc : boolean;
  70. sec : tsection;
  71. ps : pasmsymbol;
  72. s : string;
  73. begin
  74. ofs:=0;
  75. reloc:=true;
  76. sec:=sec_none;
  77. if p[0]='"' then
  78. begin
  79. i:=1;
  80. { we can have \" inside the string !! PM }
  81. while not ((p[i]='"') and (p[i-1]<>'\')) do
  82. inc(i);
  83. p[i]:=#0;
  84. hp:=@p[1];
  85. s:=StrPas(@P[i+2]);
  86. end
  87. else
  88. begin
  89. hp:=nil;
  90. s:=StrPas(P);
  91. end;
  92. if s='' then
  93. internalerror(33000);
  94. j:=pos(',',s);
  95. if j=0 then
  96. internalerror(33001);
  97. Val(Copy(s,1,j-1),nidx,code);
  98. if code<>0 then
  99. internalerror(33002);
  100. Delete(s,1,j);
  101. j:=pos(',',s);
  102. if (j=0) then
  103. internalerror(33003);
  104. Val(Copy(s,1,j-1),nother,code);
  105. if code<>0 then
  106. internalerror(33004);
  107. Delete(s,1,j);
  108. j:=pos(',',s);
  109. if j=0 then
  110. begin
  111. j:=256;
  112. ofs:=-1;
  113. end;
  114. Val(Copy(s,1,j-1),line,code);
  115. if code<>0 then
  116. internalerror(33005);
  117. if ofs=0 then
  118. Delete(s,1,j);
  119. if ofs=0 then
  120. begin
  121. Val(s,ofs,code);
  122. if code=0 then
  123. reloc:=false
  124. else
  125. begin
  126. ofs:=0;
  127. { handle asmsymbol or
  128. asmsymbol - asmsymbol }
  129. j:=pos(' ',s);
  130. if j=0 then
  131. j:=pos('-',s);
  132. { single asmsymbol }
  133. if j=0 then
  134. j:=256;
  135. ps:=getasmsymbol(copy(s,1,j-1));
  136. if not assigned(ps) then
  137. internalerror(33006)
  138. else
  139. begin
  140. sec:=ps^.section;
  141. ofs:=ps^.address;
  142. reloc:=true;
  143. end;
  144. if j<256 then
  145. begin
  146. delete(s,1,j);
  147. while (s<>'') and (s[1]=' ') do
  148. delete(s,1,1);
  149. ps:=getasmsymbol(s);
  150. if not assigned(ps) then
  151. internalerror(33007)
  152. else
  153. begin
  154. if ps^.section<>sec then
  155. internalerror(33008);
  156. ofs:=ofs-ps^.address;
  157. reloc:=false;
  158. end;
  159. end;
  160. end;
  161. end;
  162. objectoutput^.WriteStabs(sec,ofs,hp,nidx,nother,line,reloc);
  163. if assigned(hp) then
  164. p[i]:='"';
  165. end;
  166. procedure ti386binasmlist.emitsymbolstabs(s : string;nidx,nother,line : longint;
  167. firstasm,secondasm : pasmsymbol);
  168. var
  169. hp : pchar;
  170. begin
  171. if s='' then
  172. hp:=nil
  173. else
  174. begin
  175. s:=s+#0;
  176. hp:=@s[1];
  177. end;
  178. if not assigned(secondasm) then
  179. begin
  180. if not assigned(firstasm) then
  181. internalerror(33009);
  182. objectoutput^.WriteStabs(firstasm^.section,firstasm^.address,hp,nidx,nother,line,true);
  183. end
  184. else
  185. begin
  186. if firstasm^.section<>secondasm^.section then
  187. internalerror(33010);
  188. objectoutput^.WriteStabs(firstasm^.section,firstasm^.address-secondasm^.address,
  189. hp,nidx,nother,line,false);
  190. end;
  191. end;
  192. procedure ti386binasmlist.emitlineinfostabs(nidx,line : longint);
  193. var
  194. sec : tsection;
  195. begin
  196. if (nidx=n_textline) and assigned(funcname) and
  197. (target_os.use_function_relative_addresses) then
  198. objectoutput^.WriteStabs(sec_code,pgenericcoffoutput(objectoutput)^.sects[sec_code]^.len-funcname^.address,
  199. nil,nidx,0,line,false)
  200. else
  201. begin
  202. if nidx=n_textline then
  203. sec:=sec_code
  204. else if nidx=n_dataline then
  205. sec:=sec_data
  206. else
  207. sec:=sec_bss;
  208. objectoutput^.WriteStabs(sec,pgenericcoffoutput(objectoutput)^.sects[sec]^.len,
  209. nil,nidx,0,line,true);
  210. end;
  211. end;
  212. procedure ti386binasmlist.emitstabs(s:string);
  213. begin
  214. s:=s+#0;
  215. ConvertStabs(@s[1]);
  216. end;
  217. procedure ti386binasmlist.WriteFileLineInfo(var fileinfo : tfileposinfo;pass : longint);
  218. var
  219. curr_n : byte;
  220. hp : pasmsymbol;
  221. infile : pinputfile;
  222. begin
  223. if not (cs_debuginfo in aktmoduleswitches) then
  224. exit;
  225. { file changed ? (must be before line info) }
  226. if (fileinfo.fileindex<>0) and
  227. (stabslastfileinfo.fileindex<>fileinfo.fileindex) then
  228. begin
  229. infile:=current_module^.sourcefiles^.get_file(fileinfo.fileindex);
  230. if includecount=0 then
  231. curr_n:=n_sourcefile
  232. else
  233. curr_n:=n_includefile;
  234. hp:=newasmsymbol('Ltext'+ToStr(IncludeCount));
  235. { allocation pass or output pass ? }
  236. if pass=1 then
  237. begin
  238. hp^.typ:=AS_LOCAL;
  239. hp^.setaddress(objectalloc^.currsec,objectalloc^.sectionsize,0);
  240. end
  241. else
  242. begin
  243. objectoutput^.writesymbol(hp);
  244. if (infile^.path^<>'') then
  245. EmitStabs('"'+lower(BsToSlash(FixPath(infile^.path^,false)))+'",'+tostr(curr_n)+
  246. ',0,0,Ltext'+ToStr(IncludeCount));
  247. EmitStabs('"'+lower(FixFileName(infile^.name^))+'",'+tostr(curr_n)+
  248. ',0,0,Ltext'+ToStr(IncludeCount));
  249. end;
  250. inc(includecount);
  251. end;
  252. { line changed ? }
  253. if (pass=2) and (stabslastfileinfo.line<>fileinfo.line) and (fileinfo.line<>0) then
  254. emitlineinfostabs(n_line,fileinfo.line);
  255. stabslastfileinfo:=fileinfo;
  256. end;
  257. procedure ti386binasmlist.StartFileLineInfo(pass:longint);
  258. var
  259. fileinfo : tfileposinfo;
  260. begin
  261. FillChar(stabslastfileinfo,sizeof(stabslastfileinfo),0);
  262. n_line:=n_textline;
  263. funcname:=nil;
  264. linecount:=1;
  265. includecount:=0;
  266. fileinfo.fileindex:=1;
  267. fileinfo.line:=1;
  268. WriteFileLineInfo(fileinfo,pass);
  269. end;
  270. {$endif GDB}
  271. function ti386binasmlist.TreePass1(hp:pai;optimize:boolean):pai;
  272. begin
  273. while assigned(hp) do
  274. begin
  275. {$ifdef GDB}
  276. { write stabs }
  277. if (not optimize) and
  278. (cs_debuginfo in aktmoduleswitches) then
  279. begin
  280. if (objectalloc^.currsec<>sec_none) and
  281. not(hp^.typ in [ait_external,ait_regalloc, ait_tempalloc,
  282. ait_stabn,ait_stabs,ait_section,
  283. ait_label,ait_cut,ait_marker,ait_align,ait_stab_function_name]) then
  284. WriteFileLineInfo(hp^.fileinfo,1);
  285. end;
  286. {$endif GDB}
  287. case hp^.typ of
  288. ait_align :
  289. begin
  290. if objectalloc^.sectionsize mod pai_align(hp)^.aligntype<>0 then
  291. begin
  292. pai_align(hp)^.fillsize:=pai_align(hp)^.aligntype-
  293. (objectalloc^.sectionsize mod pai_align(hp)^.aligntype);
  294. objectalloc^.sectionalloc(pai_align(hp)^.fillsize);
  295. end
  296. else
  297. pai_align(hp)^.fillsize:=0;
  298. end;
  299. ait_datablock :
  300. begin
  301. if objectalloc^.currsec<>sec_bss then
  302. writeln('allocating of data is only allowed in bss section');
  303. {$ifdef EXTERNALBSS}
  304. if pai_datablock(hp)^.is_global then
  305. begin
  306. pai_datablock(hp)^.sym^.typ:=AS_EXTERNAL;
  307. pai_datablock(hp)^.sym^.setaddress(sec_none,pai_datablock(hp)^.size,pai_datablock(hp)^.size);
  308. end
  309. else
  310. begin
  311. pai_datablock(hp)^.sym^.typ:=AS_LOCAL;
  312. pai_datablock(hp)^.sym^.setaddress(objectalloc^.currsec,objectalloc^.sectionsize,pai_datablock(hp)^.size);
  313. end;
  314. if not pai_datablock(hp)^.is_global then
  315. objectalloc^.sectionalloc(pai_datablock(hp)^.size);
  316. {$else}
  317. if pai_datablock(hp)^.is_global then
  318. pai_datablock(hp)^.sym^.typ:=AS_GLOBAL
  319. else
  320. pai_datablock(hp)^.sym^.typ:=AS_LOCAL;
  321. pai_datablock(hp)^.sym^.setaddress(objectalloc^.currsec,objectalloc^.sectionsize,pai_datablock(hp)^.size);
  322. objectalloc^.sectionalloc(pai_datablock(hp)^.size);
  323. {$endif}
  324. end;
  325. ait_const_32bit :
  326. objectalloc^.sectionalloc(4);
  327. ait_const_16bit :
  328. objectalloc^.sectionalloc(2);
  329. ait_const_8bit :
  330. objectalloc^.sectionalloc(1);
  331. ait_real_64bit :
  332. objectalloc^.sectionalloc(8);
  333. ait_real_32bit :
  334. objectalloc^.sectionalloc(4);
  335. ait_real_extended :
  336. objectalloc^.sectionalloc(10);
  337. ait_const_rva,
  338. ait_const_symbol :
  339. objectalloc^.sectionalloc(4);
  340. ait_external :
  341. pai_external(hp)^.sym^.typ:=AS_EXTERNAL;
  342. ait_section:
  343. begin
  344. objectalloc^.setsection(pai_section(hp)^.sec);
  345. {$ifdef GDB}
  346. stabslastfileinfo.line:=-1;
  347. {$endif}
  348. end;
  349. ait_symbol :
  350. begin
  351. if pai_symbol(hp)^.is_global then
  352. pai_symbol(hp)^.sym^.typ:=AS_GLOBAL
  353. else
  354. pai_symbol(hp)^.sym^.typ:=AS_LOCAL;
  355. pai_symbol(hp)^.sym^.setaddress(objectalloc^.currsec,objectalloc^.sectionsize,0);
  356. end;
  357. ait_label :
  358. begin
  359. pai_label(hp)^.setaddress(objectalloc^.sectionsize);
  360. if pai_label(hp)^.l^.is_symbol then
  361. begin
  362. pai_label(hp)^.sym:=newasmsymbol(lab2str(pai_label(hp)^.l));
  363. if (pai_label(hp)^.l^.is_data) and (cs_smartlink in aktmoduleswitches) then
  364. pai_label(hp)^.sym^.typ:=AS_GLOBAL
  365. else
  366. pai_label(hp)^.sym^.typ:=AS_LOCAL;
  367. pai_label(hp)^.sym^.setaddress(objectalloc^.currsec,pai_label(hp)^.l^.address,0);
  368. end;
  369. end;
  370. ait_string :
  371. objectalloc^.sectionalloc(pai_string(hp)^.len);
  372. ait_labeled_instruction,
  373. ait_instruction :
  374. objectalloc^.sectionalloc(pai386(hp)^.Pass1(objectalloc^.sectionsize));
  375. {$ifdef GDB}
  376. ait_force_line :
  377. stabslastfileinfo.line:=0;
  378. {$endif}
  379. ait_cut :
  380. begin
  381. if optimize then
  382. begin
  383. objectalloc^.resetsections;
  384. objectalloc^.setsection(sec_code);
  385. end
  386. else
  387. break;
  388. end;
  389. ait_direct :
  390. Comment(V_Fatal,'direct asm not supported with binary writers');
  391. ait_comp :
  392. Comment(V_Fatal,'comp not supported');
  393. end;
  394. hp:=pai(hp^.next);
  395. end;
  396. TreePass1:=hp;
  397. end;
  398. function ti386binasmlist.TreePass2(hp:pai):pai;
  399. const
  400. alignarray:array[0..5] of string[8]=(
  401. #$8D#$B4#$26#$00#$00#$00#$00,
  402. #$8D#$B6#$00#$00#$00#$00,
  403. #$8D#$74#$26#$00,
  404. #$8D#$76#$00,
  405. #$89#$F6,
  406. #$90
  407. );
  408. var
  409. l,j : longint;
  410. begin
  411. { main loop }
  412. while assigned(hp) do
  413. begin
  414. {$ifdef GDB}
  415. { write stabs }
  416. if cs_debuginfo in aktmoduleswitches then
  417. begin
  418. if (objectoutput^.currsec<>sec_none) and
  419. not(hp^.typ in [ait_external,ait_regalloc, ait_tempalloc,
  420. ait_stabn,ait_stabs,ait_section,
  421. ait_label,ait_cut,ait_marker,ait_align,ait_stab_function_name]) then
  422. WriteFileLineInfo(hp^.fileinfo,2);
  423. end;
  424. {$endif GDB}
  425. case hp^.typ of
  426. ait_align :
  427. begin
  428. l:=pai_align(hp)^.fillsize;
  429. while (l>0) do
  430. begin
  431. for j:=0to 5 do
  432. if (l>=length(alignarray[j])) then
  433. break;
  434. objectoutput^.writebytes(alignarray[j][1],length(alignarray[j]));
  435. dec(l,length(alignarray[j]));
  436. end;
  437. end;
  438. ait_section :
  439. begin
  440. objectoutput^.defaultsection(pai_section(hp)^.sec);
  441. {$ifdef GDB}
  442. case pai_section(hp)^.sec of
  443. sec_code : n_line:=n_textline;
  444. sec_data : n_line:=n_dataline;
  445. sec_bss : n_line:=n_bssline;
  446. else
  447. n_line:=n_dataline;
  448. end;
  449. stabslastfileinfo.line:=-1;
  450. {$endif GDB}
  451. end;
  452. ait_external :
  453. objectoutput^.writesymbol(pai_external(hp)^.sym);
  454. ait_symbol :
  455. objectoutput^.writesymbol(pai_symbol(hp)^.sym);
  456. ait_datablock :
  457. begin
  458. objectoutput^.writesymbol(pai_datablock(hp)^.sym);
  459. {$ifdef EXTERNALBSS}
  460. if not pai_datablock(hp)^.is_global then
  461. {$endif}
  462. objectoutput^.writealloc(pai_datablock(hp)^.size);
  463. end;
  464. ait_const_32bit :
  465. objectoutput^.writebytes(pai_const(hp)^.value,4);
  466. ait_const_16bit :
  467. objectoutput^.writebytes(pai_const(hp)^.value,2);
  468. ait_const_8bit :
  469. objectoutput^.writebytes(pai_const(hp)^.value,1);
  470. ait_real_64bit :
  471. objectoutput^.writebytes(pai_double(hp)^.value,8);
  472. ait_real_32bit :
  473. objectoutput^.writebytes(pai_single(hp)^.value,4);
  474. ait_real_extended :
  475. objectoutput^.writebytes(pai_extended(hp)^.value,10);
  476. ait_string :
  477. objectoutput^.writebytes(pai_string(hp)^.str^,pai_string(hp)^.len);
  478. ait_const_rva :
  479. objectoutput^.writereloc(pai_const_symbol(hp)^.offset,4,
  480. pai_const_symbol(hp)^.sym,relative_rva);
  481. ait_const_symbol :
  482. objectoutput^.writereloc(pai_const_symbol(hp)^.offset,4,
  483. pai_const_symbol(hp)^.sym,relative_false);
  484. ait_label :
  485. begin
  486. if assigned(pai_label(hp)^.sym) then
  487. objectoutput^.writesymbol(pai_label(hp)^.sym);
  488. end;
  489. ait_labeled_instruction,
  490. ait_instruction :
  491. pai386(hp)^.Pass2;
  492. {$ifdef GDB}
  493. ait_stabn :
  494. convertstabs(pai_stabn(hp)^.str);
  495. ait_stabs :
  496. convertstabs(pai_stabs(hp)^.str);
  497. ait_stab_function_name :
  498. if assigned(pai_stab_function_name(hp)^.str) then
  499. funcname:=getasmsymbol(pai_stab_function_name(hp)^.str)
  500. else
  501. funcname:=nil;
  502. ait_force_line :
  503. stabslastfileinfo.line:=0;
  504. {$endif}
  505. ait_cut :
  506. break;
  507. end;
  508. hp:=pai(hp^.next);
  509. end;
  510. TreePass2:=hp;
  511. end;
  512. procedure ti386binasmlist.writetree(p:paasmoutput);
  513. var
  514. hp : pai;
  515. begin
  516. if not assigned(p) then
  517. exit;
  518. hp:=pai(p^.first);
  519. while assigned(hp) do
  520. begin
  521. {$ifdef GDB}
  522. StartFileLineInfo(1);
  523. {$endif GDB}
  524. TreePass1(hp,false);
  525. {$ifdef GDB}
  526. StartFileLineInfo(2);
  527. {$endif GDB}
  528. hp:=TreePass2(hp);
  529. { if assigned then we have a ait_cut }
  530. if assigned(hp) then
  531. begin
  532. if hp^.typ<>ait_cut then
  533. internalerror(3334443);
  534. { write the current objectfile }
  535. objectoutput^.donewriting;
  536. { start the writing again }
  537. objectoutput^.initwriting;
  538. { we will start a new objectfile so reset everything }
  539. ResetAsmsymbolList;
  540. objectalloc^.resetsections;
  541. { avoid empty files }
  542. while assigned(hp^.next) and
  543. (pai(hp^.next)^.typ in [ait_marker,ait_comment,ait_section,ait_cut]) do
  544. begin
  545. if pai(hp^.next)^.typ=ait_section then
  546. begin
  547. objectalloc^.setsection(pai_section(hp^.next)^.sec);
  548. objectoutput^.defaultsection(pai_section(hp^.next)^.sec);
  549. end;
  550. hp:=pai(hp^.next);
  551. end;
  552. hp:=pai(hp^.next);
  553. end;
  554. end;
  555. end;
  556. procedure ti386binasmlist.writebin;
  557. var
  558. mylist : paasmoutput;
  559. procedure addlist(p:paasmoutput);
  560. begin
  561. mylist^.concat(new(pai_section,init(sec_code)));
  562. mylist^.concatlist(p);
  563. end;
  564. begin
  565. {$ifdef MULTIPASS}
  566. { Process the codesegment twice so the jmp instructions can
  567. be optimized }
  568. TreePass1(pai(codesegment^.first),true);
  569. if assigned(importssection) then
  570. TreePass1(pai(importssection^.first),true);
  571. {$endif}
  572. objectalloc^.resetsections;
  573. objectalloc^.setsection(sec_code);
  574. objectoutput^.initwriting;
  575. objectoutput^.defaultsection(sec_code);
  576. new(mylist,init);
  577. if not(cs_compilesystem in aktmoduleswitches) then
  578. addlist(externals);
  579. if cs_debuginfo in aktmoduleswitches then
  580. addlist(debuglist);
  581. addlist(codesegment);
  582. addlist(datasegment);
  583. addlist(consts);
  584. addlist(rttilist);
  585. addlist(bsssegment);
  586. if assigned(importssection) then
  587. addlist(importssection);
  588. if assigned(exportssection) then
  589. addlist(exportssection);
  590. if assigned(resourcesection) then
  591. addlist(resourcesection);
  592. WriteTree(mylist);
  593. dispose(mylist,done);
  594. objectoutput^.donewriting;
  595. end;
  596. constructor ti386binasmlist.init(t:togtype);
  597. begin
  598. case t of
  599. og_none :
  600. begin
  601. writeln('no binary writer selected');
  602. exit;
  603. end;
  604. og_dbg :
  605. objectoutput:=new(pdbgoutput,init);
  606. og_coff :
  607. objectoutput:=new(pdjgppcoffoutput,init);
  608. og_pecoff :
  609. objectoutput:=new(pwin32coffoutput,init);
  610. end;
  611. objectalloc:=new(pobjectalloc,init);
  612. end;
  613. destructor ti386binasmlist.done;
  614. begin
  615. dispose(objectoutput,done);
  616. dispose(objectalloc,done);
  617. end;
  618. end.
  619. {
  620. $Log$
  621. Revision 1.1 1999-05-01 13:23:57 peter
  622. * merged nasm compiler
  623. * old asm moved to oldasm/
  624. Revision 1.14 1999/04/16 11:49:48 peter
  625. + tempalloc
  626. + -at to show temp alloc info in .s file
  627. Revision 1.13 1999/03/12 00:20:03 pierre
  628. + win32 output working !
  629. Revision 1.12 1999/03/11 17:52:34 peter
  630. * fixed wrong ot_signed generation in insns tab
  631. Revision 1.11 1999/03/10 13:41:07 pierre
  632. + partial implementation for win32 !
  633. winhello works but pp still does not !
  634. Revision 1.10 1999/03/08 14:51:05 peter
  635. + smartlinking for ag386bin
  636. Revision 1.9 1999/03/06 17:24:18 peter
  637. * rewritten intel parser a lot, especially reference reading
  638. * size checking added for asm parsers
  639. Revision 1.8 1999/03/05 13:09:50 peter
  640. * first things for tai_cut support for ag386bin
  641. Revision 1.7 1999/03/03 11:41:53 pierre
  642. + stabs info corrected to give results near to GAS output
  643. * local labels (with .L are not stored in object anymore)
  644. so we get the same number of symbols as from GAS !
  645. Revision 1.6 1999/03/03 01:36:44 pierre
  646. + stabs output working (though not really tested)
  647. for a simple file the only difference to GAS output is due
  648. to the VMA of the different sections
  649. Revision 1.5 1999/03/02 02:56:18 peter
  650. + stabs support for binary writers
  651. * more fixes and missing updates from the previous commit :(
  652. Revision 1.4 1999/03/01 15:46:20 peter
  653. * ag386bin finally make cycles correct
  654. * prefixes are now also normal opcodes
  655. Revision 1.3 1999/02/25 21:03:01 peter
  656. * ag386bin updates
  657. + coff writer
  658. Revision 1.2 1999/02/22 02:16:00 peter
  659. * updates for ag386bin
  660. Revision 1.1 1999/02/16 17:59:37 peter
  661. + initial files
  662. }