lin_targ.pas 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. {
  2. $Id$
  3. Copyright (c) 1998 by Florian Klaempfl
  4. This unit implements some support routines for the linux target like
  5. import/export handling
  6. This program is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 2 of the License, or
  9. (at your option) any later version.
  10. This program is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. GNU General Public License for more details.
  14. You should have received a copy of the GNU General Public License
  15. along with this program; if not, write to the Free Software
  16. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17. ****************************************************************************
  18. }
  19. unit lin_targ;
  20. interface
  21. uses import;
  22. type
  23. pimportliblinux=^timportliblinux;
  24. timportliblinux=object(timportlib)
  25. procedure preparelib(const s:string);virtual;
  26. procedure importprocedure(const func,module:string;index:longint;const name:string);virtual;
  27. procedure importvariable(const varname,module:string;const name:string);virtual;
  28. procedure generatelib;virtual;
  29. end;
  30. implementation
  31. uses
  32. verbose,strings,cobjects,systems,globtype,globals,
  33. files,aasm,symtable;
  34. procedure timportliblinux.preparelib(const s : string);
  35. begin
  36. end;
  37. procedure timportliblinux.importprocedure(const func,module : string;index : longint;const name : string);
  38. begin
  39. { insert sharedlibrary }
  40. current_module^.linkothersharedlibs.insert(SplitName(module),link_allways);
  41. { do nothing with the procedure, only set the mangledname }
  42. if name<>'' then
  43. aktprocsym^.definition^.setmangledname(name)
  44. else
  45. Message(parser_e_empty_import_name);
  46. end;
  47. procedure timportliblinux.importvariable(const varname,module:string;const name:string);
  48. begin
  49. { insert sharedlibrary }
  50. current_module^.linkothersharedlibs.insert(SplitName(module),link_allways);
  51. { reset the mangledname and turn off the dll_var option }
  52. aktvarsym^.setmangledname(name);
  53. aktvarsym^.var_options:=aktvarsym^.var_options and (not vo_is_dll_var);
  54. end;
  55. procedure timportliblinux.generatelib;
  56. begin
  57. end;
  58. end.
  59. {
  60. $Log$
  61. Revision 1.4 1999-07-03 00:29:50 peter
  62. * new link writing to the ppu, one .ppu is needed for all link types,
  63. static (.o) is now always created also when smartlinking is used
  64. Revision 1.3 1999/01/20 14:18:32 pierre
  65. * bugs related to mangledname solved
  66. - linux external without name
  67. -external procs already used
  68. (added count and is_used boolean fiels in tprocvar)
  69. Revision 1.2 1998/11/28 16:20:51 peter
  70. + support for dll variables
  71. Revision 1.1 1998/10/19 18:07:13 peter
  72. + external dll_name name func support for linux
  73. }