i_linux.pas 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542
  1. {
  2. $Id$
  3. Copyright (c) 1998-2002 by Peter Vreman
  4. This unit implements support information structures for linux
  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. { This unit implements support information structures for linux. }
  19. unit i_linux;
  20. interface
  21. uses
  22. systems;
  23. const
  24. system_i386_linux_info : tsysteminfo =
  25. (
  26. system : system_i386_LINUX;
  27. name : 'Linux for i386';
  28. shortname : 'Linux';
  29. flags : [tf_needs_symbol_size];
  30. cpu : cpu_i386;
  31. unit_env : 'LINUXUNITS';
  32. extradefines : 'UNIX;HASUNIX';
  33. sourceext : '.pp';
  34. pasext : '.pas';
  35. exeext : '';
  36. defext : '.def';
  37. scriptext : '.sh';
  38. smartext : '.sl';
  39. unitext : '.ppu';
  40. unitlibext : '.ppl';
  41. asmext : '.s';
  42. objext : '.o';
  43. resext : '.res';
  44. resobjext : '.or';
  45. sharedlibext : '.so';
  46. staticlibext : '.a';
  47. staticlibprefix : 'libp';
  48. sharedlibprefix : 'lib';
  49. sharedClibext : '.so';
  50. staticClibext : '.a';
  51. staticClibprefix : 'lib';
  52. sharedClibprefix : 'lib';
  53. Cprefix : '';
  54. newline : #10;
  55. dirsep : '/';
  56. files_case_relevent : true;
  57. assem : as_i386_elf32;
  58. assemextern : as_gas;
  59. link : nil;
  60. linkextern : nil;
  61. ar : ar_gnu_ar;
  62. res : res_none;
  63. script : script_unix;
  64. endian : endian_little;
  65. alignment :
  66. (
  67. procalign : 4;
  68. loopalign : 4;
  69. jumpalign : 0;
  70. constalignmin : 0;
  71. constalignmax : 4;
  72. varalignmin : 0;
  73. varalignmax : 4;
  74. localalignmin : 4;
  75. localalignmax : 4;
  76. recordalignmin : 0;
  77. recordalignmax : 4;
  78. maxCrecordalign : 4
  79. );
  80. first_parm_offset : 8;
  81. heapsize : 256*1024;
  82. stacksize : 262144;
  83. DllScanSupported:false;
  84. use_function_relative_addresses : true
  85. );
  86. system_m68k_linux_info : tsysteminfo =
  87. (
  88. system : system_m68k_linux;
  89. name : 'Linux for m68k';
  90. shortname : 'linux';
  91. flags : [tf_needs_symbol_size];
  92. cpu : cpu_m68k;
  93. unit_env : 'LINUXUNITS';
  94. extradefines : 'UNIX;HASUNIX';
  95. sourceext : '.pp';
  96. pasext : '.pas';
  97. exeext : '';
  98. defext : '';
  99. scriptext : '.sh';
  100. smartext : '.sl';
  101. unitext : '.ppu';
  102. unitlibext : '.ppl';
  103. asmext : '.s';
  104. objext : '.o';
  105. resext : '.res';
  106. resobjext : '.or';
  107. sharedlibext : '.so';
  108. staticlibext : '.a';
  109. staticlibprefix : 'libp';
  110. sharedlibprefix : 'lib';
  111. sharedClibext : '.so';
  112. staticClibext : '.a';
  113. staticClibprefix : 'lib';
  114. sharedClibprefix : 'lib';
  115. Cprefix : '';
  116. newline : #10;
  117. dirsep : '/';
  118. files_case_relevent : true;
  119. assem : as_gas;
  120. assemextern : as_gas;
  121. link : nil;
  122. linkextern : nil;
  123. ar : ar_gnu_ar;
  124. res : res_none;
  125. script : script_unix;
  126. endian : endian_big;
  127. alignment :
  128. (
  129. procalign : 4;
  130. loopalign : 4;
  131. jumpalign : 0;
  132. constalignmin : 0;
  133. constalignmax : 4;
  134. varalignmin : 0;
  135. varalignmax : 4;
  136. localalignmin : 4;
  137. localalignmax : 4;
  138. recordalignmin : 0;
  139. recordalignmax : 2;
  140. maxCrecordalign : 4
  141. );
  142. first_parm_offset : 8;
  143. heapsize : 128*1024;
  144. stacksize : 32*1024*1024;
  145. DllScanSupported:false;
  146. use_function_relative_addresses : true
  147. );
  148. system_powerpc_linux_info : tsysteminfo =
  149. (
  150. system : system_powerpc_LINUX;
  151. name : 'Linux for PowerPC';
  152. shortname : 'linux';
  153. flags : [tf_needs_symbol_size];
  154. cpu : cpu_powerpc;
  155. unit_env : '';
  156. extradefines : 'UNIX;HASUNIX';
  157. sourceext : '.pp';
  158. pasext : '.pas';
  159. exeext : '';
  160. defext : '.def';
  161. scriptext : '.sh';
  162. smartext : '.sl';
  163. unitext : '.ppu';
  164. unitlibext : '.ppl';
  165. asmext : '.s';
  166. objext : '.o';
  167. resext : '.res';
  168. resobjext : '.or';
  169. sharedlibext : '.so';
  170. staticlibext : '.a';
  171. staticlibprefix : 'libp';
  172. sharedlibprefix : 'lib';
  173. sharedClibext : '.so';
  174. staticClibext : '.a';
  175. staticClibprefix : 'lib';
  176. sharedClibprefix : 'lib';
  177. Cprefix : '';
  178. newline : #10;
  179. dirsep : '/';
  180. files_case_relevent : true;
  181. assem : as_gas;
  182. assemextern : as_gas;
  183. link : nil;
  184. linkextern : nil;
  185. ar : ar_gnu_ar;
  186. res : res_none;
  187. script : script_unix;
  188. endian : endian_big;
  189. alignment :
  190. (
  191. procalign : 4;
  192. loopalign : 4;
  193. jumpalign : 0;
  194. constalignmin : 0;
  195. constalignmax : 4;
  196. varalignmin : 0;
  197. varalignmax : 4;
  198. localalignmin : 4;
  199. localalignmax : 4;
  200. recordalignmin : 0;
  201. recordalignmax : 4;
  202. maxCrecordalign : 8
  203. );
  204. first_parm_offset : 8;
  205. heapsize : 256*1024;
  206. stacksize : 32*1024*1024;
  207. DllScanSupported:false;
  208. use_function_relative_addresses : true;
  209. abi : abi_powerpc_sysv;
  210. );
  211. system_alpha_linux_info : tsysteminfo =
  212. (
  213. system : system_alpha_LINUX;
  214. name : 'Linux for Alpha';
  215. shortname : 'linux';
  216. flags : [tf_needs_symbol_size];
  217. cpu : cpu_alpha;
  218. unit_env : 'LINUXUNITS';
  219. extradefines : 'UNIX;HASUNIX';
  220. sourceext : '.pp';
  221. pasext : '.pas';
  222. exeext : '';
  223. defext : '.def';
  224. scriptext : '.sh';
  225. smartext : '.sl';
  226. unitext : '.ppu';
  227. unitlibext : '.ppl';
  228. asmext : '.s';
  229. objext : '.o';
  230. resext : '.res';
  231. resobjext : '.or';
  232. sharedlibext : '.so';
  233. staticlibext : '.a';
  234. staticlibprefix : 'libp';
  235. sharedlibprefix : 'lib';
  236. sharedClibext : '.so';
  237. staticClibext : '.a';
  238. staticClibprefix : 'lib';
  239. sharedClibprefix : 'lib';
  240. Cprefix : '';
  241. newline : #10;
  242. dirsep : '/';
  243. files_case_relevent : true;
  244. assem : as_gas;
  245. assemextern : as_gas;
  246. link : nil;
  247. linkextern : nil;
  248. ar : ar_gnu_ar;
  249. res : res_none;
  250. script : script_unix;
  251. endian : endian_little;
  252. alignment :
  253. (
  254. procalign : 4;
  255. loopalign : 4;
  256. jumpalign : 0;
  257. constalignmin : 0;
  258. constalignmax : 4;
  259. varalignmin : 0;
  260. varalignmax : 4;
  261. localalignmin : 4;
  262. localalignmax : 4;
  263. recordalignmin : 0;
  264. recordalignmax : 2;
  265. maxCrecordalign : 4
  266. );
  267. first_parm_offset : 8;
  268. heapsize : 256*1024;
  269. stacksize : 32*1024*1024;
  270. DllScanSupported:false;
  271. use_function_relative_addresses : true
  272. );
  273. system_x86_64_linux_info : tsysteminfo =
  274. (
  275. system : system_x86_64_LINUX;
  276. name : 'Linux for x86-64';
  277. shortname : 'linux';
  278. flags : [tf_needs_symbol_size,tf_needs_dwarf_cfi];
  279. cpu : cpu_x86_64;
  280. unit_env : 'LINUXUNITS';
  281. extradefines : 'UNIX;HASUNIX';
  282. sourceext : '.pp';
  283. pasext : '.pas';
  284. exeext : '';
  285. defext : '.def';
  286. scriptext : '.sh';
  287. smartext : '.sl';
  288. unitext : '.ppu';
  289. unitlibext : '.ppl';
  290. asmext : '.s';
  291. objext : '.o';
  292. resext : '.res';
  293. resobjext : '.or';
  294. sharedlibext : '.so';
  295. staticlibext : '.a';
  296. staticlibprefix : 'libp';
  297. sharedlibprefix : 'lib';
  298. sharedClibext : '.so';
  299. staticClibext : '.a';
  300. staticClibprefix : 'lib';
  301. sharedClibprefix : 'lib';
  302. Cprefix : '';
  303. newline : #10;
  304. dirsep : '/';
  305. files_case_relevent : true;
  306. assem : as_gas;
  307. assemextern : as_gas;
  308. link : nil;
  309. linkextern : nil;
  310. ar : ar_gnu_ar;
  311. res : res_none;
  312. script : script_unix;
  313. endian : endian_little;
  314. alignment :
  315. (
  316. procalign : 8;
  317. loopalign : 4;
  318. jumpalign : 0;
  319. constalignmin : 0;
  320. constalignmax : 8;
  321. varalignmin : 0;
  322. varalignmax : 8;
  323. localalignmin : 4;
  324. localalignmax : 8;
  325. recordalignmin : 0;
  326. recordalignmax : 8;
  327. maxCrecordalign : 8
  328. );
  329. first_parm_offset : 16;
  330. heapsize : 256*1024;
  331. stacksize : 256*1024;
  332. DllScanSupported:false;
  333. use_function_relative_addresses : true
  334. );
  335. system_sparc_linux_info : tsysteminfo =
  336. (
  337. system : system_SPARC_Linux;
  338. name : 'Linux for SPARC';
  339. shortname : 'linux';
  340. flags : [tf_needs_symbol_size];
  341. cpu : cpu_SPARC;
  342. unit_env : 'LINUXUNITS';
  343. extradefines : 'UNIX;HASUNIX';
  344. sourceext : '.pp';
  345. pasext : '.pas';
  346. exeext : '';
  347. defext : '.def';
  348. scriptext : '.sh';
  349. smartext : '.sl';
  350. unitext : '.ppu';
  351. unitlibext : '.ppl';
  352. asmext : '.s';
  353. objext : '.o';
  354. resext : '.res';
  355. resobjext : '.or';
  356. sharedlibext : '.so';
  357. staticlibext : '.a';
  358. staticlibprefix : 'libp';
  359. sharedlibprefix : 'lib';
  360. sharedClibext : '.so';
  361. staticClibext : '.a';
  362. staticClibprefix : 'lib';
  363. sharedClibprefix : 'lib';
  364. Cprefix : '';
  365. newline : #10;
  366. dirsep : '/';
  367. files_case_relevent : true;
  368. assem : as_gas;
  369. assemextern : as_gas;
  370. link : nil;
  371. linkextern : nil;
  372. ar : ar_gnu_ar;
  373. res : res_none;
  374. script : script_unix;
  375. endian : endian_big;
  376. alignment :
  377. (
  378. procalign : 4;
  379. loopalign : 4;
  380. jumpalign : 0;
  381. constalignmin : 0;
  382. constalignmax : 8;
  383. varalignmin : 0;
  384. varalignmax : 8;
  385. localalignmin : 4;
  386. localalignmax : 8;
  387. recordalignmin : 0;
  388. recordalignmax : 8;
  389. maxCrecordalign : 8
  390. );
  391. first_parm_offset : 92;
  392. heapsize : 256*1024;
  393. stacksize : 262144;
  394. DllScanSupported:false;
  395. use_function_relative_addresses : true
  396. );
  397. system_arm_linux_info : tsysteminfo =
  398. (
  399. system : system_arm_Linux;
  400. name : 'Linux for ARM';
  401. shortname : 'linux';
  402. flags : [tf_needs_symbol_size];
  403. cpu : cpu_arm;
  404. unit_env : 'LINUXUNITS';
  405. extradefines : 'UNIX;HASUNIX';
  406. sourceext : '.pp';
  407. pasext : '.pas';
  408. exeext : '';
  409. defext : '.def';
  410. scriptext : '.sh';
  411. smartext : '.sl';
  412. unitext : '.ppu';
  413. unitlibext : '.ppl';
  414. asmext : '.s';
  415. objext : '.o';
  416. resext : '.res';
  417. resobjext : '.or';
  418. sharedlibext : '.so';
  419. staticlibext : '.a';
  420. staticlibprefix : 'libp';
  421. sharedlibprefix : 'lib';
  422. sharedClibext : '.so';
  423. staticClibext : '.a';
  424. staticClibprefix : 'lib';
  425. sharedClibprefix : 'lib';
  426. Cprefix : '';
  427. newline : #10;
  428. dirsep : '/';
  429. files_case_relevent : true;
  430. assem : as_gas;
  431. assemextern : as_gas;
  432. link : nil;
  433. linkextern : nil;
  434. ar : ar_gnu_ar;
  435. res : res_none;
  436. script : script_unix;
  437. endian : endian_little;
  438. alignment :
  439. (
  440. procalign : 4;
  441. loopalign : 4;
  442. jumpalign : 0;
  443. constalignmin : 0;
  444. constalignmax : 4;
  445. varalignmin : 0;
  446. varalignmax : 4;
  447. localalignmin : 4;
  448. localalignmax : 8;
  449. recordalignmin : 0;
  450. recordalignmax : 4;
  451. maxCrecordalign : 4
  452. );
  453. first_parm_offset : 8;
  454. heapsize : 256*1024;
  455. stacksize : 262144;
  456. DllScanSupported:false;
  457. use_function_relative_addresses : true
  458. );
  459. implementation
  460. initialization
  461. {$ifdef CPU86}
  462. {$ifdef linux}
  463. { some FreeBSD versions define linux as well }
  464. {$ifndef FreeBSD}
  465. set_source_info(system_i386_linux_info);
  466. {$endif FreeBSD}
  467. {$endif}
  468. {$endif CPU86}
  469. {$ifdef CPU68}
  470. {$ifdef linux}
  471. set_source_info(system_m68k_linux_info);
  472. {$endif linux}
  473. {$endif CPU68}
  474. {$ifdef CPUX86_64}
  475. {$ifdef linux}
  476. set_source_info(system_x86_64_linux_info);
  477. {$endif linux}
  478. {$endif CPUX86_64}
  479. {$ifdef CPUALPHA}
  480. {$ifdef linux}
  481. set_source_info(system_alpha_linux_info);
  482. {$endif linux}
  483. {$endif CPUALPHA}
  484. {$ifdef CPUSPARC}
  485. {$ifdef linux}
  486. set_source_info(system_sparc_linux_info);
  487. {$endif linux}
  488. {$endif CPUSPARC}
  489. {$ifdef CPUPOWERPC}
  490. {$ifdef linux}
  491. set_source_info(system_powerpc_linux_info);
  492. {$endif linux}
  493. {$endif CPUPOWERPC}
  494. {$ifdef CPUARM}
  495. {$ifdef linux}
  496. set_source_info(system_arm_linux_info);
  497. {$endif linux}
  498. {$endif CPUARM}
  499. end.
  500. {
  501. $Log$
  502. Revision 1.29 2004-08-15 13:30:18 florian
  503. * fixed alignment of variant records
  504. * more alignment problems fixed
  505. Revision 1.28 2004/06/29 21:00:08 peter
  506. * only enable dwarf for supported platforms
  507. Revision 1.27 2004/06/20 08:55:32 florian
  508. * logs truncated
  509. Revision 1.26 2004/06/16 20:07:11 florian
  510. * dwarf branch merged
  511. Revision 1.25.2.5 2004/05/31 22:08:21 peter
  512. * fix passing of >6 arguments
  513. Revision 1.25.2.4 2004/05/19 21:34:58 peter
  514. * disable section smartlink, it is not working stable
  515. Revision 1.25.2.3 2004/05/10 21:28:34 peter
  516. * section_smartlink enabled for gas under linux
  517. Revision 1.25.2.2 2004/05/02 14:17:27 peter
  518. * fix cpux86_64 ifdef
  519. }