home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / binutils-2.7-src.tgz / tar.out / fsf / binutils / bfd / nlm-target.h < prev    next >
C/C++ Source or Header  |  1996-09-28  |  8KB  |  229 lines

  1. /* Target definitions for 32/64-bit NLM (NetWare Loadable Module)
  2.    Copyright (C) 1993, 1994 Free Software Foundation, Inc.
  3.  
  4. This file is part of BFD, the Binary File Descriptor library.
  5.  
  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.  
  11. This program is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. GNU General Public License for more details.
  15.  
  16. You should have received a copy of the GNU General Public License
  17. along with this program; if not, write to the Free Software
  18. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
  19.  
  20. #define nlm_core_file_p _bfd_dummy_target
  21.  
  22. #define nlm_get_symtab_upper_bound nlmNAME(get_symtab_upper_bound)
  23. #define nlm_get_symtab nlmNAME(get_symtab)
  24. #define nlm_make_empty_symbol nlmNAME(make_empty_symbol)
  25. #define nlm_print_symbol nlmNAME(print_symbol)
  26. #define nlm_get_symbol_info nlmNAME(get_symbol_info)
  27. #define nlm_bfd_is_local_label bfd_generic_is_local_label
  28. #define nlm_get_lineno _bfd_nosymbols_get_lineno
  29. #define nlm_find_nearest_line _bfd_nosymbols_find_nearest_line
  30. #define nlm_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
  31. #define nlm_read_minisymbols _bfd_generic_read_minisymbols
  32. #define nlm_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol
  33.  
  34. #define nlm_get_reloc_upper_bound nlmNAME(get_reloc_upper_bound)
  35. #define nlm_canonicalize_reloc nlmNAME(canonicalize_reloc)
  36. #define nlm_bfd_reloc_type_lookup bfd_default_reloc_type_lookup
  37.  
  38. #define nlm_set_section_contents nlmNAME(set_section_contents)
  39.  
  40. #define nlm_sizeof_headers _bfd_nolink_sizeof_headers
  41. #define nlm_bfd_get_relocated_section_contents \
  42.   bfd_generic_get_relocated_section_contents
  43. #define nlm_bfd_relax_section bfd_generic_relax_section
  44. #define nlm_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
  45. #define nlm_bfd_link_add_symbols _bfd_generic_link_add_symbols
  46. #define nlm_bfd_final_link _bfd_generic_final_link
  47. #define nlm_bfd_link_split_section _bfd_generic_link_split_section
  48.  
  49. /* This structure contains everything that BFD knows about a target.
  50.    It includes things like its byte order, name, what routines to call
  51.    to do various operations, etc.  Every BFD points to a target structure
  52.    with its "xvec" member.
  53.  
  54.    There are two such structures here:  one for big-endian machines and
  55.    one for little-endian machines.   */
  56.  
  57.  
  58. #ifdef TARGET_BIG_SYM
  59. const bfd_target TARGET_BIG_SYM =
  60. {
  61.   /* name: identify kind of target */
  62.   TARGET_BIG_NAME,
  63.  
  64.   /* flavour: general indication about file */
  65.   bfd_target_nlm_flavour,
  66.  
  67.   /* byteorder: data is big endian */
  68.   BFD_ENDIAN_BIG,
  69.  
  70.   /* header_byteorder: header is also big endian */
  71.   BFD_ENDIAN_BIG,
  72.  
  73.   /* object_flags: mask of all file flags */
  74.   (HAS_RELOC | EXEC_P | HAS_LINENO | HAS_DEBUG | HAS_SYMS | HAS_LOCALS
  75.    | WP_TEXT),
  76.   
  77.   /* section_flags: mask of all section flags */
  78.   (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_READONLY |
  79.    SEC_CODE | SEC_DATA), 
  80.  
  81.    /* leading_symbol_char: is the first char of a user symbol
  82.       predictable, and if so what is it */
  83.    0,
  84.  
  85.   /* ar_pad_char: pad character for filenames within an archive header
  86.      FIXME:  this really has nothing to do with NLM, this is a characteristic
  87.      of the archiver and/or os and should be independently tunable */
  88.   '/',
  89.  
  90.   /* ar_max_namelen: maximum number of characters in an archive header
  91.      FIXME:  this really has nothing to do with NLM, this is a characteristic
  92.      of the archiver and should be independently tunable.  This value is
  93.      a WAG (wild a** guess) */
  94.   15,
  95.  
  96.   /* Routines to byte-swap various sized integers from the data sections */
  97.   bfd_getb64, bfd_getb_signed_64, bfd_putb64,
  98.     bfd_getb32, bfd_getb_signed_32, bfd_putb32,
  99.     bfd_getb16, bfd_getb_signed_16, bfd_putb16,
  100.  
  101.   /* Routines to byte-swap various sized integers from the file headers */
  102.   bfd_getb64, bfd_getb_signed_64, bfd_putb64,
  103.     bfd_getb32, bfd_getb_signed_32, bfd_putb32,
  104.     bfd_getb16, bfd_getb_signed_16, bfd_putb16,
  105.  
  106.   /* bfd_check_format: check the format of a file being read */
  107.   { _bfd_dummy_target,        /* unknown format */
  108.     nlmNAME(object_p),        /* assembler/linker output (object file) */
  109.     bfd_generic_archive_p,    /* an archive */
  110.     nlm_core_file_p        /* a core file */
  111.   },
  112.  
  113.   /* bfd_set_format: set the format of a file being written */
  114.   { bfd_false,
  115.     nlm_mkobject,
  116.     _bfd_generic_mkarchive,
  117.     bfd_false
  118.   },
  119.  
  120.   /* bfd_write_contents: write cached information into a file being written */
  121.   { bfd_false,
  122.     nlmNAME(write_object_contents),
  123.     _bfd_write_archive_contents,
  124.     bfd_false
  125.   },
  126.  
  127.   /* Initialize a jump table with the standard macro.  All names start with
  128.      "nlm" */
  129.   BFD_JUMP_TABLE_GENERIC (_bfd_generic),
  130.   BFD_JUMP_TABLE_COPY (_bfd_generic),
  131.   BFD_JUMP_TABLE_CORE (_bfd_nocore),
  132.   BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive),
  133.   BFD_JUMP_TABLE_SYMBOLS (nlm),
  134.   BFD_JUMP_TABLE_RELOCS (nlm),
  135.   BFD_JUMP_TABLE_WRITE (nlm),
  136.   BFD_JUMP_TABLE_LINK (nlm),
  137.   BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
  138.  
  139.   /* backend_data: */
  140.   (PTR) TARGET_BACKEND_DATA
  141. };
  142. #endif
  143.  
  144. #ifdef TARGET_LITTLE_SYM
  145. const bfd_target TARGET_LITTLE_SYM =
  146. {
  147.   /* name: identify kind of target */
  148.   TARGET_LITTLE_NAME,
  149.  
  150.   /* flavour: general indication about file */
  151.   bfd_target_nlm_flavour,
  152.  
  153.   /* byteorder: data is little endian */
  154.   BFD_ENDIAN_LITTLE,
  155.  
  156.   /* header_byteorder: header is also little endian */
  157.   BFD_ENDIAN_LITTLE,
  158.  
  159.   /* object_flags: mask of all file flags */
  160.   (HAS_RELOC | EXEC_P | HAS_LINENO | HAS_DEBUG | HAS_SYMS | HAS_LOCALS
  161.    | WP_TEXT),
  162.   
  163.   /* section_flags: mask of all section flags */
  164.   (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_READONLY |
  165.    SEC_DATA), 
  166.  
  167.    /* leading_symbol_char: is the first char of a user symbol
  168.       predictable, and if so what is it */
  169.    0,
  170.  
  171.   /* ar_pad_char: pad character for filenames within an archive header
  172.      FIXME:  this really has nothing to do with NLM, this is a characteristic
  173.      of the archiver and/or os and should be independently tunable */
  174.   '/',
  175.  
  176.   /* ar_max_namelen: maximum number of characters in an archive header
  177.      FIXME:  this really has nothing to do with NLM, this is a characteristic
  178.      of the archiver and should be independently tunable.  This value is
  179.      a WAG (wild a** guess) */
  180.   15,
  181.  
  182.   /* Routines to byte-swap various sized integers from the data sections */
  183.   bfd_getl64, bfd_getl_signed_64, bfd_putl64,
  184.     bfd_getl32, bfd_getl_signed_32, bfd_putl32,
  185.     bfd_getl16, bfd_getl_signed_16, bfd_putl16,
  186.  
  187.   /* Routines to byte-swap various sized integers from the file headers */
  188.   bfd_getl64, bfd_getl_signed_64, bfd_putl64,
  189.     bfd_getl32, bfd_getl_signed_32, bfd_putl32,
  190.     bfd_getl16, bfd_getl_signed_16, bfd_putl16,
  191.  
  192.   /* bfd_check_format: check the format of a file being read */
  193.   { _bfd_dummy_target,        /* unknown format */
  194.     nlmNAME(object_p),        /* assembler/linker output (object file) */
  195.     bfd_generic_archive_p,    /* an archive */
  196.     nlm_core_file_p        /* a core file */
  197.   },
  198.  
  199.   /* bfd_set_format: set the format of a file being written */
  200.   { bfd_false,
  201.     nlm_mkobject,
  202.     _bfd_generic_mkarchive,
  203.     bfd_false
  204.   },
  205.  
  206.   /* bfd_write_contents: write cached information into a file being written */
  207.   { bfd_false,
  208.     nlmNAME(write_object_contents),
  209.     _bfd_write_archive_contents,
  210.     bfd_false
  211.   },
  212.  
  213.   /* Initialize a jump table with the standard macro.  All names start with
  214.      "nlm" */
  215.   BFD_JUMP_TABLE_GENERIC (_bfd_generic),
  216.   BFD_JUMP_TABLE_COPY (_bfd_generic),
  217.   BFD_JUMP_TABLE_CORE (_bfd_nocore),
  218.   BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive),
  219.   BFD_JUMP_TABLE_SYMBOLS (nlm),
  220.   BFD_JUMP_TABLE_RELOCS (nlm),
  221.   BFD_JUMP_TABLE_WRITE (nlm),
  222.   BFD_JUMP_TABLE_LINK (nlm),
  223.   BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
  224.  
  225.   /* backend_data: */
  226.   (PTR) TARGET_BACKEND_DATA
  227. };
  228. #endif
  229.