• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* Free ELF backend handle.
2    Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
3 
4    This program is Open Source software; you can redistribute it and/or
5    modify it under the terms of the Open Software License version 1.0 as
6    published by the Open Source Initiative.
7 
8    You should have received a copy of the Open Software License along
9    with this program; if not, you may obtain a copy of the Open Software
10    License version 1.0 from http://www.opensource.org/licenses/osl.php or
11    by writing the Open Source Initiative c/o Lawrence Rosen, Esq.,
12    3001 King Ranch Road, Ukiah, CA 95482.   */
13 
14 #ifdef HAVE_CONFIG_H
15 # include <config.h>
16 #endif
17 
18 #include <dlfcn.h>
19 #include <stdlib.h>
20 
21 #include <libeblP.h>
22 
23 
24 void
ebl_closebackend(Ebl * ebl)25 ebl_closebackend (Ebl *ebl)
26 {
27   if (ebl != NULL)
28     {
29       /* Run the destructor.  */
30       ebl->destr (ebl);
31 
32       /* Close the dynamically loaded object.  */
33       if (ebl->dlhandle != NULL)
34 	(void) dlclose (ebl->dlhandle);
35 
36       /* Free the resources.  */
37       free (ebl);
38     }
39 }
40