i_bsd.pas 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552
  1. {
  2. Copyright (c) 1998-2002 by Peter Vreman
  3. This unit implements support information structures for FreeBSD/NetBSD
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software
  14. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  15. ****************************************************************************
  16. }
  17. { This unit implements support information structures for FreeBSD/NetBSD.
  18. OpenBSD is only added for i386 for now, though it exists for most
  19. other common CPU's too}
  20. unit i_bsd;
  21. interface
  22. uses
  23. systems;
  24. const
  25. system_i386_freebsd_info : tsysteminfo =
  26. (
  27. system : system_i386_FreeBSD;
  28. name : 'FreeBSD/ELF for i386';
  29. shortname : 'FreeBSD';
  30. flags : [tf_pic_uses_got,tf_files_case_sensitive,tf_use_function_relative_addresses,
  31. {$ifdef segment_threadvars}
  32. tf_section_threadvars,
  33. {$endif segment_threadvars}
  34. tf_needs_symbol_type,tf_needs_symbol_size {,tf_smartlink_sections}];
  35. cpu : cpu_i386;
  36. unit_env : 'BSDUNITS';
  37. extradefines : 'UNIX;BSD;HASUNIX';
  38. exeext : '';
  39. defext : '.def';
  40. scriptext : '.sh';
  41. smartext : '.sl';
  42. unitext : '.ppu';
  43. unitlibext : '.ppl';
  44. asmext : '.s';
  45. objext : '.o';
  46. resext : '.res';
  47. resobjext : '.or';
  48. sharedlibext : '.so';
  49. staticlibext : '.a';
  50. staticlibprefix : 'libp';
  51. sharedlibprefix : 'lib';
  52. sharedClibext : '.so';
  53. staticClibext : '.a';
  54. staticClibprefix : 'lib';
  55. sharedClibprefix : 'lib';
  56. Cprefix : '';
  57. newline : #10;
  58. dirsep : '/';
  59. assem : as_i386_elf32;
  60. assemextern : as_gas;
  61. link : nil;
  62. linkextern : nil;
  63. ar : ar_gnu_ar;
  64. res : res_none;
  65. dbg : dbg_stabs;
  66. script : script_unix;
  67. endian : endian_little;
  68. alignment :
  69. (
  70. procalign : 4;
  71. loopalign : 4;
  72. jumpalign : 0;
  73. constalignmin : 0;
  74. constalignmax : 4;
  75. varalignmin : 0;
  76. varalignmax : 4;
  77. localalignmin : 0;
  78. localalignmax : 4;
  79. recordalignmin : 0;
  80. recordalignmax : 2;
  81. maxCrecordalign : 4
  82. );
  83. first_parm_offset : 8;
  84. stacksize : 262144;
  85. abi : abi_default;
  86. );
  87. system_x86_64_freebsd_info : tsysteminfo =
  88. (
  89. system : system_x86_64_freebsd;
  90. name : 'FreeBSD for x86-64';
  91. shortname : 'FreeBSD';
  92. flags : [tf_needs_symbol_size,tf_needs_dwarf_cfi,{Linux: tf_library_needs_pic,}tf_needs_symbol_type,
  93. tf_files_case_sensitive,tf_use_function_relative_addresses
  94. { tf_pic_uses_got,tf_smartlink_sections}];
  95. cpu : cpu_x86_64;
  96. unit_env : 'BSDUNITS';
  97. extradefines : 'UNIX;HASUNIX;BSD';
  98. exeext : '';
  99. defext : '.def';
  100. scriptext : '.sh';
  101. smartext : '.sl';
  102. unitext : '.ppu';
  103. unitlibext : '.ppl';
  104. asmext : '.s';
  105. objext : '.o';
  106. resext : '.res';
  107. resobjext : '.or';
  108. sharedlibext : '.so';
  109. staticlibext : '.a';
  110. staticlibprefix : 'libp';
  111. sharedlibprefix : 'lib';
  112. sharedClibext : '.so';
  113. staticClibext : '.a';
  114. staticClibprefix : 'lib';
  115. sharedClibprefix : 'lib';
  116. Cprefix : '';
  117. newline : #10;
  118. dirsep : '/';
  119. assem : as_x86_64_elf64;
  120. assemextern : as_gas;
  121. link : nil;
  122. linkextern : nil;
  123. ar : ar_gnu_ar;
  124. res : res_none;
  125. dbg : dbg_dwarf2; //dbg_stabs;
  126. script : script_unix;
  127. endian : endian_little;
  128. alignment :
  129. (
  130. procalign : 8;
  131. loopalign : 4;
  132. jumpalign : 0;
  133. constalignmin : 0;
  134. constalignmax : 8;
  135. varalignmin : 0;
  136. varalignmax : 16;
  137. localalignmin : 4;
  138. localalignmax : 16;
  139. recordalignmin : 0;
  140. recordalignmax : 16;
  141. maxCrecordalign : 8
  142. );
  143. first_parm_offset : 16;
  144. stacksize : 256*1024;
  145. abi : abi_default;
  146. );
  147. system_i386_netbsd_info : tsysteminfo =
  148. (
  149. system : system_i386_NetBSD;
  150. name : 'NetBSD for i386';
  151. shortname : 'NetBSD';
  152. flags : [tf_under_development,tf_files_case_sensitive,tf_use_function_relative_addresses];
  153. cpu : cpu_i386;
  154. unit_env : 'BSDUNITS';
  155. extradefines : 'UNIX;BSD;HASUNIX';
  156. exeext : '';
  157. defext : '.def';
  158. scriptext : '.sh';
  159. smartext : '.sl';
  160. unitext : '.ppu';
  161. unitlibext : '.ppl';
  162. asmext : '.s';
  163. objext : '.o';
  164. resext : '.res';
  165. resobjext : '.or';
  166. sharedlibext : '.so';
  167. staticlibext : '.a';
  168. staticlibprefix : 'libp';
  169. sharedlibprefix : 'lib';
  170. sharedClibext : '.so';
  171. staticClibext : '.a';
  172. staticClibprefix : 'lib';
  173. sharedClibprefix : 'lib';
  174. Cprefix : '_';
  175. newline : #10;
  176. dirsep : '/';
  177. assem : as_gas;
  178. assemextern : as_gas;
  179. link : nil;
  180. linkextern : nil;
  181. ar : ar_gnu_ar;
  182. res : res_none;
  183. dbg : dbg_stabs;
  184. script : script_unix;
  185. endian : endian_little;
  186. alignment :
  187. (
  188. procalign : 4;
  189. loopalign : 4;
  190. jumpalign : 0;
  191. constalignmin : 0;
  192. constalignmax : 1;
  193. varalignmin : 0;
  194. varalignmax : 1;
  195. localalignmin : 0;
  196. localalignmax : 1;
  197. recordalignmin : 0;
  198. recordalignmax : 2;
  199. maxCrecordalign : 4
  200. );
  201. first_parm_offset : 8;
  202. stacksize : 262144;
  203. abi : abi_default;
  204. );
  205. system_i386_openbsd_info : tsysteminfo =
  206. (
  207. system : system_i386_OpenBSD;
  208. name : 'OpenBSD for i386';
  209. shortname : 'OpenBSD';
  210. flags : [tf_under_development,tf_files_case_sensitive,tf_use_function_relative_addresses];
  211. cpu : cpu_i386;
  212. unit_env : 'BSDUNITS';
  213. extradefines : 'UNIX;BSD;HASUNIX';
  214. exeext : '';
  215. defext : '.def';
  216. scriptext : '.sh';
  217. smartext : '.sl';
  218. unitext : '.ppu';
  219. unitlibext : '.ppl';
  220. asmext : '.s';
  221. objext : '.o';
  222. resext : '.res';
  223. resobjext : '.or';
  224. sharedlibext : '.so';
  225. staticlibext : '.a';
  226. staticlibprefix : 'libp';
  227. sharedlibprefix : 'lib';
  228. sharedClibext : '.so';
  229. staticClibext : '.a';
  230. staticClibprefix : 'lib';
  231. sharedClibprefix : 'lib';
  232. Cprefix : '_';
  233. newline : #10;
  234. dirsep : '/';
  235. assem : as_gas;
  236. assemextern : as_gas;
  237. link : nil;
  238. linkextern : nil;
  239. ar : ar_gnu_ar;
  240. res : res_none;
  241. dbg : dbg_stabs;
  242. script : script_unix;
  243. endian : endian_little;
  244. alignment :
  245. (
  246. procalign : 4;
  247. loopalign : 4;
  248. jumpalign : 0;
  249. constalignmin : 0;
  250. constalignmax : 1;
  251. varalignmin : 0;
  252. varalignmax : 1;
  253. localalignmin : 0;
  254. localalignmax : 1;
  255. recordalignmin : 0;
  256. recordalignmax : 2;
  257. maxCrecordalign : 4
  258. );
  259. first_parm_offset : 8;
  260. stacksize : 262144;
  261. abi : abi_default;
  262. );
  263. system_m68k_netbsd_info : tsysteminfo =
  264. (
  265. system : system_m68k_NetBSD;
  266. name : 'NetBSD for m68k';
  267. shortname : 'NetBSD';
  268. flags : [tf_under_development,tf_files_case_sensitive,tf_use_function_relative_addresses];
  269. cpu : cpu_m68k;
  270. unit_env : 'BSDUNITS';
  271. extradefines : 'UNIX;BSD;HASUNIX';
  272. exeext : '';
  273. defext : '.def';
  274. scriptext : '.sh';
  275. smartext : '.sl';
  276. unitext : '.ppu';
  277. unitlibext : '.ppl';
  278. asmext : '.s';
  279. objext : '.o';
  280. resext : '.res';
  281. resobjext : '.or';
  282. sharedlibext : '.so';
  283. staticlibext : '.a';
  284. staticlibprefix : 'libp';
  285. sharedlibprefix : 'lib';
  286. sharedClibext : '.so';
  287. staticClibext : '.a';
  288. staticClibprefix : 'lib';
  289. sharedClibprefix : 'lib';
  290. Cprefix : '';
  291. newline : #10;
  292. dirsep : '/';
  293. assem : as_gas;
  294. assemextern : as_gas;
  295. link : nil;
  296. linkextern : nil;
  297. ar : ar_gnu_ar;
  298. res : res_none;
  299. dbg : dbg_stabs;
  300. script : script_unix;
  301. endian : endian_big;
  302. alignment :
  303. (
  304. procalign : 4;
  305. loopalign : 4;
  306. jumpalign : 0;
  307. constalignmin : 0;
  308. constalignmax : 1;
  309. varalignmin : 0;
  310. varalignmax : 1;
  311. localalignmin : 0;
  312. localalignmax : 1;
  313. recordalignmin : 0;
  314. recordalignmax : 2;
  315. maxCrecordalign : 4
  316. );
  317. first_parm_offset : 8;
  318. stacksize : 262144;
  319. abi : abi_default;
  320. );
  321. system_powerpc_netbsd_info : tsysteminfo =
  322. (
  323. system : system_powerpc_netbsd;
  324. name : 'NetBSD for PowerPC';
  325. shortname : 'NetBSD';
  326. flags : [tf_under_development,tf_files_case_sensitive,tf_use_function_relative_addresses];
  327. cpu : cpu_powerpc;
  328. unit_env : '';
  329. extradefines : 'UNIX;BSD;HASUNIX';
  330. exeext : '';
  331. defext : '.def';
  332. scriptext : '.sh';
  333. smartext : '.sl';
  334. unitext : '.ppu';
  335. unitlibext : '.ppl';
  336. asmext : '.s';
  337. objext : '.o';
  338. resext : '.res';
  339. resobjext : '.or';
  340. sharedlibext : '.so';
  341. staticlibext : '.s';
  342. staticlibprefix : 'libp';
  343. sharedlibprefix : 'lib';
  344. sharedClibext : '.so';
  345. staticClibext : '.a';
  346. staticClibprefix : 'lib';
  347. sharedClibprefix : 'lib';
  348. Cprefix : '';
  349. newline : #10;
  350. dirsep : '/';
  351. assem : as_gas;
  352. assemextern : as_gas;
  353. link : nil;
  354. linkextern : nil;
  355. ar : ar_gnu_ar;
  356. res : res_none;
  357. dbg : dbg_stabs;
  358. script : script_unix;
  359. endian : endian_big;
  360. alignment :
  361. (
  362. procalign : 4;
  363. loopalign : 4;
  364. jumpalign : 0;
  365. constalignmin : 0;
  366. constalignmax : 4;
  367. varalignmin : 0;
  368. varalignmax : 4;
  369. localalignmin : 0;
  370. localalignmax : 4;
  371. recordalignmin : 0;
  372. recordalignmax : 2;
  373. maxCrecordalign : 4 // should be 8 probably
  374. );
  375. first_parm_offset : 8;
  376. stacksize : 32*1024*1024;
  377. { abi_powerpc_sysv doesn't work yet }
  378. abi : abi_powerpc_aix;
  379. );
  380. system_powerpc_darwin_info : tsysteminfo =
  381. (
  382. system : system_powerpc_darwin;
  383. name : 'Darwin for PowerPC';
  384. shortname : 'Darwin';
  385. flags : [tf_p_ext_support,tf_files_case_aware,tf_smartlink_sections,tf_dwarf_relative_addresses,tf_dwarf_only_local_labels];
  386. cpu : cpu_powerpc;
  387. unit_env : 'BSDUNITS';
  388. extradefines : 'UNIX;BSD;HASUNIX';
  389. exeext : '';
  390. defext : '.def';
  391. scriptext : '.sh';
  392. smartext : '.sl';
  393. unitext : '.ppu';
  394. unitlibext : '.ppl';
  395. asmext : '.s';
  396. objext : '.o';
  397. resext : '.res';
  398. resobjext : '.or';
  399. sharedlibext : '.dylib';
  400. staticlibext : '.a';
  401. staticlibprefix : 'libp';
  402. sharedlibprefix : 'lib';
  403. sharedClibext : '.dylib';
  404. staticClibext : '.a';
  405. staticClibprefix : 'lib';
  406. sharedClibprefix : 'lib';
  407. Cprefix : '_';
  408. newline : #10;
  409. dirsep : '/';
  410. assem : as_darwin;
  411. assemextern : as_darwin;
  412. link : nil;
  413. linkextern : nil;
  414. ar : ar_gnu_ar;
  415. res : res_none;
  416. dbg : dbg_stabs;
  417. script : script_unix;
  418. endian : endian_big;
  419. alignment :
  420. (
  421. procalign : 16;
  422. loopalign : 4;
  423. jumpalign : 0;
  424. constalignmin : 0;
  425. constalignmax : 4;
  426. varalignmin : 0;
  427. varalignmax : 4;
  428. localalignmin : 0;
  429. localalignmax : 4;
  430. recordalignmin : 0;
  431. recordalignmax : 2;
  432. maxCrecordalign : 4
  433. );
  434. first_parm_offset : 24;
  435. stacksize : 262144;
  436. abi : abi_powerpc_aix;
  437. );
  438. system_i386_darwin_info : tsysteminfo =
  439. (
  440. system : system_i386_darwin;
  441. name : 'Darwin for i386';
  442. shortname : 'Darwin';
  443. flags : [tf_p_ext_support,tf_files_case_aware,tf_smartlink_sections,tf_dwarf_relative_addresses,tf_dwarf_only_local_labels];
  444. cpu : cpu_i386;
  445. unit_env : 'BSDUNITS';
  446. extradefines : 'UNIX;BSD;HASUNIX';
  447. exeext : '';
  448. defext : '.def';
  449. scriptext : '.sh';
  450. smartext : '.sl';
  451. unitext : '.ppu';
  452. unitlibext : '.ppl';
  453. asmext : '.s';
  454. objext : '.o';
  455. resext : '.res';
  456. resobjext : '.or';
  457. sharedlibext : '.dylib';
  458. staticlibext : '.a';
  459. staticlibprefix : 'libp';
  460. sharedlibprefix : 'lib';
  461. sharedClibext : '.dylib';
  462. staticClibext : '.a';
  463. staticClibprefix : 'lib';
  464. sharedClibprefix : 'lib';
  465. Cprefix : '_';
  466. newline : #10;
  467. dirsep : '/';
  468. assem : as_darwin;
  469. assemextern : as_darwin;
  470. link : nil;
  471. linkextern : nil;
  472. ar : ar_gnu_ar;
  473. res : res_none;
  474. dbg : dbg_stabs;
  475. script : script_unix;
  476. endian : endian_little;
  477. alignment :
  478. (
  479. procalign : 16;
  480. loopalign : 4;
  481. jumpalign : 0;
  482. constalignmin : 0;
  483. constalignmax : 8;
  484. varalignmin : 0;
  485. varalignmax : 16;
  486. localalignmin : 0;
  487. localalignmax : 8;
  488. recordalignmin : 0;
  489. recordalignmax : 16;
  490. maxCrecordalign : 16
  491. );
  492. first_parm_offset : 8;
  493. stacksize : 262144;
  494. abi : abi_default;
  495. );
  496. implementation
  497. initialization
  498. {$ifdef cpu86}
  499. {$ifdef FreeBSD}
  500. set_source_info(system_i386_FreeBSD_info);
  501. {$endif}
  502. {$ifdef NetBSD}
  503. set_source_info(system_i386_NetBSD_info);
  504. {$endif}
  505. {$ifdef OpenBSD}
  506. set_source_info(system_i386_NetBSD_info);
  507. {$endif}
  508. {$ifdef Darwin}
  509. set_source_info(system_i386_Darwin_info);
  510. {$endif Darwin}
  511. {$endif cpu86}
  512. {$ifdef cpux86_64}
  513. {$ifdef FreeBSD}
  514. set_source_info(system_x86_64_FreeBSD_info);
  515. {$endif}
  516. {$endif}
  517. {$ifdef cpu68}
  518. {$ifdef NetBSD}
  519. set_source_info(system_m68k_NetBSD_info);
  520. {$endif NetBSD}
  521. {$endif cpu68}
  522. {$ifdef cpupowerpc}
  523. {$ifdef Darwin}
  524. set_source_info(system_powerpc_darwin_info);
  525. {$endif Darwin}
  526. {$ifdef NetBSD}
  527. set_source_info(system_powerpc_netbsd_info);
  528. {$endif}
  529. {$endif cpu68}
  530. end.