00001 /* NLM (NetWare Loadable Module) executable support for BFD. 00002 Copyright 1993, 1994, 2001, 2002, 2003 Free Software Foundation, Inc. 00003 00004 This file is part of BFD, the Binary File Descriptor library. 00005 00006 This program is free software; you can redistribute it and/or modify 00007 it under the terms of the GNU General Public License as published by 00008 the Free Software Foundation; either version 2 of the License, or 00009 (at your option) any later version. 00010 00011 This program is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 GNU General Public License for more details. 00015 00016 You should have received a copy of the GNU General Public License 00017 along with this program; if not, write to the Free Software 00018 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ 00019 00020 #include "bfd.h" 00021 #include "sysdep.h" 00022 #include "libbfd.h" 00023 #include "libnlm.h" 00024 00025 /* Make an NLM object. We just need to allocate the backend 00026 information. */ 00027 00028 bfd_boolean 00029 nlm_mkobject (abfd) 00030 bfd * abfd; 00031 { 00032 bfd_size_type amt = sizeof (struct nlm_obj_tdata); 00033 nlm_tdata (abfd) = (struct nlm_obj_tdata *) bfd_zalloc (abfd, amt); 00034 if (nlm_tdata (abfd) == NULL) 00035 return FALSE; 00036 00037 if (nlm_architecture (abfd) != bfd_arch_unknown) 00038 bfd_default_set_arch_mach (abfd, nlm_architecture (abfd), 00039 nlm_machine (abfd)); 00040 00041 /* since everything is done at close time, do we need any initialization? */ 00042 return TRUE; 00043 } 00044 00045 /* Set the architecture and machine for an NLM object. */ 00046 00047 bfd_boolean 00048 nlm_set_arch_mach (abfd, arch, machine) 00049 bfd * abfd; 00050 enum bfd_architecture arch; 00051 unsigned long machine; 00052 { 00053 bfd_default_set_arch_mach (abfd, arch, machine); 00054 return arch == nlm_architecture (abfd); 00055 }
1.5.6